ImportError: cannot import name 'cudart' from 'cuda' (unknown location) on deepstream 7.1

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) NVIDIA T400 4GB
• DeepStream Version 7.1
• JetPack Version (valid for Jetson only) NA
• TensorRT Version
• NVIDIA GPU Driver Version (valid for GPU only) 560
• Issue Type( questions, new requirements, bugs)

when running below command i am getting error

python3 deepstream_test_1.py /opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4

Traceback (most recent call last):
File “/opt/nvidia/deepstream/deepstream-7.1/sources/deepstream_python_apps/apps/deepstream-test1/deepstream_test_1.py”, line 26, in
from common.platform_info import PlatformInfo
File “/opt/nvidia/deepstream/deepstream-7.1/sources/deepstream_python_apps/apps/deepstream-test1/../common/platform_info.py”, line 21, in
from cuda import cudart
ImportError: cannot import name ‘cudart’ from ‘cuda’ (unknown location)
• 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)

i am following instructions from below link

docker pull nvcr.io/nvidia/deepstream:7.1-gc-triton-devel

in side docker shell

i run following script

FROM nvcr.io/nvidia/deepstream:7.1-gc-triton-devel

RUN apt-get update && apt-get install -y python3-pip

RUN pip3 install cuda-python

WORKDIR /opt/nvidia/deepstream/deepstream
RUN ./user_deepstream_python_apps_install.sh --build-bindings -r v1.2.0

WORKDIR /opt/nvidia/deepstream/deepstream/sources/deepstream_python_apps/apps/deepstream-test1
CMD [“python3”, “deepstream_test_1.py”, “/opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4”]

• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description)

Could you try to just enter the docker and run the pipeline first?

yes i have try that let me share what i have done

xhost +

docker run -it --rm --network=host --gpus all -e DISPLAY=$DISPLAY --device /dev/snd -v /tmp/.X11-unix/:/tmp/.X11-unix nvcr.io/nvidia/deepstream:7.1-gc-triton-devel

inside the docker shell i have run following command

./install.sh

./user_additional_install.sh

./user_deepstream_python_apps_install.sh --build-bindings -r v1.2.0

then i go to

/opt/nvidia/deepstream/deepstream/sources/deepstream_python_apps/apps/deepstream-test1

python3 deepstream_test_1.py /opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4

i am getting same error

Have you installed the pyds? Please refer to the deepstream_python_apps to install the pyds.

hi the command ./user_deepstream_python_apps_install.sh --build-bindings -r v1.2.0 do install pyds. this issue solved by running the pip3 install cuda-python==12.6 by default its installing 13.0