2

I want to install Docker NVIDIA packages on Ubuntu Desktop (Windows 10 Pro is a host OS). I do have Docker runnung and now I am trying to install the NVIDIA driver for Ubuntu.

After the following steps:

$ sudo apt update
$ sudo apt upgrade
$ sudo apt install nvidia-driver-510

I have this (after rebooting):

sarah@WIN-8BAACGLFG8Q:~$ nvidia-smi
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

Then I ran the same command on my host OS:

C:\Users\User>nvidia-smi
Thu Mar 17 22:15:45 2022
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 461.92       Driver Version: 461.92       CUDA Version: 11.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name            TCC/WDDM | Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  GeForce MX330      WDDM  | 00000000:02:00.0 Off |                  N/A |
| N/A   42C    P0    N/A /  N/A |     64MiB /  2048MiB |      3%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

After that, I thought that maybe versions have to match and tried to install nvidia-driver-460 on Ubuntu. Error remained.

Then I followed the solutions from here. Nothing changed.

This Stack Overflow answer didn't help either.

I also disabled Secure Boot. The same.

NotTheDr01ds
  • 17,574
  • 4
  • 44
  • 81

1 Answers1

2

Under WSL, you can't actually install a Linux video driver, since you don't have a video device in the first place. Your Ubuntu WSL instance is actually a container itself, running in the WSL2 VM (that you can't access). So just like you can't install a video driver into a Docker container, you can't install a video driver in WSL.

However, if your goal is to use the nVidia Docker images for GPU compute tasks, then Microsoft has enabled GPU compute in WSL2 using the Windows nVidia driver. See Enable NVIDIA CUDA on WSL for details.

You'll need at least Windows 10 21H2 (so very recent) or Windows 11. You'll also want to have a very recent Windows nVidia driver installed.

While I haven't done it myself, this Docker article covers using the nVidia Docker images in Docker Desktop and WSL2.

NotTheDr01ds
  • 17,574
  • 4
  • 44
  • 81