Nvidia-docker: Add nvidia_drv.so to the volume for X

Created on 25 Apr 2017  路  2Comments  路  Source: NVIDIA/nvidia-docker

I am trying to set up X inside the docker (for debugging purposes), and want to use nvidia driver (it is loaded).
I already have Xpra and VNC working but I need an actual X

It seems the X driver is not added to the volume, was there any particular reason?

unsupported

Most helpful comment

I could run X from within nvidia docker. But I needed to manually add libglx.so.375.20 and nvidia_drv.so to lib64 in the volume and then tell Xorg to use them.

COPY glamoregl.conf /usr/share/X11/xorg.conf.d/
COPY nvidia-drm-outputclass.conf /usr/share/X11/xorg.conf.d/50-nvidia-drm-outputclass.conf/
COPY 20-nvidia.conf /usr/share/X11/xorg.conf.d/
RUN ln -sfT /usr/local/nvidia/lib64/nvidia_drv.so  /usr/lib/xorg/modules/drivers/nvidia_drv.so
RUN ln -sfT /usr/local/nvidia/lib64/libglx.so.375.20 /usr/lib/xorg/modules/extensions/libglx.so

It works fine so wanted to share how to do it. It would be a great help if the volume already had those files (like in /usr/local/nvidia/xorg/).
You wont have to support the actual wiring of X, but the presence of those files will be helpful for setting up X.

All 2 comments

CUDA is the only thing supported by nvidia-docker for now and we don't plan to support X11 in the near term.

I could run X from within nvidia docker. But I needed to manually add libglx.so.375.20 and nvidia_drv.so to lib64 in the volume and then tell Xorg to use them.

COPY glamoregl.conf /usr/share/X11/xorg.conf.d/
COPY nvidia-drm-outputclass.conf /usr/share/X11/xorg.conf.d/50-nvidia-drm-outputclass.conf/
COPY 20-nvidia.conf /usr/share/X11/xorg.conf.d/
RUN ln -sfT /usr/local/nvidia/lib64/nvidia_drv.so  /usr/lib/xorg/modules/drivers/nvidia_drv.so
RUN ln -sfT /usr/local/nvidia/lib64/libglx.so.375.20 /usr/lib/xorg/modules/extensions/libglx.so

It works fine so wanted to share how to do it. It would be a great help if the volume already had those files (like in /usr/local/nvidia/xorg/).
You wont have to support the actual wiring of X, but the presence of those files will be helpful for setting up X.

Was this page helpful?
0 / 5 - 0 ratings