[WSL2 + Ubuntu 24.04 LTS] NVIDIA GPU detected but WSLg not working (OpenGL = llvmpipe)

Tags: #WSL2 #Ubuntu2404 #WSLg #NVIDIA #OpenGL #CUDA


🧩 Context

I’m using Windows 11 with WSL2 and Ubuntu 24.04 LTS, trying to run Gazebo / RViz / OpenGL apps with NVIDIA GPU acceleration through WSLg.
CUDA works, but OpenGL still falls back to software rendering (llvmpipe).


⚙️ Environment

Component Version / Info
Windows 11 Pro – build 26100.6725
WSL 2.6.1.0
Kernel 6.6.87.2-microsoft-standard-WSL2
WSLg 1.0.66
Ubuntu 24.04.3 LTS
GPU NVIDIA GeForce RTX 2050
Driver (Windows) 581.42
CUDA 13.0

🧪 What I have tested

  1. GPU detected

    nvidia-smi
    
    

    → Works fine, GPU and driver visible.

  2. No WSLg detected

    echo $WSLG
    
    

    → Empty output.

  3. OpenGL renderer = software

    glxinfo | grep "OpenGL renderer"
    
    

    → Output: llvmpipe (LLVM 20.1.2, 256 bits) (CPU rendering only).

  4. Fix attempts

    • Removed manual DISPLAY and LIBGL_ALWAYS_INDIRECT from .bashrc

    • Ran:

      wsl --update
      wsl --shutdown
      
      
    • Tried reinstalling WSLg manually:

      Add-AppxPackage -Register "C:\Program Files\WindowsApps\MicrosoftCorporationII.WindowsSubsystemForLinux_1.0.66.0_x64__8wekyb3d8bbwe\AppxManifest.xml"
      
      

      → Path not found (new WSL integrates WSLg).

  5. Alternative (VcXsrv)

    • xeyes works, but still software rendering.

    • OpenGL fallback remains llvmpipe.

  6. ⚙️ NVIDIA bug report

    sudo nvidia-bug-report.sh
    
    

    → Report generated, but /proc/driver/nvidia/version missing (expected in WSL2).


🚫 Current status

  • nvidia-smi ✅ Works

  • CUDA ✅ Works

  • OpenGL ❌ Software rendering (no GPU acceleration)

  • WSLg ❌ Seems inactive on Ubuntu 24.04


❓ Question

Is there a known incompatibility between WSLg and Ubuntu 24.04 LTS?
If so, should I switch back to Ubuntu 22.04 LTS to get NVIDIA OpenGL hardware acceleration?
Or is there a way to force-enable WSLg on Ubuntu 24.04 under Windows 11?


📎 Logs available

here is my nvidia-bug-report

nvidia-bug-report.log.gz (191.9 KB)

The same problem! Did anyone solve that?

In WSL the HW graphics driver is not “native”, but using a DirectX 12 translation layer.

Similar to XBOX: OpenGL® on DX12 enables STEEL ASSAULT to launch on Xbox - DirectX Developer Blog

Get latest driver from https://launchpad.net/\~kisak/+archive/ubuntu/kisak-mesa

export MESA_D3D12_DEFAULT_ADAPTER_NAME=NVIDIA
export GALLIUM_DRIVER=d3d12
export LIBGL_ALWAYS_SOFTWARE=false

3 Likes

Thanks Man, till now I didn’t know my WSL has direct GPU access, when Tried to launch electron based app it took eternity to open, now that GPU is exposed it is opening in a flash.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.