Docker Community Forums

Share and learn in the Docker community.

Running Opengl apps in docker on a secondary gpu

Hi All,

If anyone can help shed any light on this it would be greatly appreciated. I am trying run an opengl application in docker for a reinforcement learning workload. On a single gpu on the host system I can only run 20 instances of the application. I would like to use docker to isolate the application amd distribute the workload across multiple gpus. I am able to assign gpus to the docker container and run the application in the docker container when the main gpu (the one with the display attached) is assigned. As soon as a try run the application with the secondary gpu it won’t run. I think that I need to create a virtual display to assign to the container but I am stuck at this point. Does anyone have any ideas? Is this even possible? I ultimately want to split around 60 instances of the application evenly across 3 gpus in the system.

If I set the environment variable to -e DISPLAY=:0 and assign gpu 0 it works as expected.
If I set the environment variable to -e DISPLAY=:0 and assign gpu 1 running an opengl app like glxgears gives a segmentation fault and doesn’t run
If I set the environment variable to -e DISPLAY=:1 (or any other number) and assign gpu 1 it says cannot open display