Check GPU Info

  • Press Windows + X and select Device Manager from the menu
    • Expand the Display adapters section

[7/30/24]

CUDA

Pytorch and CUDA

torch.cuda

Getting PyTorch to run on the GPU

Install vGPU drivers

  • Install driver for virtual GPU (vGPU) so you can benefit from hardware accelerated OpenGL rendering
    • AMD GPU driver

[12/30/24]

Intel

Intel GPU driver

  • Check if your GPU supports native OpenGL rendering in WSL
    • If it lists Intel, NVIDIA, or AMD without D3D12, you have full OpenGL hardware acceleration.
 glxinfo | grep "OpenGL renderer"
OpenGL renderer string: D3D12 (Intel(R) UHD Graphics)
  • The output indicates partial hardware acceleration through DirectX 12 (D3D12). However, this is not full native OpenGL hardware acceleration. Instead, it uses a compatibility layer provided by WSLg to translate OpenGL calls to DirectX 12

[1/3/25]

NVIDIA

NVIDIA GPU driver

  • Check NVIDIA driver version
 nvidia-smi
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 555.42.03              Driver Version: 555.85         CUDA Version: 12.5     |
|-----------------------------------------+------------------------+----------------------+
| 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 RTX 3070 ...    On  |   00000000:01:00.0  On |                  N/A |
| N/A   59C    P8             15W /   80W |     626MiB /   8192MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+

+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI        PID   Type   Process name                              GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|  No running processes found                                                             |
+-----------------------------------------------------------------------------------------+
 nvidia-smi
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 565.77.01              Driver Version: 566.36         CUDA Version: 12.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 RTX 3070 ...    On  |   00000000:01:00.0  On |                  N/A |
| N/A   60C    P8             15W /   80W |     112MiB /   8192MiB |     18%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+

+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI        PID   Type   Process name                              GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|  No running processes found                                                             |
+-----------------------------------------------------------------------------------------+
echo 'export MESA_D3D12_DEFAULT_ADAPTER_NAME=NVIDIA' >> ~/.bashrc
  • Check OpenGL hardware acceleration
glxinfo | grep "OpenGL renderer"
OpenGL renderer string: D3D12 (NVIDIA GeForce RTX 3070 Laptop GPU)

OpenGL

  • Mesa ensures that OpenGL works and hardware acceleration is functional.
  • Mesa-utils provides tools to test OpenGL functionality and get details about the GPU/graphics stack (e.g., checking if OpenGL is functioning correctly using glxinfo).
    • glxgears – A simple OpenGL benchmark and test tool (used to visualize basic OpenGL rendering performance)
  • Test if OpenGL is working and check performance of the GPU
glxgears

picture 1