You are not logged in.

#1 2025-07-01 19:38:01

AlMahllawi
Member
From: Egypt
Registered: 2025-07-01
Posts: 4

[PEBKAC] Integrated GPU still used when booting using NVIDIA optimus

System Info:

  • Laptop: HP 15-dw3xxx

  • Kernel: linux 6.15.4.arch2-1

  • Platform: Wayland

GPUs:

  • Integrated: Intel® Iris® Xe Graphics

  • Discrete: NVIDIA GeForce MX350

Setup:

Note: I previously stated this issue in this post as a minor problem but I decided to post it here separately.
I did properly install the above setup (by reading NVIDIA Optimus article in the wiki and optimus-manager(-grub) guides) and it works fine. Though, the integrated GPU is still used even when I boot in "NVIDIA mode" (I'm gonna use this term, may be it's wrong idk). Although the discrete GPU is the one used primarily in NVIDIA mode, sometimes the system decides to switch to the integrated GPU for some reason. I'm not sure why, just before that happens the readings are:

  • ~60C°

  • ~95% VRAM used

  • ~100% discrete GPU utilization

  • decent CPU utilization

and then for ~2 minutes readings change to become:

  • ~50C°

  • ~90% VRAM used

  • ~15% discrete GPU utilization

  • ~100% CPU utilization

Which makes me assume that it switched to the integrated GPU. After that the system switch back to the discrete GPU. May be I'm dump and forgot to do something in order to fully disable the integrated GPU in NVIDIA mode, or may be fully disabling the integrated GPU is just not possible? If there are some tools to properly measure such case it would be nice of you to share them. I used nvidia-smi command from nvidia-utils and htop to provide the mentioned readings.

/etc/default/grub

...
GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 quiet nvidia-drm.modeset=1 nvidia-drm.fbdev=1"
...
$ cat /sys/module/nvidia_drm/parameters/modeset
Y

I do sometimes edit /boot/grub/grub.cfg manually but writing it all from scratch is a pain I'm not used to yet. Anyways I tried to

$ grub-mkconfig -o /boot/grub/grub.cfg

and use it without touching it and the same issue arises.

/etc/mkinitcpio.conf

MODULES=(nvidia nvidia_modeset nvidia_uvm nvidia_drm)
...

/boot/grub/grub.cfg (Note that Hybrid menu entry is irrelevant, it just exists. I never tried to use it)

...
### BEGIN /etc/grub.d/09_optimus ###
menuentry 'Arch Linux (Integrated) (linux)' --class optimus-integrated --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-9acf2551-b846-4e48-b9b9-aea05d0e1d5b' {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_gpt
	insmod ext2
	set root='hd1,gpt3'
	if [ x$feature_platform_search_hint = xy ]; then
	 search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt3 --hint-efi=hd1,gpt3 --hint-baremetal=ahci1,gpt3  9acf2551-b846-4e48-b9b9-aea05d0e1d5b
	else
	 search --no-floppy --fs-uuid --set=root 9acf2551-b846-4e48-b9b9-aea05d0e1d5b
	fi
	echo	'Loading Linux linux ...'
	linux	/boot/vmlinuz-linux root=UUID=9acf2551-b846-4e48-b9b9-aea05d0e1d5b rw  loglevel=3 quiet nvidia-drm.modeset=1 nvidia-drm.fbdev=1 optimus-manager.startup=integrated
	echo	'Loading initial ramdisk ...'
	initrd	/boot/intel-ucode.img /boot/initramfs-linux.img
}
menuentry 'Arch Linux (Hybrid) (linux)' --class optimus-hybrid --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-9acf2551-b846-4e48-b9b9-aea05d0e1d5b' {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_gpt
	insmod ext2
	set root='hd1,gpt3'
	if [ x$feature_platform_search_hint = xy ]; then
	 search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt3 --hint-efi=hd1,gpt3 --hint-baremetal=ahci1,gpt3  9acf2551-b846-4e48-b9b9-aea05d0e1d5b
	else
	 search --no-floppy --fs-uuid --set=root 9acf2551-b846-4e48-b9b9-aea05d0e1d5b
	fi
	echo	'Loading Linux linux ...'
	linux	/boot/vmlinuz-linux root=UUID=9acf2551-b846-4e48-b9b9-aea05d0e1d5b rw  loglevel=3 quiet nvidia-drm.modeset=1 nvidia-drm.fbdev=1 optimus-manager.startup=hybrid
	echo	'Loading initial ramdisk ...'
	initrd	/boot/intel-ucode.img /boot/initramfs-linux.img
}
menuentry 'Arch Linux (NVIDIA) (linux)' --class optimus-nvidia --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-9acf2551-b846-4e48-b9b9-aea05d0e1d5b' {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_gpt
	insmod ext2
	set root='hd1,gpt3'
	if [ x$feature_platform_search_hint = xy ]; then
	 search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt3 --hint-efi=hd1,gpt3 --hint-baremetal=ahci1,gpt3  9acf2551-b846-4e48-b9b9-aea05d0e1d5b
	else
	 search --no-floppy --fs-uuid --set=root 9acf2551-b846-4e48-b9b9-aea05d0e1d5b
	fi
	echo	'Loading Linux linux ...'
	linux	/boot/vmlinuz-linux root=UUID=9acf2551-b846-4e48-b9b9-aea05d0e1d5b rw  loglevel=3 quiet nvidia-drm.modeset=1 nvidia-drm.fbdev=1 optimus-manager.startup=nvidia
	echo	'Loading initial ramdisk ...'
	initrd	/boot/intel-ucode.img /boot/initramfs-linux.img
}
### END /etc/grub.d/09_optimus ###
...

/etc/sddm.conf.d/20-optimus-manager.conf

[X11]
DisplayCommand=/sbin/prime-offload
DisplayStopCommand=/sbin/prime-switch

Last edited by AlMahllawi (2025-07-02 07:53:24)

Offline

#2 2025-07-01 20:24:30

seth
Member
Registered: 2012-09-03
Posts: 65,807

Re: [PEBKAC] Integrated GPU still used when booting using NVIDIA optimus

I did properly install the above setup and it works fine.

Great. Please mark the thread as solved, then.

https://bbs.archlinux.org/viewtopic.php?id=57855
Obviously *not* everything works fine or you wouldn't be posting here.


Platform: Wayland

https://github.com/Askannz/optimus-manager/issues/452

From SDDM I'll guess you're using KDE/plasma?
https://wiki.archlinux.org/title/KDE#Me … -specific)

Online

#3 2025-07-01 21:25:13

AlMahllawi
Member
From: Egypt
Registered: 2025-07-01
Posts: 4

Re: [PEBKAC] Integrated GPU still used when booting using NVIDIA optimus

seth wrote:

I did properly install the above setup and it works fine.

Great. Please mark the thread as solved, then.

https://bbs.archlinux.org/viewtopic.php?id=57855
Obviously *not* everything works fine or you wouldn't be posting here.

I should've wrote "except that" after that sentence, my bad. As for Posting complete logs/output/versions/error messages, its a system behavior, it didn't cross my mind where error messages were logged or if there were any at all. I did share the measurements which what I thought would help and stated which tools I used to get them. Then finally asked for proper tools/approach to deal with the case. Anyways I read the post (appreciate it) and I guess I should've also used journalctl when that happened and shared the output? Correct me if I'm wrong.

What I got out of that is that I should set the environment variables:

export __GLX_VENDOR_LIBRARY_NAME=nvidia
export __VK_LAYER_NV_optimus=NVIDIA_only
es20490446e wrote:

The trick is that Wayland display managers run on EGL, while 3D games either on GLX or Vulkan.

I still don't fully understand that (but I know he's talking about 3D graphics APIs and which are used where) so...

es20490446e wrote:

So instead of offloading the complete desktop session, you just offload GLX and Vulkan apps.

I guess I should make Wayland use the integrated GPU and the apps use the discrete one. I don't have a clear idea of how should I implement this. Do I boot in the Hybrid mode and set the above environment variables when launching the apps?

seth wrote:

From SDDM I'll guess you're using KDE/plasma?
https://wiki.archlinux.org/title/KDE#Me … -specific)

Yes, lately I installed hyprland (still reading and learning) and currently I'm using sddm to switch sessions. Anyways I'm going to set the DRM device priority as the link says. Note that I didn't fully read the KDE page in the wiki yet, so I'm still reading that.

At this point I just need affirmations on the questions I asked in this reply, I'll try and test based on the assumptions that I declared. Feel free to correct me.

Last edited by AlMahllawi (2025-07-02 07:51:00)

Offline

#4 2025-07-01 21:52:41

seth
Member
Registered: 2012-09-03
Posts: 65,807

Re: [PEBKAC] Integrated GPU still used when booting using NVIDIA optimus

What I got out of that is that I should set the environment variables:

The point is that OM is not really for wayland and rudimentary support was just added.
Use the compositor specific configuration for control the GPU (hyprland has similar stuff, https://wiki.hypr.land/Configuring/Multi-GPU/ ) and nb. that regardless of the backend, SDDM will run on some display server, too - you want to control that as well.

Finally make sure that if you've an output attached to the IGP, you will be using that chip no matter what - as VGA hub.

The point about the sticky is to provide an overview on the situation w/ hard data - not assumptions and assertions.
Eg. "qdbus org.kde.KWin /KWin supportInformation" or "glxinfo -B", nvidia-smi output or intel_gpu_top

Online

Board footer

Powered by FluxBB