No module named 'cuda' - Deepstream 7.0

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) Jetson
• DeepStream Version 7.0
• JetPack Version (valid for Jetson only) 6.0
• TensorRT Version 8.6
• NVIDIA GPU Driver Version (valid for GPU only)
• Issue Type( questions, new requirements, bugs) bugs
• How to reproduce the issue ? (This is for bugs. Including which sample app is using, the configuration files content, the command line used and other details for reproducing)
• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description)

version :
deepstream-app version 7.0.0
DeepStreamSDK 7.0.0
CUDA Driver Version: 12.2
CUDA Runtime Version: 12.2
TensorRT Version: 8.6
cuDNN Version: 8.9
libNVWarp360 Version: 2.0.1d3

While installing deepstream 7.0 and running deepstream-test1, I got a No module named ‘cuda’ error.

$ sudo python3 deepstream_test_1.py /opt/nvidia/deepstream/deepstream/samples/streams/sample_720p.h264

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 also did

pip3 install cuda-python

but when I run test I get the same error.

How can I fix the error and run test 1?

Is there any difference in the output of the following two commands?

python -c "import sys; print(sys.executable)"

sudo python -c "import sys; print(sys.executable)"

Or you can try sudo pip install cuda-python

Or

sudo chmod -R a+w /opt/nvidia/deepstream/deepstream

python3 deepstream_test_1.py /opt/nvidia/deepstream/deepstream/samples/streams/sample_720p.h264

I ran the following code and successfully ran test 1.

sudo pip install cuda-python

But when I run test 1,

$ sudo python3 deepstream_test_1.py /opt/nvidia/deepstream/deepstream/samples/streams/sample_720p.h264

(gst-plugin-scanner:21516): GStreamer-WARNING **: 13:23:55.294: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_inferserver.so': libtritonserver.so: cannot open shared object file: No such file or directory

(gst-plugin-scanner:21516): GStreamer-WARNING **: 13:23:55.323: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_udp.so': librivermax.so.0: cannot open shared object file: No such file or directory
(Argus) Error EndOfFile: Unexpected error in reading socket (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadCore(), line 266)
(Argus) Error EndOfFile: Receive worker failure, notifying 1 waiting threads (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadCore(), line 339)
(Argus) Error InvalidState: Argus client is exiting with 1 outstanding client threads (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadCore(), line 355)
(Argus) Error EndOfFile: Receiving thread terminated with error (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadWrapper(), line 368)
(Argus) Error EndOfFile: Client thread received an error from socket (in src/rpc/socket/client/ClientSocketManager.cpp, function send(), line 145)
(Argus) Error EndOfFile:  (propagating from src/rpc/socket/client/SocketClientDispatch.cpp, function dispatch(), line 91)
GLib (gthread-posix.c): Unexpected error from C library during 'pthread_setspecific': Invalid argument.  Aborting.

GStreamer-WARNING occurs and test 1 runs successfully.

GStream-WARNING did not occur with deepstream 6.4, but this can be safely ignored.

Since some components are not supported by the system, these warnings are normal

For this, it’s a issue about glib, please refer this link

https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_Installation.html#remove-all-previous-deepstream-installations

Now runs well. thank you.

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