Closed BH1SCW closed 6 years ago
BR,
It is possible to run GUI applications in docker using this method. Couple things you'll have to add:
In your Dockerfile you'll need to add the following line:
ENV DISPLAY :0
Modify the tx2-docker file and add a new line to the NV_LIBS so that it will expose the /tmp/.X11-unix/X0 file as a volume. Your modified NV_LIBS will look like this:
NV_LIBS="/usr/lib/aarch64-linux-gun /tmp/.X11-unix/X0"
You'll have to run 'xhost+' before running your docker command. This will allow the docker container permission to use your XDisplay
So to display a simple example like xeyes, your Dockerfile would look like: `FROM arm64v8/ubuntu:16.04
RUN apt-get update RUN apt-get install -qqy x11-apps ENV DISPLAY :0
CMD xeyes`
This however, won't solve your problem of attempting to run something like nbody in a container. Nbody, and I think all the other samples that come with CUDA, all use OpenGL. As far as I know OpenGL will not run directly from a container. I believe you will need to use something like VirualGL. This should be possible within the Docker framework on the TX-2 but would need someone to take the time to figure out the details. Unfortunately, we are working on some other items right now that don't directly relate to this but I will put it on our to-do list. If someone has some time to look at this, it would be great to figure out the details and document them for the community.
Actually it looks like OpenGL will run directly on the Jetson TX2 from a docker container. I built on the information and samples in this excellent repository to accomplish that with minor modifications - much easier than the above post suggests (although that might be a better way to do things).
The files I used can be found here
Awesome! Looks like the missing piece is --net=host.
Will update tx2-docker accordingly. Also going to update so that the LD_LIBRARY_PATH gets set with the required libraries in tx2_docker automatically so you don't have to remember to set each time in your dockerfile.
Updated instructions and tx2-docker script with ability to run GUI apps
Awesome! Greate thanks ! it works!!!!
First Thanks for sharing. I can run devece query in docker following your guide step by step. My question is how to run gui sample in docker, for example nbody.
I got log as: x error of failed request bad value
any suggestion? BR