Problems with Pycuda on Jetson Agx Orin

Hello,

I am having problems with PyCuda installation on Jetson Agx Orin 64gb Dev Kit.

nvcc–version result:
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2022 NVIDIA Corporation
Built on Sun_Oct_23_22:16:07_PDT_2022
Cuda compilation tools, release 11.4, V11.4.315
Build cuda_11.4.r11.4/compiler.31964100_0

When I do the following:
export PATH=/usr/local/cuda-11.4/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-11.4/lib64:$LD_LIBRARY_PATH
sudo python3 -m pip install pycuda --user

I got the following error:
check.warn(importable)
error: command ‘/usr/bin/aarch64-linux-gnu-gcc’ failed with exit code 1
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pycuda
Failed to build pycuda
ERROR: Could not build wheels for pycuda, which is required to install pyproject.toml-based projects

Please provide advice how to fix this.

Addtion:
when I try pip3 install pycuda, I get the following:
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: pycuda in /home/dls/.local/lib/python3.8/site-packages (2022.2.2)
Requirement already satisfied: pytools>=2011.2 in /home/dls/.local/lib/python3.8/site-packages (from pycuda) (2023.1.1)
Requirement already satisfied: appdirs>=1.4.0 in /home/dls/.local/lib/python3.8/site-packages (from pycuda) (1.4.4)
Requirement already satisfied: mako in /usr/lib/python3/dist-packages (from pycuda) (1.1.0)
Requirement already satisfied: platformdirs>=2.2.0 in /home/dls/.local/lib/python3.8/site-packages (from pytools>=2011.2->pycuda) (3.10.0)
Requirement already satisfied: typing-extensions>=4.0 in /home/dls/.local/lib/python3.8/site-packages (from pytools>=2011.2->pycuda) (4.8.0)

When I run my script, I get following error:
import pycuda.autoinit
ModuleNotFoundError: No module named ‘pycuda’

Hi,

We give it a try and be able to import pycuda.autoinit successfully.
Could you try it again?

$ python3 -m pip install pycuda --user
Collecting pycuda
  Downloading pycuda-2022.2.2.tar.gz (1.7 MB)
     |████████████████████████████████| 1.7 MB 844 kB/s
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Collecting pytools>=2011.2
  Downloading pytools-2023.1.1-py2.py3-none-any.whl (70 kB)
     |████████████████████████████████| 70 kB 864 kB/s
Collecting appdirs>=1.4.0
  Downloading appdirs-1.4.4-py2.py3-none-any.whl (9.6 kB)
Requirement already satisfied: mako in /usr/lib/python3/dist-packages (from pycuda) (1.1.0)
Collecting typing-extensions>=4.0; python_version < "3.11"
  Downloading typing_extensions-4.8.0-py3-none-any.whl (31 kB)
Collecting platformdirs>=2.2.0
  Downloading platformdirs-3.10.0-py3-none-any.whl (17 kB)
Building wheels for collected packages: pycuda
  Building wheel for pycuda (PEP 517) ... done
  Created wheel for pycuda: filename=pycuda-2022.2.2-cp38-cp38-linux_aarch64.whl size=652937 sha256=126a235b00c24488ee5ee85a8f89d117e58472a4fa539432382a9d662d47d652
  Stored in directory: /home/nvidia/.cache/pip/wheels/7b/41/0d/7cecb04af969d283ebe4a69579a8b2baec0d010a1ac4159f7e
Successfully built pycuda
Installing collected packages: typing-extensions, platformdirs, pytools, appdirs, pycuda
Successfully installed appdirs-1.4.4 platformdirs-3.10.0 pycuda-2022.2.2 pytools-2023.1.1 typing-extensions-4.8.0
$ python3
Python 3.8.10 (default, May 26 2023, 14:05:08)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pycuda.autoinit
>>>

Thanks.

Hi, I have problem with the installation PyCuda. How to solve the problem?

d@d-desktop:~/Desktop$ python3 -m pip install pycuda --user
Requirement already satisfied: pycuda in /home/dls/.local/lib/python3.8/site-packages (2022.2.2)
Requirement already satisfied: pytools>=2011.2 in /home/dls/.local/lib/python3.8/site-packages (from pycuda) (2023.1.1)
Requirement already satisfied: appdirs>=1.4.0 in /home/dls/.local/lib/python3.8/site-packages (from pycuda) (1.4.4)
Requirement already satisfied: mako in /usr/lib/python3/dist-packages (from pycuda) (1.1.0)
Requirement already satisfied: platformdirs>=2.2.0 in /home/dls/.local/lib/python3.8/site-packages (from pytools>=2011.2->pycuda) (3.10.0)
Requirement already satisfied: typing-extensions>=4.0 in /home/dls/.local/lib/python3.8/site-packages (from pytools>=2011.2->pycuda) (4.8.0)
d@d-desktop:~/Desktop$ python3
Python 3.8.10 (default, May 26 2023, 14:05:08)
[GCC 9.4.0] on linux
Type “help”, “copyright”, “credits” or “license” for more information.

import pycyda.autoinit
Traceback (most recent call last):
File “”, line 1, in
ModuleNotFoundError: No module named ‘pycyda’

Hi,
I have tried this and still get error on import pycuda.autoint

import pycyda.autoinit
Traceback (most recent call last):
File “”, line 1, in
ModuleNotFoundError: No module named ‘pycyda’

Hi @marinkovicivan, I think this is a typo - pycyda should be pycuda

Hi, just changed to pycuda and result in same error:
import pycuda.autoinit
Traceback (most recent call last):
File “”, line 1, in
ModuleNotFoundError: No module named ‘pycuda’

What does pip3 show pycuda show? If not found, how about sudo pip3 show pycuda ?

Here is how I build/install the pycuda wheel in Dockerfile:

pip3 show pycuda result:

Name: pycuda
Version: 2022.2.2
Summary: Python wrapper for Nvidia CUDA
Home-page: PyCUDA
Author: Andreas Kloeckner
Author-email: inform@tiker.net
License: MIT
Location: /home/dls/.local/lib/python3.8/site-packages
Requires: appdirs, mako, pytools
Required-by:

sudo pip3 show pycuda result:
WARNING: Package(s) not found: pycuda

Hmm okay - you should be able to do python3 -c 'import pycuda' then. Does that work?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.