Laptop with Dual GPU Setup Guide
NVIDIA PRIME Render Offload
The official way from NVIDIA
Append these environment variables before running the program
Steam
Wrapper script
Arch Linux provides a package called nvidia-prime
that helps you set the environment variables above when you run a program, to use it simply execute the following:
Installation of the Wrapper script
You can use prime-run
now.
GNOME
As of GNOME 3.38 and later, you can select “Run with Discrete Graphics” from the context menu when you right-click on an application.
Clever tool for easy switching between a laptop’s integrated GPU and the discrete one.
Modern laptops have two graphics cards, especially if we talk about gaming laptops. iGPU - integrated GPU, longer battery life, and lower performance. dGPU - discrete GPU, higher performance, but it would drain more battery, highly recommended for gaming, rendering, video encoding, NVENC among other demanding tasks.
Windows automatically switches between the iGPU and dGPU depending on the usage. Here is a guide on how to set up the same for CachyOS, especially if you plan to use it for gaming or streaming, 3D development, etc.
Fully power down the GPU when not in use
PCI-Express Runtime D3 (RTD3) Power Management
Add these rules into /etc/udev/rules.d/80-nvidia-pm.rules
The top three
ACTION=="add"
rules are not needed when running Linux kernel5.5
and newer, see https://download.nvidia.com/XFree86/Linux-x86_64/530.30.02/README/dynamicpowermanagement.html.
To apply these changes right now:
Using nvidia-persistenced
Enable nvidia-persistenced.service to avoid the kernel tearing down the device state whenever the NVIDIA device resources are no longer in use.
And finally, reboot your system. Your laptop’s hybrid mode should now work as it does on Windows!