A Linux laptop with both AMD iGPU and NVIDIA dGPU, using Wayland, and experiencing lag on an external monitor connected via HDMI to the NVIDIA dGPU. That's a interesting setup!
To address your question: yes, you might need to configure Reverse PRIME (also known as "Reverse Prime" or "PRIME Render Offload" in some contexts) to improve performance.
Here's a brief explanation:
- PRIME: PRIME is a technology that allows the Linux kernel to offload rendering from one GPU to another. In your case, you have an AMD iGPU and an NVIDIA dGPU.
- Reverse PRIME: When the external monitor is connected to the NVIDIA dGPU (via HDMI), the iGPU renders the framebuffer, and the NVIDIA dGPU scans it out. This is known as "Reverse PRIME". The iGPU is doing the rendering, and the dGPU is simply displaying the rendered output.
To check if Reverse PRIME is already being used, you can run:
xrandr --verbose
(or wlr-randr if you're using a Wayland compositor that supports it, like Sway)
Look for the "PRIME" or "render offload" output in the connected display's section. If it says "PRIME: 1" or "render offload: yes", then Reverse PRIME is already being used.
If Reverse PRIME is not being used, you can try enabling it. The steps vary depending on your Linux distribution and the compositor you're using (e.g., GNOME, KDE, Sway).
For GNOME and KDE:
- Make sure you have the
nvidia-driver package installed, and that it's properly configured.
- Create a file in
/etc/X11/xorg.conf.d/ (e.g., 99-nvidia.conf) with the following content:
Section "Device"
Identifier "NVIDIA dGPU"
Driver "nvidia"
BusID "PCI:x:x:x" # Replace x:x:x with the actual Bus ID of your NVIDIA dGPU (e.g., lspci | grep -i nvidia)
EndSection
Section "Screen"
Identifier "NVIDIA dGPU"
Device "NVIDIA dGPU"
EndSection
- Reboot your system.
For Sway and other Wayland compositors:
- You might need to configure your compositor to use the NVIDIA dGPU for rendering. For Sway, you can add the following to your
~/.config/sway/config file:
output * bg #000000 solid_color
output HDMI-A-1 mode 1920x1080@60Hz pos 0 0 # adjust to your external monitor's settings
output HDMI-A-1 gpu nvidia # or the corresponding output name
- Restart Sway.
Verify Reverse PRIME:
After configuring Reverse PRIME, verify that it's being used by checking the output of xrandr --verbose or wlr-randr again.
If you're still experiencing lag, you may want to investigate other potential causes, such as:
- NVIDIA driver version and configuration
- AMD iGPU driver version and configuration
- Linux kernel version
- Compositor-specific settings
By configuring Reverse PRIME, you should be able to improve the performance of your external monitor connected to the NVIDIA dGPU.