Copy pycuda binaries and libraries from devel image inside runtime image

I develop a runtime image for robotic applications in Jetson Xavier NX. I build all libraries and ros packages in development docker image and copy all necessary files inside runtime images. I need pycuda for runtime dependency so I wanted to install it with pip inside runtime container.

I haven’t been able to install pycuda inside runtime image because pycuda needs nvcc headers and runtime image doesn’t contain nvcc header files. I, therefore, have to install pycuda inside devel image but I don’t know if it is possible to copy pycuda binaries and libraries from devel image to runtime image. I don’t want to work with devel image as my finalized image because it is 2GiB larger than runtime image but I don’t know what my options are. What are my options? Is it possible to copy pycuda binaries and libraries?

Regards, Fettah.


Which JetPack version do you use?
For JetPack 4, the CUDA library will be mounted into the container if --runtime nvidia is used.


Are cuda header files mounted in the latest cuda runtime images as well? Because pycuda installer wasn’t able to find them and I couldn’t locate them as well. Therefore pycuda wasn’t installed on these images.

My cuda version 11.4 and cudnn version is 8.3.2

I tried these images:

Hi @f.requiem11, on JetPack 5.x, the CUDA headers don’t get mounted in, and as you’ve found the l4t-tensorrt doesn’t have these as it’s a runtime container, not a development container.

What I would try doing is copying /usr/local/lib/python3.8/dist-packages/pycuda from your devel container into your runtime container and seeing if that works.

Thanks a lot, I will try that and let you know.

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