Set NVIDIA card as primary device for all applications in wayland

Hi, thanks to @pebcak I managed to enable wayland and NVIDIA together in Gnome. My problem is now that only gnome-shell is run on NVIDIA card and not all other applications. For example if I start google-chrome-stable, nvidia-smi output looks like this:

[rstasta@endeavouros ~]$ nvidia-smi 
Thu Jun 15 11:17:12 2023       
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 530.41.03              Driver Version: 530.41.03    CUDA Version: 12.1     |
|-----------------------------------------+----------------------+----------------------+
| 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 L...    Off| 00000000:01:00.0  On |                  N/A |
| N/A   43C    P8               19W /  N/A|     53MiB /  8192MiB |      0%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+
                                                                                         
+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|=======================================================================================|
|    0   N/A  N/A      1265      G   /usr/bin/gnome-shell                          2MiB |
+---------------------------------------------------------------------------------------+

I need to prime-run chrome to appear there:

[rstasta@endeavouros ~]$ nvidia-smi 
Thu Jun 15 11:18:03 2023       
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 530.41.03              Driver Version: 530.41.03    CUDA Version: 12.1     |
|-----------------------------------------+----------------------+----------------------+
| 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 L...    Off| 00000000:01:00.0  On |                  N/A |
| N/A   44C    P8               19W /  N/A|     98MiB /  8192MiB |      0%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+
                                                                                         
+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|=======================================================================================|
|    0   N/A  N/A      1265      G   /usr/bin/gnome-shell                          2MiB |
|    0   N/A  N/A      3782      G   ...8807981,15028081713584423743,262144       44MiB |
+---------------------------------------------------------------------------------------+

Is there a way to enforce any new window/software/whatever to run on nvidia card?

1 Like

you mean this is an optimus enabled notebook with hybrid GPU? or a dedicated nvidia card in a desktop?

Yes, notebook with hybrid GPU:

[root@endeavouros ~]# lspci | grep -i --color 'vga\|3d\|2d'
0000:00:02.0 VGA compatible controller: Intel Corporation TigerLake-H GT1 [UHD Graphics] (rev 01)
0000:01:00.0 VGA compatible controller: NVIDIA Corporation GA104M [GeForce RTX 3070 Mobile / Max-Q] (rev a1)

still puzzles me how it is setup?
https://wiki.archlinux.org/title/NVIDIA_Optimus#Use_NVIDIA_graphics_only