How to restrict GNOME Display Manager to use integrated GPU

Hi,
I’ve recently done a PC build and successfully installed Fedora as the Linux distribution. My build has an Intel i5 12600k (with integrated GPU) and Nvidia GEforce RTX 3060. Both of which have drivers installed.

The PC will be primarily used for machine learning and AI tasks so I want to use the integrated GPU for all graphics/display related stuff and reserve the dedicated GPU for use by the machine learning/AI programs.

At the moment, when I go to ‘Settings → About’ the graphics sections states ‘NVIDIA GeForce RTX™ 3060 / NVIDIA GeForce RTX™ 3060’ which seems a bit strange considering I only have one 3060 and the iGPU isn’t mentioned.

On doing a ‘nvidia-smi’, it states that there are two processes being run:
| 0 N/A N/A 2037 G /usr/bin/gnome-shell 146MiB |
| 0 N/A N/A 2382 G /usr/bin/gnome-software 7MiB |

Maybe the about section only shows the dedicated GPU cause that’s the GPU that is running GNOME, I believe.

How can I restrict gnome to the integrated GPU, and reserve the dedicated GPU for AI/Machine learning tasks.

Thanks, any help would be appreciated.

Have you by chance configured the dGPU as primary? If so then it disables (or rather idles) the iGPU.

Please post the output of inxi -Fzxx

Thanks for the reply.

As far as I’m aware I haven’t configured the dGPU as primary.

Here is the output I got from inxi -Fzxx:

System:
  Kernel: 6.1.9-200.fc37.x86_64 arch: x86_64 bits: 64 compiler: gcc
    v: 2.38-25.fc37 Desktop: GNOME v: 43.2 tk: GTK v: 3.24.36 wm: gnome-shell
    dm: GDM Distro: Fedora release 37 (Thirty Seven)
Machine:
  Type: Desktop Mobo: Micro-Star model: MAG Z790 TOMAHAWK WIFI (MS-7D91)
    v: 4.0 serial: <superuser required> UEFI: American Megatrends LLC. v: H.00
    date: 09/21/2022
CPU:
  Info: 10-core (6-mt/4-st) model: 12th Gen Intel Core i5-12600K bits: 64
    type: MST AMCP arch: Alder Lake rev: 2 cache: L1: 864 KiB L2: 9.5 MiB
    L3: 20 MiB
  Speed (MHz): avg: 3337 high: 3700 min/max: 800/4900:3600 cores: 1: 800
    2: 3700 3: 3700 4: 3700 5: 800 6: 3700 7: 3700 8: 3700 9: 3700 10: 3700
    11: 3700 12: 3700 13: 3700 14: 3700 15: 3700 16: 3700 bogomips: 117964
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Graphics:
  Device-1: Intel AlderLake-S GT1 vendor: Micro-Star MSI driver: i915
    v: kernel ports: active: none empty: DP-1, DP-2, HDMI-A-1, HDMI-A-2,
    HDMI-A-3, HDMI-A-4 bus-ID: 00:02.0 chip-ID: 8086:4680
  Device-2: NVIDIA GA106 [GeForce RTX 3060 Lite Hash Rate]
    vendor: Micro-Star MSI driver: nvidia v: 525.85.05 arch: Ampere pcie:
    speed: 2.5 GT/s lanes: 16 ports: active: none off: HDMI-A-5
    empty: DP-3,DP-4,DP-5 bus-ID: 01:00.0 chip-ID: 10de:2504
  Display: wayland server: X.org v: 1.20.14 with: Xwayland v: 22.1.7
    compositor: gnome-shell driver: gpu: nvidia,nvidia-nvswitch display-ID: 0
  Monitor-1: HDMI-A-5 model: Idek Iiyama PL2409HD res: 1920x1080 dpi: 94
    diag: 598mm (23.5")
  API: OpenGL v: 4.6.0 NVIDIA 525.85.05 renderer: NVIDIA GeForce RTX
    3060/PCIe/SSE2 direct render: Yes
Audio:
  Device-1: Intel vendor: Micro-Star MSI driver: snd_hda_intel bus-ID: 1-11:7
    v: kernel chip-ID: 0db0:a74b bus-ID: 00:1f.3 chip-ID: 8086:7a50
  Device-2: NVIDIA GA106 High Definition Audio vendor: Micro-Star MSI
    driver: snd_hda_intel v: kernel pcie: speed: 16 GT/s lanes: 16
    bus-ID: 01:00.1 chip-ID: 10de:228e
  Device-3: Micro Star USB Audio type: USB
    driver: hid-generic,snd-usb-audio,usbhid
  Sound API: ALSA v: k6.1.9-200.fc37.x86_64 running: yes
  Sound Server-1: PulseAudio v: 16.1 running: no
  Sound Server-2: PipeWire v: 0.3.65 running: yes
Network:
  Device-1: Intel driver: iwlwifi v: kernel port: N/A bus-ID: 00:14.3
    chip-ID: 8086:7a70
  IF: wlo1 state: up mac: <filter>
  Device-2: Intel Ethernet I226-V vendor: Micro-Star MSI driver: igc
    v: kernel pcie: speed: 5 GT/s lanes: 1 port: N/A bus-ID: 03:00.0
    chip-ID: 8086:125c
  IF: enp3s0 state: down mac: <filter>
Bluetooth:
  Device-1: Intel type: USB driver: btusb v: 0.8 bus-ID: 1-14:10
    chip-ID: 8087:0033
  Report: rfkill ID: hci0 rfk-id: 0 state: up address: see --recommends
Drives:
  Local Storage: total: 946.26 GiB used: 6.85 GiB (0.7%)
  ID-1: /dev/nvme0n1 vendor: Sabrent model: Rocket 4.0 1TB size: 931.51 GiB
    speed: 63.2 Gb/s lanes: 4 serial: <filter> temp: 23.9 C
  ID-2: /dev/sda type: USB vendor: Generic model: Flash Disk size: 14.75 GiB
    serial: <filter>
Partition:
  ID-1: / size: 929.93 GiB used: 4.73 GiB (0.5%) fs: btrfs dev: /dev/nvme0n1p3
  ID-2: /boot size: 973.4 MiB used: 224.4 MiB (23.1%) fs: ext4
    dev: /dev/nvme0n1p2
  ID-3: /boot/efi size: 598.8 MiB used: 17.4 MiB (2.9%) fs: vfat
    dev: /dev/nvme0n1p1
  ID-4: /home size: 929.93 GiB used: 4.73 GiB (0.5%) fs: btrfs
    dev: /dev/nvme0n1p3
Swap:
  ID-1: swap-1 type: zram size: 8 GiB used: 0 KiB (0.0%) priority: 100
    dev: /dev/zram0
Sensors:
  System Temperatures: cpu: 18.0 C mobo: N/A
  Fan Speeds (RPM): N/A
Info:
  Processes: 667 Uptime: 2m Memory: 31.13 GiB used: 1.85 GiB (6.0%)
  Init: systemd v: 251 target: graphical (5) default: graphical Compilers:
  gcc: 12.2.1 Packages: pm: rpm pkgs: N/A note: see --rpm Shell: Bash
  v: 5.2.15 running-in: gnome-terminal inxi: 3.3.24

can you post it in a code format </>

Apologies, I edited there.

I looked at that and see it is a desktop with both integrated graphics and an nvidia GPU.
Since the iGPU seems inactive I have to wonder if it

  1. May be manually disabled in bios
  2. May be automatically disabled when the nvidia card is active.

What happens if you disconnect the monitor from the nvidia GPU and connect only to the gpu on the motherboard. Does it work then?

What happens if you boot with the iGPU active then connect a monitor to the nvidia card?

I seem to remember that some motherboards that have built in graphics will disable that when another gpu is plugged in.

1 Like

In response to 1. No, I don’t believe it is manually disabled in BIOS cause I’ve been trying different settings to make sure it wasn’t.

As for 2. Initially, when I first installed Fedora, it was the Integrated GPU showing up in settings → about. It was only after installing the nvidia driver that the integrated gpu seemed to be disabled. So yeah, you could be right.

It has been only connected to the motherboard, not directly to the GPU. Since I’ll only be using the dedicated GPU for Machine learning/AI work.

As for the last question, I’ll get back to you. I’m after locking myself out, messing around with settings, so am going to have to do a fresh install, haha

I’ve managed to get both my integrated and dedicated GPU showing in ‘settings → about’. I connected the monitor directly into motherboard and changed the BIOS to use integrated GPU by default with multiple monitors disabled.

Thanks everyone for your help.

I’m still getting the following though when I do a ‘nvidia-smi’.

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 525.85.05    Driver Version: 525.85.05    CUDA Version: 12.0     |
|-------------------------------+----------------------+----------------------+
| 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 |
|  0%   32C    P8    12W / 170W |      3MiB / 12288MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      2061      G   /usr/bin/gnome-shell                2MiB |
+-----------------------------------------------------------------------------+

Ideally, I’d like to limit the dedicated GPU to machine learning tasks, but in the above you’ll see it’s involved in a gnome-shell process.

Any suggestions would be appreciated.

I don’t think your pc motherboard support optimus prime offloading. The only way I suppose is to use a switcher to disable your nvidia gpu when you want everything confined on your iGPU.

But is there a reason for doing so? You won’t benefit much from doing such settings.