Running hardware accelerated app in nvidia jetson nano docker container

Hello,

Following the instructions at https://github.com/NVIDIA/nvidia-docker/wiki/NVIDIA-Container-Runtime-on-Jetson i am doing some tests for running GUI apps in a docker container in a jetson nano, i’m using the following code to do the tests:

    docker run --runtime nvidia --network host -it -e DISPLAY=$DISPLAY -v /tmp/.X11-unix/:/tmp/.X11-unix nvcr.io/nvidia/l4t-base:r32.4.3
     
    apt-get update && apt-get install -y mesa-utils
   
    export DISPLAY=:0.0 && glxgears

everything works well, in this example i run the container in host mode (–network host) but i have an application where i want to run the container isolated from the host, after i remove --network host and run the container, doing the same steps i got the following error:

root@056440576e00:/# glxgears 
Segmentation fault (core dumped)

the strace log:

socket(AF_UNIX, SOCK_DGRAM, 0)          = 7
  connect(7, {sa_family=AF_UNIX, sun_path=@"nvidia20ac498a\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}, 66) = -1 ECONNREFUSED (Connection refused)
  close(7)                                = 0
  --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x28c48} ---
  +++ killed by SIGSEGV (core dumped) +++
  Segmentation fault
  root@056440576e00:/# 

gdb log:

(gdb) r
 Starting program: /usr/bin/glxgears 
 [Thread debugging using libthread_db enabled]
 Using host libthread_db library "/lib/aarch64-linux-gnu/libthread_db.so.1".
 
 Program received signal SIGSEGV, Segmentation fault.
 0x0000007fb78736a4 in ?? () from /usr/lib/aarch64-linux-gnu/libGLX_nvidia.so.0
 (gdb) 

why i’m getting the segmentation fault only running in the isolated mode. Maybe i have to mount other things besides /tmp/.X11-unix/:/tmp/.X11-unix

the host is running yocto using the dunfell-l4t-r32.4.3 branch from meta-tegra

1 Like