No module named 'cuda'

DS 7.0
dGPU

I’m having this problem since two days, basically since I’m trying to install the Python apps (latest version for 7.0) on various platforms: Jetson Nano and dGPU.

After having followed successfully all the steps to install the python apps from here deepstream_python_apps/bindings at master · NVIDIA-AI-IOT/deepstream_python_apps · GitHub I run into a problem I never had with previous installations (up to 6.4):

python3 deepstream_test_1.py /opt/nvidia/deepstream/deepstream-7.0/samples/streams/sample_1080p_h264.mp4
Traceback (most recent call last):
  File "/opt/nvidia/deepstream/deepstream-7.0/sources/deepstream_python_apps/apps/deepstream-test1/deepstream_test_1.py", line 26, in <module>
    from common.platform_info import PlatformInfo
  File "/opt/nvidia/deepstream/deepstream-7.0/sources/deepstream_python_apps/apps/deepstream-test1/../common/platform_info.py", line 21, in <module>
    from cuda import cudart
ModuleNotFoundError: No module named 'cuda'

I haven’t found a solution yet. sudo pip3 install pycuda doesn’t help. I suppose it has to do with the new API for obtaining platform info (?)

How to recover from that?

Indeed, removing all “platform_info” references and the import helps to overcome this.

I also tried to install CUDA Toolkit 12.4 to recover from that, but it didn’t work out. What dependency is missing?

We use a new way to identify the platforms like deepstream_test_1.py.

Could you try to run our script to install the python binding?

user_deepstream_python_apps_install.sh in the "/opt/nvidia/deepstream/deepstream" directory.

I already thought about that. There is not such a script. I was using the deb install method.

├── LICENSE.txt
├── LicenseAgreement.pdf
├── README
├── README.rhel
├── bin
├── install.sh
├── lib
├── rtpjitterbuffer_eos_handling.patch
├── samples
├── service-maker
├── sources
├── uninstall.sh
├── update_rtpmanager.sh
└── version

If all dependencies have been installed correctly, please try the following command, which is a new dependency of DS-7.0

pip3 install cuda-python

If you use docker image, you can find the user_deepstream_python_apps_install.sh

2 Likes

pip3 install cuda-python

Yes, thanks. That resolves this dependency. Should be documented.

Thanks. We’ll add this to the bindings/README file later.

2 Likes

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