It is impossible (for me) to install pycuda - pleeeeeeeease help

Dear Forum,

I’m unfortunately an inexperienced linux user, you have to give me detailed steps (and explanation) please. I would love to get my nano run to use a brilliant piece of software for electronically assisted astronomy of Alain Paillou.

Therefore I had installed JetPack4.6.1 (I have tried with 5.0 which even no success).
For his software I need the following packages:

  • cuda (which comes with the jetpack)
  • NumPy (which comes with the jetpack?!)
  • openCV (which comes with the jetpack)
  • six (which comes with the jetpack)
  • pillow, I have manually installed

If I start python3 and look for the versions of these packages, I get a version number.
That means to me that these packages are installed, isn’t it???

Only pycuda is missing. I have read the last weeks every thread I could find and tried every hint to get it installed.
But it does not. Every time I get thousands of pages of errors. No chance. I’m done. I do not know what I could try next.

What I have done after flashing the jetpack:

  • sudo apt-get update && sudo apt-get upgrade

  • I even tried to install the packages from above, although they should allready be installed.

  • sudo apt-get install python3-dev lipython3-dev

  • sudo apt-get install python3-pip

  • pyhton3 -m pip install —upgrade pip

  • python3 -m pip install —upgrade Pillow

  • export PATH=${PATH}:/usr/local/cuda/bin

  • export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/cuda/lib64

  • export CPATH=$CPATH:/usr/local/cuda-10.2/targets/aarch64-linux/include

  • export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/cuda-10.2/targets/aarch64-linux/lib

Maybe there is an error finding nvcc:
export PATH=/usr/local/cuda-10.2/bin:$PATH

pip3 install Cython

I have tried:
pip3 install pycuda —user

I have tried:
sudo pip3 install --global-option=build_ext --global-option=“-I/usr/local/cuda/include” --global-option=“-L/usr/local/cuda/lib64” — upgrade pycuda

Nothing works.
The beginning of the errors:
it try to find the correct numpy(1.19.5,1.15.4,1.12.1) version with the correct python3-version (3.7,3.8,3.9,3.10) and that seem to match not correctly. Installed is numpy 1.13.3. But even with a manual install of numpy this error comes up.
Then it show that it can not find libraries like mil_rt, bliss, openblas, tatlas, satlas, and so on

  • svnversion not found
  • could not locate Fortran
  • no such file local.h

Please help me out.
Thomas

Hi,

Please noted that JetPack 5 doesn’t support Nano.
You will need to use the JetPack 4.x for it.

Please try to below command to fix the xlocal issue.
We can install pyCUDA after creating the soft link.

$ sudo ln -s /usr/include/locale.h /usr/include/xlocale.h
$ pip3 install pycuda --user
Collecting pycuda
  Using cached pycuda-2022.1.tar.gz (1.7 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting pytools>=2011.2
  Downloading pytools-2022.1.12.tar.gz (70 kB)
     |████████████████████████████████| 70 kB 1.1 MB/s
  Preparing metadata (setup.py) ... done
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.0.7)
Collecting platformdirs>=2.2.0
  Downloading platformdirs-2.4.0-py3-none-any.whl (14 kB)
Collecting typing_extensions>=4.0
  Downloading typing_extensions-4.1.1-py3-none-any.whl (26 kB)
Collecting dataclasses>=0.7
  Downloading dataclasses-0.8-py3-none-any.whl (19 kB)
Building wheels for collected packages: pycuda, pytools
  Building wheel for pycuda (pyproject.toml) ... done
  Created wheel for pycuda: filename=pycuda-2022.1-cp36-cp36m-linux_aarch64.whl size=645793 sha256=9f58cf50bd82f6e41a70a9f9021462ecee275575f1da1bbe902cd2121b341bc6
  Stored in directory: /home/nvidia/.cache/pip/wheels/19/38/0f/fe701ae5ef6a52593f610c1d5ceec8dcbfae7dbcbd34518478
  Building wheel for pytools (setup.py) ... done
  Created wheel for pytools: filename=pytools-2022.1.12-py2.py3-none-any.whl size=65946 sha256=7945a338ff9154a4dee0e86ca438694166a9558732ccb5934ffb46f68e433c3b
  Stored in directory: /home/nvidia/.cache/pip/wheels/05/b1/56/aa08d4760ce766662705dd7f6fddae17c8d65861d61b2a0f75
Successfully built pycuda pytools
Installing collected packages: typing-extensions, platformdirs, dataclasses, pytools, appdirs, pycuda
Successfully installed appdirs-1.4.4 dataclasses-0.8 platformdirs-2.4.0 pycuda-2022.1 pytools-2022.1.12 typing-extensions-4.1.1

Another alternative is to try our l4t-ml docker, which has pyCUDA preinstalled.

Thanks.

Thanks for the important information. I will give it a try this day.

Could it be so easy?? Yes it can. I have got an error free installation. You’re my hero.
Many Thanks.
Thomas

Good to know it works.
Thanks for the update.

Well, I’m able to install everything what is needed. Then I run the python-script via IDLE, which utilize an usb-astro-camera and get an Ubuntu internal error. Details show only python. I can not rerun the script any more. I get an error : bus-error. If I start the script via terminal python3 and I get immediately this bus error.
I think that this has something to do with some of the packages numpy or opencv. These are preinstalled, right? I didn’t touch them for my workflow.
But I do not know what to do or how I can figure out what (not) going on.
Thanks for help.

Actually I got it running without the error. I do not really know what I have done. I had again problems with pycuda and installed some libraries and cython as in some threads was mentioned. And then I think I did the symbolic link wrong and removed it and reentered it. And suddenly the code was running without the error.

1 Like

Thanks for the update.
Good to know you fix the bus error as well.

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