Graphics applications stop working in WSL2 / Ubuntu 20.04 on Windows 11 after NVIDIA CUDA driver installation

The title says it all. Graphics apps were working without an issue with the exception of one that was throwing an error for XCB Qt plugin (found but not initialized). I presumed installing the latest CUDA driver would help fix the issue. Instead, it broke everything. Do you have any stable CUDA drivers that are compatible with WSL2? Apparently, the latest version has issues. Here is the nvidia-smi output:

| NVIDIA-SMI 515.48.07 Driver Version: 516.40 CUDA Version: 11.7 |
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
| 0 NVIDIA GeForce … On | 00000000:01:00.0 On | N/A |
| N/A 49C P8 5W / N/A | 670MiB / 8192MiB | 2% Default |
| | | N/A |

| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
| 0 N/A N/A 457 G /Xwayland N/A |

Please advise on how to proceed.


The WSL CUDA Driver and the WSL DirectX12 NVIDIA Driver (Which is needed for graphics on WSL) are not distributed as a standalone, they are component part of the Windows Display Driver. To be able to help you better here we would need the link to the driver you installed (or command you ran to install it).

One possibility is that a Native Linux Driver package was accidentally installed instead of relying on the one provided by the Windows Display Driver, in which case removing it first and upgrading to the latest Windows display driver should fix the issue.