
Ich habe versucht, meine Nvidia-Treiberversion in Ubuntu 22.04 zu überprüfen, das auf dem WSL2-Subsystem unter Windows 11 installiert ist, habe jedoch die Fehlermeldung „NVML konnte nicht initialisiert werden: GPU-Zugriff vom Betriebssystem blockiert“ erhalten. Mein Ziel ist es, meine RTX 2080 ti (oder die GTX 1060) an ein Gastbetriebssystem wie FreeBSD weiterleiten zu können. Ist das möglich? Ich hoffe, Sie bei diesem Problem zu unterstützen.
Auf dem Windows 11-Hostbetriebssystem funktioniert es:
# nvidia-smi
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 536.40 Driver Version: 536.40 CUDA Version: 12.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 NVIDIA GeForce GTX 1060 3GB WDDM | 00000000:01:00.0 On | N/A |
| 57% 41C P2 25W / 120W | 710MiB / 3072MiB | 0% Default |
| | | N/A |
+-----------------------------------------+----------------------+----------------------+
| 1 NVIDIA GeForce RTX 2080 Ti WDDM | 00000000:02:00.0 Off | N/A |
| 31% 40C P8 21W / 250W | 74MiB / 11264MiB | 0% |
+_________________________________________+______________________+______________________|
auf dem Gastbetriebssystem Ubuntu 22.04 ist dies nicht der Fall:
# nvidia-smi
Failed to initialize NVML: GPU access blocked by the operating system
Failed to properly shut down NVML: GPU access blocked by the operating system
ABER :
# nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2023 NVIDIA Corporation
Built on Tue_Jun_13_19:16:58_PDT_2023
Cuda compilation tools, release 12.2, V12.2.91
Build cuda_12.2.r12.2/compiler.32965470_0
# python3 --version
Python 3.10.7
In Ubuntu 22.04 habe ich cuda-12.2 mit den folgenden Anweisungen installiert:
# wget https://developer.download.nvidia.com/compute/cuda/repos/wsl-ubuntu/x86_64/cuda-wsl-ubuntu.pin
# sudo mv cuda-wsl-ubuntu.pin /etc/apt/preferences.d/cuda-repository-pin-600
# wget https://developer.download.nvidia.com/compute/cuda/12.2.0/local_installers/cuda-repo-wsl-ubuntu-12-2-local_12.2.0-1_amd64.deb
# sudo dpkg -i cuda-repo-wsl-ubuntu-12-2-local_12.2.0-1_amd64.deb
# sudo cp /var/cuda-repo-wsl-ubuntu-12-2-local/cuda-*-keyring.gpg /usr/share/keyrings/
# sudo apt-get update
# sudo apt-get -y install nvidia-cuda-toolkit
Anweisungen von hier übernommen:
Mein PC hat 2 Grafikkarten:
NVIDIA GeForce GTX 1060 3GB
NVIDIA GeForce RTX 2080 Ti
Unten sehen Sie die unter Windows 11 installierte NVIDIA-Treiberversion für beide GPUs:
Ich habe außerdem die folgende Zeile hinzugefügt /home/marietto/.bashrc and to /root/.bashrc
:
export PATH=/usr/local/cuda-12.2/bin${PATH:+:${PATH}}
und ich tat :
# source /home/marietto/.bashrc
# source /root/.bashrc
Nach dem Neustart weiß ich nicht, was ich sonst noch tun soll.
Einige Hintergründe:
Windows-Version = Windows 11 PRO Version 10.0.22000.2176
WSL-Version = 1.3.11.0
Ich verwende WSL 2
Kernel-Version = 6.1.38-Microsoft-Standard
Distro-Version = Ubuntu 22.10
Kernelversion: 5.15.90.2-3
Version WSLg: 1.0.54
Version MSRDC: 1.2.4240
Version Direct3D: 1.608.2-61064218
Version DXCore: 10.0.25880.1000-230602-1350.main