![无法在 WSL(Windows 11)中使用 OpenGL 3.3+](https://linux22.com/image/1185764/%E6%97%A0%E6%B3%95%E5%9C%A8%20WSL%EF%BC%88Windows%2011%EF%BC%89%E4%B8%AD%E4%BD%BF%E7%94%A8%20OpenGL%203.3%2B.png)
我的 GPU 和 CPU 都支持最高 OpenGL 4.6,并且我的驱动程序是最新的。但是,我的 WSL 上的 Ubuntu 20.04 仅支持 3.3。以下是 glxinfo 的内容:
glxinfo | grep "OpenGL"
OpenGL vendor string: Microsoft Corporation
OpenGL renderer string: D3D12 (NVIDIA GeForce RTX 3080 Laptop GPU)
OpenGL core profile version string: 3.3 (Core Profile) Mesa 21.2.6
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.1 Mesa 21.2.6
OpenGL shading language version string: 1.40
OpenGL context flags: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.0 Mesa 21.2.6
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00
OpenGL ES profile extensions:
编辑:我的内核版本是:5.10.60.1
答案1
正如评论中所述,当使用软件渲染(LLVM)时,我的结果显示配置文件为 4.5。
在更新我的 nVidia 驱动程序之后(显然我已经有一段时间没有这样做了),我现在看到了与您相同的内容:
OpenGL renderer string: D3D12 (NVIDIA GeForce RTX 2070 SUPER)
OpenGL core profile version string: 3.3 (Core Profile) Mesa 21.2.6
然而,根据Mesa D3D12 页面,该驱动程序仅支持 3.3,所以我相信这是可以预料到的。
完整结果:
~> glxinfo | grep "OpenGL"
OpenGL vendor string: Microsoft Corporation
OpenGL renderer string: D3D12 (NVIDIA GeForce RTX 2070 SUPER)
OpenGL core profile version string: 3.3 (Core Profile) Mesa 21.2.6
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.1 Mesa 21.2.6
OpenGL shading language version string: 1.40
OpenGL context flags: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.0 Mesa 21.2.6
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00
OpenGL ES profile extensions:
~> LIBGL_ALWAYS_SOFTWARE=1 glxinfo | grep "OpenGL"
OpenGL vendor string: Mesa/X.org
OpenGL renderer string: llvmpipe (LLVM 12.0.0, 256 bits)
OpenGL core profile version string: 4.5 (Core Profile) Mesa 21.2.6
OpenGL core profile shading language version string: 4.50
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.1 Mesa 21.2.6
OpenGL shading language version string: 1.40
OpenGL context flags: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 21.2.6
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions: