I'm trying to get the nvidia hardware acceleration running inside of a Docker container. So far I hat no success. When running glxgears I get the following error.
root@fea7a51ac757:/# glxgears
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 154 (GLX)
Minor opcode of failed request: 3 (X_GLXCreateContext)
Value in failed request: 0x0
Serial number of failed request: 35
Current serial number in output stream: 37
My docker file looks like this
FROM osrf/ros:lunar-desktop-full
# nvidia-docker hooks
LABEL com.nvidia.volumes.needed="nvidia_driver"
ENV PATH /usr/local/nvidia/bin:${PATH}
ENV LD_LIBRARY_PATH /usr/local/nvidia/lib:/usr/local/nvidia/lib64:${LD_LIBRARY_PATH}
EXPOSE 11311
EXPOSE 11345
And I started the container with
nvidia-docker run -it --volume=/tmp/.X11-unix:/tmp/.X11-unix --device=/dev/dri:/dev/dri --env="DISPLAY" my-custom-image
I currently I don't know that the nvidia-driver inside of the container needs to have the same version. but I don't know how to check this of if this is even the problem.
nvidia-smi says
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 384.90 Driver Version: 384.90 |
|-------------------------------+----------------------+----------------------+
I used this as an guide to solve the problem without any success