Nvidia 在 WSL2 上仍然無法運作

Nvidia 在 WSL2 上仍然無法運作

我正在嘗試讓 WSL2 識別我的 GPU。我已經關注了這個指導,看了這個回复郵政,瀏覽了多個其他教程,但我仍然無法連接我的 GPU。當我運行以下命令時,我得到:

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.

即使我安裝了教程中給出的所有驅動程式。我還在 Dev 上安裝了 Windows Insider,安裝了所有更新。此外,我對 WSL 工作還很陌生,這讓事情變得更加複雜。任何幫助將不勝感激。

我的glxinfo -B輸出:

name of display: :0
NVD3D10: CPU cyclestats are disabled on client virtualization
NVD3D10: CPU cyclestats are disabled on client virtualization
display: :0  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: Microsoft Corporation (0xffffffff)
    Device: D3D12 (NVIDIA GeForce GTX 1660 SUPER) (0xffffffff)
    Version: 21.2.0
    Accelerated: yes
    Video memory: 22349MB
    Unified memory: no
    Preferred profile: core (0x1)
    Max core profile version: 3.3
    Max compat profile version: 3.1
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.0
OpenGL vendor string: Microsoft Corporation
OpenGL renderer string: D3D12 (NVIDIA GeForce GTX 1660 SUPER)
OpenGL core profile version string: 3.3 (Core Profile) Mesa 21.2.0-devel (git-17d7b0b 2021-05-30 focal-oibaf-ppa)
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 3.1 Mesa 21.2.0-devel (git-17d7b0b 2021-05-30 focal-oibaf-ppa)
OpenGL shading language version string: 1.40
OpenGL context flags: (none)

OpenGL ES profile version string: OpenGL ES 3.0 Mesa 21.2.0-devel (git-17d7b0b 2021-05-30 focal-oibaf-ppa)
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00

答案1

您將需要等待新驅動程式更新對於一個工作的 Nvidia-smi。

除了這個問題之外,您的 GPU 應該已經可以在 WSL2 中運作了。確保您的 GPU 至少來自 Kepler 系列,並且您已安裝最新的 WDDM3.0 驅動程式。

開啟 WSL2 並尋找裝置/dev/dxg。如果存在,則您的 GPU 在 WSL2 中可用。如果您使用的是 Ubuntu,建議更新您的 mesa 庫:

sudo add-apt-repository ppa:kisak/kisak-mesa
sudo apt-get update

之後,glxinfo -B應該簡單地顯示您的 GPU 名稱,如下所示:

$ glxinfo -B
name of display: :0
NVD3D10: CPU cyclestats are disabled on client virtualization
NVD3D10: CPU cyclestats are disabled on client virtualization
display: :0  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: Microsoft Corporation (0xffffffff)
    Device: D3D12 (NVIDIA GeForce GT 710) (0xffffffff)
    Version: 21.0.1
    Accelerated: yes
    Video memory: 9136MB
    Unified memory: no
    Preferred profile: core (0x1)
    Max core profile version: 3.3
    Max compat profile version: 3.1
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.0
OpenGL vendor string: Microsoft Corporation
OpenGL renderer string: D3D12 (NVIDIA GeForce GT 710)
OpenGL core profile version string: 3.3 (Core Profile) Mesa 21.0.1
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 3.1 Mesa 21.0.1
OpenGL shading language version string: 1.40
OpenGL context flags: (none)

OpenGL ES profile version string: OpenGL ES 3.0 Mesa 21.0.1
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00

相關內容