I noticed that factorio didn't seem to be using my dedicated graphics. The nvidia-smi utility didn't show the factorio process and the game was running slower than expected. My PRIME profile is set to "Nvidia (Performance Mode)" so I think this should pick up the dedicated GPU automatically.
Code: Select all
$ nvidia-smi
Tue Oct 22 18:47:42 2024
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 550.107.02 Driver Version: 550.107.02 CUDA Version: 12.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 RTX 2060 ... Off | 00000000:01:00.0 Off | N/A |
| N/A 60C P8 3W / 65W | 7MiB / 6144MiB | 0% Default |
| | | N/A |
+-----------------------------------------+------------------------+----------------------+
+-----------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=========================================================================================|
| 0 N/A N/A 4632 G /usr/bin/gnome-shell 1MiB |
+-----------------------------------------------------------------------------------------+
Code: Select all
$ cd /opt/games/factorio/bin
__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia ./factorio
Code: Select all
$ nvidia-smi
Tue Oct 22 19:04:17 2024
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 550.107.02 Driver Version: 550.107.02 CUDA Version: 12.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 RTX 2060 ... Off | 00000000:01:00.0 Off | N/A |
| N/A 58C P0 23W / 65W | 3632MiB / 6144MiB | 32% Default |
| | | N/A |
+-----------------------------------------+------------------------+----------------------+
+-----------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=========================================================================================|
| 0 N/A N/A 4632 G /usr/bin/gnome-shell 1MiB |
| 0 N/A N/A 14235 G ./factorio 3624MiB |
+-----------------------------------------------------------------------------------------+