dGPU not being used on Wayland

I have an optimus laptop with i5-7300HQ and 1050Ti

I am using Fedora Silverblue 34 and I have followed the documentation on installing the nvidia drivers.

  • I have also commented out "WaylandEnable=false" in /etc/gdm/custom.conf.
  • I have added a custom rule from /usr/lib/udev/rules.d/61-gdm.rules to/etc/udev/rules.d/61-gdm.rules so that Wayland doesn’t get disabled when the nvidia drivers are running (since EGL drivers are now available).
  • Moreover I have added the required configuration from /usr/share/X11/xorg.conf.d/nvidia.conf to /etc/X11/xorg.conf.d/nvidia.conf so that nvidia is the primary gpu.

The problem is that the nvidia gpu appears to not be used when I enter the normal (Wayland session).

For example:

$ nvidia-smi 
Fri Oct  8 21:19:42 2021       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 470.74       Driver Version: 470.74       CUDA Version: 11.4     |
|-------------------------------+----------------------+----------------------+
| 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 ...  Off  | 00000000:01:00.0 Off |                  N/A |
| N/A   43C    P8    N/A /  N/A |      2MiB /  4040MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+
$ glxinfo | egrep "OpenGL vendor|OpenGL renderer"
OpenGL vendor string: Intel
OpenGL renderer string: Mesa Intel(R) HD Graphics 630 (KBL GT2)

Even if I click, Launch using Discreet Graphics Card there are still 0 processes using the GPU at nvidia-smi.

However the nvidia drivers appear to be loaded:

$ lsmod | grep nvidia
nvidia_drm             69632  1
nvidia_modeset       1200128  1 nvidia_drm
nvidia_uvm           1175552  0
nvidia              35332096  32 nvidia_uvm,nvidia_modeset
drm_kms_helper        303104  2 nvidia_drm,i915
drm                   630784  12 drm_kms_helper,nvidia,nvidia_drm,i915,ttm

Any ideas what might be happening?

If I enter with an X11 session then the gpu appears to be used normally:

$ nvidia-smi 
Thu Oct 14 21:12:36 2021       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 470.74       Driver Version: 470.74       CUDA Version: 11.4     |
|-------------------------------+----------------------+----------------------+
| 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 ...  Off  | 00000000:01:00.0 Off |                  N/A |
| N/A   47C    P0    N/A /  N/A |    460MiB /  4040MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      5908      G   /usr/libexec/Xorg                 212MiB |
|    0   N/A  N/A      6033      G   /usr/bin/gnome-shell              113MiB |
|    0   N/A  N/A      8272      G   nextcloud                           1MiB |
|    0   N/A  N/A      8678      G   /app/lib/firefox/firefox          129MiB |
+-----------------------------------------------------------------------------+
$ 

!?