Laptop with Dual GPU Setup Guide
Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
What’s hybrid graphics?
Hybrid graphics is a hardware configuration in which you have two graphics cards that can work in tandem with each other. This approach is mainly found in laptops where you have integrated graphics (iGPU) of your CPU, and discrete graphics (dGPU). The main advantage is that integrated graphics should (but not necessarily) only be used for low-profile tasks, such as surfing the Internet, watching videos, etc. On the other hand, discrete graphics are used for high-performance things like gaming, video editing, 3D modeling, and so on. Consequently, if two GPUs share “big” and “small” tasks, then if we have only “small” tasks running at the moment, we don’t need to use our dGPU, so it can simply be disabled (as if asleep), thereby significantly reducing power consumption. This way when our dGPU is needed again (we run an application using it), it will wake up and start working.
What’s PRIME Offload?
PRIME is a unifying technology for working with different sets of hybrid graphics in Linux, like NVIDIA Optimus/AMD Dynamic Switchable Graphics. PRIME Offload is an implementation of the idea of moving the execution of render from one GPU to another in Linux. PRIME support in a closed NVIDIA driver actually started only with the 435.17 driver. So if you are a user of the outdated 390xx or even 340xx driver branches, PRIME Offload will not work for you. Note that we also strongly discourage you from using outdated ways to handle hybrid graphics, such as nvidia-xrun or Bumblebee. They are obsolete and unsupported (Bumblebee has not been updated for over 8 years), run solely on hacks and have low performance. At the same time the Nouveau driver supports PRIME Offload, which can be an alternative for older dGPUs.
In CachyOS, you don’t need to configure anything to make PRIME Offload work. With the nvidia-utils package and cachyos-settings you already have everything you need to use PRIME Offload.
Also, please avoid using tools like optimus-manager. They may seem quite handy to you, but believe us, they can cause a lot of issues and you really don’t need them if your dGPU supports PRIME Offload and dynamic power management.
How to use PRIME Offload?
To indicate driver that you want to use discrete graphics instead of integrated graphics, you must specify a number of environment variables before running the program:
__NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only __GLX_VENDOR_LIBRARY_NAME=nvidia <program>
This set of variables looks very cumbersome and easy to forget, so you can
install the nvidia-prime
package (sudo pacman -S nvidia-prime
), which
contains script-alias for all these variables. Then running an application
using it will look like this:
prime-run <program>
Where <program>
is the name of command that runs your application.
Graphical way
You may find launching all applications you need through the terminal with
prime-run
not too convenient, but some applications/desktop environments
offer graphical tools to control which GPU to use when launching applications.
Lutris
To configure games to run with discrete graphics in Lutris you need to go to settings (three strips in the bottom right corner of the window and “Preferences” button). Next, go to “Global Options” -> “Display”. Here you select the GPU with which the game will be run.
![shit](/_astro/lutris-prime.BLho-XF1.png)
Steam
Steam doesn’t have a special setting to run game using discrete graphics, but you can click the “Gear” and go to “Properties” before launching each game. There you have to prescribe the prime-run command or environment variables like:
prime-run %command%
You must be sure to put %command%
after prime-run
! Remember that game
options come after placeholder, and system environment variables or commands
come before it.
![shit](/_astro/steam-prime.B7WgOHEm.png)
KDE Plasma
Plasma has a very handy way to set up the startup of applications with discrete graphics. But it works only if switcheroo-control package and corresponding service are installed in the system:
sudo pacman -S switcheroo-controlsudo systemctl enable --now switcheroo-control
For new installations of CachyOS, this package and service should already be enabled by default via chwd.
After that right click on the desktop entry you need on your desktop or in the application menu then go to “Properties” -> “Application” -> “Advanced Options”.
You should have “Run using dedicated graphics card” checkbox checked.
![shit](/_astro/plasma-prime.CY7wUvbC.jpg)
GNOME
On GNOME, you should also install switcheroo-control as shown above and right-click on the application icon and select “Run using discrete graphics”. But note that GNOME does not remember this choice later, and the next time you simply click on the icon, application will still run using integrated graphics.
Cinnamon
Similar to Plasma in Cinnamon, you can also go to the Properties of desktop entry of the application you want to use, and enable the checkbox there.
![shit](/_astro/cinnamon-prime.Drbotftu.png)
If it’s not available, make sure you have switcheroo-control
installed and
its service enabled, because all desktop environments rely on it for this
functionality.
Troubleshooting
I: “I don’t have a choice of Wayland session GDM”
S: This is a GDM upstream issue that intentionally blocks access to Wayland session selection on the login screen, despite the fact that your integrated GPU may support Wayland perfectly well.
To workaround this you need to disable the udev rules that are responsible for this:
sudo ln -s /dev/null /etc/udev/rules.d/61-gdm.rules
I: “My external monitor is very laggy on PRIME”
S: This is a known NVIDIA driver issue. You should have the latest NVIDIA driver installed and use Wayland with a compositor that supports explicit sync. For GNOME this has been fixed in version 46.2. For Plasma 6 it will probably be fixed with 6.1 although some users report normal performance already on 6.0. Other environments/window managers still have this issue, so you need to switch to the latest version of GNOME or Plasma to fix it.