On the previous L4T R28.2 I could access the GPU from docker containers following the approach outlined in:
Unfortunately this doesn’t seem to work for the latest L4T R32.1 from Jetpack 4.2 I haven’t been able to make it work e.g. if a I create a simple container with all the samples included using:
COPY NVIDIA_CUDA-10.0_Samples NVIDIA_CUDA-10.0_Samples
… and then run it mapping all the /dev/nv* devices:
$ docker run -it --device=/dev/nvhost-as-gpu --device=/dev/nvhost-ctrl --device=/dev/nvhost-ctrl-gpu --device=/dev/nvhost-ctrl-isp --device=/dev/nvhost-ctrl-nvcsi --device=/dev/nvhost-ctrl-nvdec --device=/dev/nvhost-ctxsw-gpu --device=/dev/nvhost-dbg-gpu --device=/dev/nvhost-gpu --device=/dev/nvhost-isp --device=/dev/nvhost-msenc --device=/dev/nvhost-nvcsi --device=/dev/nvhost-nvdec --device=/dev/nvhost-nvjpg --device=/dev/nvhost-prof-gpu --device=/dev/nvhost-sched-gpu --device=/dev/nvhost-tsec --device=/dev/nvhost-tsecb --device=/dev/nvhost-tsg-gpu --device=/dev/nvhost-vi --device=/dev/nvhost-vic --device=/dev/nvmap -v /usr/local/cuda-10.0:/usr/local/cuda-10.0 cuda_container
CUDA Device Query (Runtime API) version (CUDART static linking)
cudaGetDeviceCount returned 35
-> CUDA driver version is insufficient for CUDA runtime version
Result = FAIL
… which suggests some part of the driver isn’t properly punched through?
I am doing something obviously wrong or is there a real issue here?
PS. f I run the deviceQuery directly in L4T it works fine obviously.
JetPack4.2 is Ubuntu18.04.
Could you update your dockerfile with ubuntu 18.04 and try it again?
That makes no difference unfortunately - same error.
I see over in the ticket asking about nvidia-docker we are told:
The nvidia-docker will be included with JetPack 4.2.1, to be released first week of July.
Does that imply that there is no way of getting CUDA and docker to play nicely before that with Jetpack 4.2. I have a system that is scheduled to be mounted onto a vehicle (and thus become very expensive and disruptive to access for flashing - though no problem with ssh access) in the last week of June.
I can run the deviceQuery sample without issue on the JetPack4.2.
Here are our steps for your reference:
1. Build deviceQuery sample
cp deviceQuery ~
RUN mkdir /cudaSamples
COPY deviceQuery /cudaSamples/
3. Build and execute
sudo docker build -t device_query .
sudo docker run --device=/dev/nvhost-ctrl --device=/dev/nvhost-ctrl-gpu --device=/dev/nvhost-prof-gpu --device=/dev/nvmap --device=/dev/nvhost-gpu --device=/dev/nvhost-as-gpu -v /usr/lib/aarch64-linux-gnu/tegra:/usr/lib/aarch64-linux-gnu/tegra device_query
Almost - that works for deviceQuery but fails for some of the other examples which requre more of the libraries.
If I tweak it slightly e.g.:
COPY NVIDIA_CUDA-10.0_Samples/bin/aarch64/linux/release/matrixMulCUBLAS .
… and run with:
docker run --device=/dev/nvhost-ctrl --device=/dev/nvhost-ctrl-gpu --device=/dev/nvhost-prof-gpu --device=/dev/nvmap --device=/dev/nvhost-gpu --device=/dev/nvhost-as-gpu -v /usr/lib/aarch64-linux-gnu/tegra:/usr/lib/aarch64-linux-gnu/tegra -v /usr/local/cuda-10.0/lib64:/usr/local/cuda-10.0/lib64 cuda_container
Then it works.
Thanks for your help with this!