Nvidia-docker: Is it possible to install NVidia driver inside Docker?

Created on 1 Dec 2018  路  8Comments  路  Source: NVIDIA/nvidia-docker

There are two reasons I want to install the NVIDIA driver package, although I am well aware of work-arounds:

  1. When running CMake and FindCUDA.cmake from a Dockerfile it would be useful to auto-detect the architecture.

  2. If the host machine has a slightly older NVIDIA driver, it might not be able to support, say, CUDA 9.2 in the Container, and I don't want to force users to upgrade.

So, is this possible?

Most helpful comment

Note that the Wiki page is now NVIDIA driver container - Beta as it has moved from the Experimental stage.

All 8 comments

Have you looked at building and using NVIDIA driver container. It may solve your issues.

That looks like what I need, thanks.

Note that the Wiki page is now NVIDIA driver container - Beta as it has moved from the Experimental stage.

So to clarify, do the nvidia/cuda docker images come with Nvidia drivers pre-installed?
If not, what is the set of Dockerfile commands to run to download/install the Nvidia drivers into that Docker image?

Thanks

Would also like to know this - how to upgrade the driver inside the Dockerfile?

I guess you can take the nvidia-driver dockerfile from https://gitlab.com/nvidia/container-images/driver/-/blob/master/ubuntu18.04/Dockerfile and join it to cuda one.

For anyone looking to install NVIDIA drivers within their own docker image (I need one for jupyterlab on AKS), run:

NVIDIA-Linux-x86_64-396.26.run -s --no-kernel-module

You may need to install kmod

For anyone looking to install NVIDIA drivers within their own docker image (I need one for jupyterlab on AKS), run:

NVIDIA-Linux-x86_64-396.26.run -s --no-kernel-module

You may need to install kmod

This comment does not work

./NVIDIA-Linux-x86_64-460.39.run  -s --no-kernel-module
Verifying archive integrity... OK
Uncompressing NVIDIA Accelerated Graphics Driver for Linux-x86_64 460.39...............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

WARNING: You specified the '--no-kernel-module' command line option, nvidia-installer will not install a
         kernel module as part of this driver installation, and it will not remove existing NVIDIA
         kernel modules not part of an earlier NVIDIA driver installation.  Please ensure that an NVIDIA
         kernel module matching this driver version is installed separately.


WARNING: nvidia-installer was forced to guess the X library path '/usr/lib' and X module path
         '/usr/lib/xorg/modules'; these paths were not queryable from the system.  If X fails to find
         the NVIDIA X driver module, please install the `pkg-config` utility and the X.Org
         SDK/development package for your distribution and reinstall the driver.


WARNING: Unable to find a suitable destination to install 32-bit compatibility libraries. Your system
         may not be set up for 32-bit compatibility. 32-bit compatibility files will not be installed;
         if you wish to install them, re-run the installation and set a valid directory with the
         --compat32-libdir option.


WARNING: Unable to determine the path to install the libglvnd EGL vendor library config files. Check
         that you have pkg-config and the libglvnd development libraries installed, or specify a path
         with --glvnd-egl-config-path.


ERROR: Unable to delete '/usr/lib/x86_64-linux-gnu/libnvidia-cfg.so.418.67' (Device or resource busy).


ERROR: Unable to backup file '/usr/lib/x86_64-linux-gnu/libnvidia-cfg.so.418.67'.


ERROR: Unable to delete '/usr/lib/x86_64-linux-gnu/libcuda.so.418.67' (Device or resource busy).


ERROR: Unable to backup file '/usr/lib/x86_64-linux-gnu/libcuda.so.418.67'.


ERROR: Unable to delete '/usr/lib/x86_64-linux-gnu/libnvidia-opencl.so.418.67' (Device or resource
       busy).


ERROR: Unable to backup file '/usr/lib/x86_64-linux-gnu/libnvidia-opencl.so.418.67'.


ERROR: Unable to delete '/usr/lib/x86_64-linux-gnu/libnvidia-compiler.so.418.67' (Device or resource
       busy).


ERROR: Unable to backup file '/usr/lib/x86_64-linux-gnu/libnvidia-compiler.so.418.67'.


ERROR: Unable to delete '/usr/lib/x86_64-linux-gnu/libnvidia-ml.so.418.67' (Device or resource busy).


ERROR: Unable to backup file '/usr/lib/x86_64-linux-gnu/libnvidia-ml.so.418.67'.


ERROR: Unable to delete '/usr/lib/x86_64-linux-gnu/libnvidia-ptxjitcompiler.so.418.67' (Device or
       resource busy).


ERROR: Unable to backup file '/usr/lib/x86_64-linux-gnu/libnvidia-ptxjitcompiler.so.418.67'.


ERROR: Unable to delete '/usr/bin/nvidia-smi' (Device or resource busy).


ERROR: Unable to backup file '/usr/bin/nvidia-smi'.


ERROR: Unable to delete '/usr/bin/nvidia-debugdump' (Device or resource busy).


ERROR: Unable to backup file '/usr/bin/nvidia-debugdump'.


ERROR: Unable to delete '/usr/bin/nvidia-cuda-mps-control' (Device or resource busy).


ERROR: Unable to backup file '/usr/bin/nvidia-cuda-mps-control'.


ERROR: Unable to delete '/usr/bin/nvidia-cuda-mps-server' (Device or resource busy).


ERROR: Unable to backup file '/usr/bin/nvidia-cuda-mps-server'.


ERROR: Unable to delete '/usr/bin/nvidia-persistenced' (Device or resource busy).


ERROR: Unable to backup file '/usr/bin/nvidia-persistenced'.


ERROR: Unable to create '/usr/bin/nvidia-smi' for copying (Read-only file system)


ERROR: Unable to create '/usr/bin/nvidia-debugdump' for copying (Read-only file system)


ERROR: Unable to create '/usr/bin/nvidia-cuda-mps-control' for copying (Read-only file system)


ERROR: Unable to create '/usr/bin/nvidia-cuda-mps-server' for copying (Read-only file system)


ERROR: Unable to create '/usr/bin/nvidia-persistenced' for copying (Read-only file system)
Was this page helpful?
0 / 5 - 0 ratings

Related issues

jonghwanhyeon picture jonghwanhyeon  路  4Comments

romansavrulin picture romansavrulin  路  4Comments

o1lo01ol1o picture o1lo01ol1o  路  4Comments

mmitterma picture mmitterma  路  4Comments

djglowny picture djglowny  路  3Comments