Docker Community Forums

Share and learn in the Docker community.

An NVIDIA kernel module ‘nvidia-uvm’ appears to already be loaded in your kernel

I need a specific version of the nvidia-driver-455.38 (yes, I need exactly the 455.38 not any other 455 drivers).

Dockerfile:

FROM ubuntu:18.04

SHELL ["/bin/bash", "-xo", "pipefail", "-c"]
ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update && apt-get install -y kmod
RUN curl https://us.download.nvidia.com/XFree86/Linux-x86_64/455.38/NVIDIA-Linux-x86_64-455.38.run -o NVIDIA-Linux-x86_64-455.38.run
RUN chmod +x ./NVIDIA-Linux-x86_64-455.38.run
RUN ./NVIDIA-Linux-x86_64-455.38.run --silent

I have the following error:

root@07c4fbe6e9f4:/workspace# ./NVIDIA-Linux-x86_64-455.38.run --silent
Verifying archive integrity... OK
Uncompressing NVIDIA Accelerated Graphics Driver for Linux-x86_64 455.38..................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

ERROR: An NVIDIA kernel module 'nvidia-uvm' appears to already be loaded in your kernel.  This may be because it is in use (for example, by an X server, a CUDA program, or
       the NVIDIA Persistence Daemon), but this may also happen if your kernel was configured without support for module unloading.  Please be sure to exit any programs
       that may be using the GPU(s) before attempting to upgrade your driver.  If no GPU-based programs are running, you know that your kernel supports module unloading,
       and you still receive this message, then an error may have occured that has corrupted an NVIDIA kernel module's usage count, for which the simplest remedy is to
       reboot your computer.


ERROR: Installation has failed.  Please see the file '/var/log/nvidia-installer.log' for details.  You may find suggestions on fixing installation problems in the README
       available on the Linux driver download page at www.nvidia.com.

Details:

root@07c4fbe6e9f4:/workspace# cat '/var/log/nvidia-installer.log'
nvidia-installer log file '/var/log/nvidia-installer.log'
creation time: Wed Aug  4 11:02:14 2021
installer version: 455.38

PATH: /opt/tensorrt/bin:/usr/local/mpi/bin:/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/ucx/bin

nvidia-installer command line:
    ./nvidia-installer
    --silent

Using built-in stream user interface
-> Detected 16 CPUs online; setting concurrency level to 16.
ERROR: An NVIDIA kernel module 'nvidia-uvm' appears to already be loaded in your kernel.  This may be because it is in use (for example, by an X server, a CUDA program, or the NVIDIA Persistence Daemon), but this may also happen if your kernel was configured without support for module unloading.  Please be sure to exit any programs that may be using the GPU(s) before attempting to upgrade your driver.  If no GPU-based programs are running, you know that your kernel supports module unloading, and you still receive this message, then an error may have occured that has corrupted an NVIDIA kernel module's usage count, for which the simplest remedy is to reboot your computer.
ERROR: Installation has failed.  Please see the file '/var/log/nvidia-installer.log' for details.  You may find suggestions on fixing installation problems in the README available on the Linux driver download page at www.nvidia.com.

How can I solve this?

Before I used to install the driver using

RUN apt-get update && apt-get install -y software-properties-common ubuntu-drivers-common lshw
RUN add-apt-repository ppa:graphics-drivers/ppa
RUN apt install -y nvidia-driver-455

but that does not allow me to specify the specific driver build (455.38). I need this specific version because I need to use CUDA and I am using Balena Cloud, therefore the drivers in the guest OS must match the one in the host machine.

Thank you!