Setting up hybrid graphics linux is generally painful with the current state of Nvidia support. If you can avoid getting an Nvidia GPU based laptop if you plan to use Linux. I use a distro called Archcraft and had some issues specific to my setup (distro/hardware)
The hardware I am installing this on is a TongFang GM6TG7W (aka Wootbook Extreme IV). It has an Intel iGPU and an Nvidia 3070 Max-Q dGPU.
This guide is actually documentation for myself if I have to set it up again but if it helps anyone thats a bonus. I guarantee absolutely nothing but this worked for me. (This was documented Dec 2022 and might get out of date quick)
- Set Graphics to use integrated GPU in BIOS before starting installation process (There currently is a bug in the installer that hangs on hardware detect if MsHybrid or dGPU is selected)
- Go through installation process and reboot.
- Update system
- Update Pacman
sudo pacman -Syu
- This will likely fail due to some outdated GPG keys. Run the following:
Your system should now be up to date and have the newest kernel installed.sudo pacman -S archlinux-keyring && \ sudo pacman-key --refresh-keys && \ sudo pacman -Syu && \ yay -Syu
- Reboot your system and make sure to enter the BIOS again
reboot
- Update Pacman
- In the BIOS you can now set the
MsHybrid
option (from iGPU) and boot into Archcraft again - You can now verify the Nvidia GPU is present by running
This should yield 2 entries, one Intel and another Nvidia. eg.lspci -k | grep -A 2 -E "(VGA|3D)"
00:02.0 VGA compatible controller: Intel Corporation TigerLake-H GT1 [UHD Graphics] (rev 01) DeviceName: Onboard - Video Subsystem: Tongfang Hongkong Limited Device 1147 01:00.0 VGA compatible controller: NVIDIA Corporation GA104M [GeForce RTX 3070 Mobile / Max-Q] (rev a1) Subsystem: Tongfang Hongkong Limited Device 1147
- Next set the
ibt=off
kernel parameter by editing the grub config file and regenerating the config- Add the said parameter to the list of parameters for the line starting with
GRUB_CMDLINE_LINUX_DEFAULT=
eg:
Change the following line to addsudo vim /etc/default/grub
ibt=off
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash loglevel=3 udev.log_level=3 vt.global_cursor_default=0 ibt=off"
- Now regenerate the grub config with
sudo grub-mkconfig -o /boot/grub/grub.cfg
- Add the said parameter to the list of parameters for the line starting with
- Remove unneeded modules from the initial ramdisk. Ensure that nvidia and i915 is present.
nouveau
can be removed along with the other virtualization modules.
eg:sudo vim /etc/mkinitcpio.conf
Now regenerate the ramdisk:MODULES="i915? nvidia? crc32c-intel"
sudo mkinitcpio -P
- Install
nvidia
driver
Reboot again. The machine should now be booting and you should be able to successfully log in. You can now also test that the GPU is detected by the driver by runningsudo pacman -S nvidia
nvidia-smi
- Install
optimus-manager
Important for SDDM: You need to comment out 2 lines from the following fileyay -S optimus-manager optimus-manager-qt
sudo vim /etc/sddm.conf
Reboot the machine and run:[X11] #DisplayCommand=/usr/share/sddm/scripts/Xsetup #DisplayStopCommand=/usr/share/sddm/scripts/Xstop
You can then switch withoptimus-manager --status
optimus-manager --switch hybrid