Running hardware accelerated app in nvidia jetson nano docker container


Following the instructions at 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
    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

gdb log:

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

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