为什么 WSL OpenGL 版本根据发行版而不同?

为什么 WSL OpenGL 版本根据发行版而不同?

我在 WSL 发行版上遇到了一个问题。我有一个 Ubuntu 20.04,其中的 OpenGL 版本是 2.1,它不会使用 WSLg 的硬件渲染。我还安装了一个 Ubuntu 22.04 发行版,它可以与 GPU 加速的 WSLg 功能正常工作:

glxinfo -B在 Ubuntu 20.04 上的结果:

name of display: :0
display: :0  screen: 0
direct rendering: Yes
OpenGL vendor string: Brian Paul
OpenGL renderer string: Mesa X11
OpenGL version string: 4.5 Mesa 8.0.5
OpenGL shading language version string: 1.20
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile

glxinfo -B在 Ubuntu 22.04 上的结果:

name of display: :0
display: :0  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: Microsoft Corporation (0xffffffff)
    Device: D3D12 (NVIDIA Quadro T1000) (0xffffffff)
    Version: 22.0.1
    Accelerated: yes
    Video memory: 20212MB
    Unified memory: no
    Preferred profile: core (0x1)
    Max core profile version: 3.3
    Max compat profile version: 3.3
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.1
OpenGL vendor string: Microsoft Corporation
OpenGL renderer string: D3D12 (NVIDIA Quadro T1000)
OpenGL core profile version string: 3.3 (Core Profile) Mesa 22.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.3 (Compatibility Profile) Mesa 22.0.1
OpenGL shading language version string: 3.30
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile

OpenGL ES profile version string: OpenGL ES 3.1 Mesa 22.0.1
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10

有人可以帮助我或者告诉我如何做吗?

Windows 版本:

11 Pro
Version 21H2
Build 22000.739

编辑06/24:

dpkg -l "mesa*" "libgl*"在 Ubuntu 20.04 上的结果:

    Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                              Version                           Architecture Description
+++-=================================-=================================-============-===========================================================
ii  libgl1:amd64                      1.3.2-1~ubuntu0.20.04.2           amd64        Vendor neutral GL dispatch library -- legacy GL support
un  libgl1-amber-dri                  <none>                            <none>       (no description available)
ii  libgl1-mesa-dri:amd64             22.2~git2206220600.e8fc5c~oibaf~f amd64        free implementation of the OpenGL API -- DRI modules
un  libgladeui-2-6                    <none>                            <none>       (no description available)
ii  libglapi-mesa:amd64               22.2~git2206220600.e8fc5c~oibaf~f amd64        free implementation of the GL API -- shared library
un  libgldispatch0-nvidia             <none>                            <none>       (no description available)
ii  libgles2:amd64                    1.3.2-1~ubuntu0.20.04.2           amd64        Vendor neutral GL dispatch library -- GLESv2 support
un  libglib-object-introspection-perl <none>                            <none>       (no description available)
ii  libglib2.0-0:amd64                2.64.6-1~ubuntu20.04.4            amd64        GLib library of C routines
ii  libglib2.0-bin                    2.64.6-1~ubuntu20.04.4            amd64        Programs for the GLib library
ii  libglib2.0-data                   2.64.6-1~ubuntu20.04.4            all          Common files for GLib library
ii  libglvnd0:amd64                   1.3.2-1~ubuntu0.20.04.2           amd64        Vendor neutral GL dispatch library
ii  libglx-mesa0:amd64                22.2~git2206220600.e8fc5c~oibaf~f amd64        free implementation of the OpenGL API -- GLX vendor library
un  libglx-vendor                     <none>                            <none>       (no description available)
ii  libglx0:amd64                     1.3.2-1~ubuntu0.20.04.2           amd64        Vendor neutral GL dispatch library -- GLX support
ii  mesa-utils                        8.4.0-1build1                     amd64        Miscellaneous Mesa GL utilities
un  mesa-vulkan-drivers               <none>                            <none>       (no description available)

dpkg -l "mesa*" "libgl*"在 Ubuntu 22.04 上的结果:

Souhait=inconnU/Installé/suppRimé/Purgé/H=à garder
| État=Non/Installé/fichier-Config/dépaqUeté/échec-conFig/H=semi-installé/W=attend-traitement-déclenchements
|/ Err?=(aucune)/besoin Réinstallation (État,Err: majuscule=mauvais)
||/ Nom                               Version           Architecture Description
+++-=================================-=================-============-============================================================
ii  libgl-dev:amd64                   1.4.0-1           amd64        Vendor neutral GL dispatch library -- GL development files
ii  libgl1:amd64                      1.4.0-1           amd64        Vendor neutral GL dispatch library -- legacy GL support
ii  libgl1-amber-dri:amd64            21.3.7-0ubuntu1   amd64        free implementation of the OpenGL API -- DRI modules
ii  libgl1-mesa-dev:amd64             22.0.1-1ubuntu2.1 amd64        transitional dummy package
ii  libgl1-mesa-dri:amd64             22.0.1-1ubuntu2.1 amd64        free implementation of the OpenGL API -- DRI modules
un  libgladeui-2-6                    <aucune>          <aucune>     (aucune description n'est disponible)
ii  libglapi-mesa:amd64               22.0.1-1ubuntu2.1 amd64        free implementation of the GL API -- shared library
un  libgldispatch0-nvidia             <aucune>          <aucune>     (aucune description n'est disponible)
ii  libgles-dev:amd64                 1.4.0-1           amd64        Vendor neutral GL dispatch library -- GLES development files
ii  libgles1:amd64                    1.4.0-1           amd64        Vendor neutral GL dispatch library -- GLESv1 support
ii  libgles2:amd64                    1.4.0-1           amd64        Vendor neutral GL dispatch library -- GLESv2 support
un  libgles2-mesa-dev                 <aucune>          <aucune>     (aucune description n'est disponible)
ii  libglew-dev:amd64                 2.2.0-4           amd64        OpenGL Extension Wrangler - development environment
ii  libglew2.2:amd64                  2.2.0-4           amd64        OpenGL Extension Wrangler - runtime environment
un  libglib-object-introspection-perl <aucune>          <aucune>     (aucune description n'est disponible)
ii  libglib2.0-0:amd64                2.72.1-1          amd64        GLib library of C routines
ii  libglib2.0-bin                    2.72.1-1          amd64        Programs for the GLib library
ii  libglib2.0-data                   2.72.1-1          all          Common files for GLib library
un  libglu-dev                        <aucune>          <aucune>     (aucune description n'est disponible)
un  libglu1                           <aucune>          <aucune>     (aucune description n'est disponible)
ii  libglu1-mesa:amd64                9.0.2-1           amd64        Mesa OpenGL utility library (GLU)
ii  libglu1-mesa-dev:amd64            9.0.2-1           amd64        Mesa OpenGL utility library -- development files
ii  libglvnd-core-dev:amd64           1.4.0-1           amd64        Vendor neutral GL dispatch library -- core development files
ii  libglvnd-dev:amd64                1.4.0-1           amd64        Vendor neutral GL dispatch library -- development files
ii  libglvnd0:amd64                   1.4.0-1           amd64        Vendor neutral GL dispatch library
ii  libglx-dev:amd64                  1.4.0-1           amd64        Vendor neutral GL dispatch library -- GLX development files
ii  libglx-mesa0:amd64                22.0.1-1ubuntu2.1 amd64        free implementation of the OpenGL API -- GLX vendor library
un  libglx-vendor                     <aucune>          <aucune>     (aucune description n'est disponible)
ii  libglx0:amd64                     1.4.0-1           amd64        Vendor neutral GL dispatch library -- GLX support

相关内容