Weird graphical glitches in hybrid graphics (NVIDIA+AMD) laptop

I am using a Lenovo Legion 5 Pro laptop that has the following specifications:

Kernel: 6.7.0-arch3-1
OS: EndeavourOS Linux x86_64
Resolution: 2560x1600
DE: Plasma 5.27.10
CPU: AMD Ryzen 7 7745HX with Radeon Graphics (16) @ 5.151GHz
GPU: NVIDIA GeForce RTX 4060 Max-Q / Mobile
GPU: AMD ATI 08:00.0 Raphael

I have set up the GPU to use PRIME render offloading so that I can switch between the graphics cards and ensure a better battery life.

I have been having an issue of graphical glitches ever since I had installed endeavourOS, back then my system was running on open source graphics drivers so I assumed that the issues would go away when I would install proprietary drivers but the issue persisted.

Here is an image of the glitch:

A video as well:

It sometimes starts randomly but one way to force it to happen is to run some GUI apps and resize the window repeatedly. The glitch starts simple like the cursor is glitched or icons is glitched and then the entire screen glitches leaving the only option of force shutdown by the power button.

I would be very grateful if someone can help me in resolving this issue. Do let me know if additional logs are required.

Can we see pacman -Q | grep nvidia and cat /etc/kernel/cmdline

Here you go:
output of pacman -Q | grep nvidia:

libnvidia-container 1.14.3-1
libnvidia-container-tools 1.14.3-1
nvidia 545.29.06-12
nvidia-container-runtime-bin 3.5.0-2
nvidia-container-toolkit 1.13.5-1
nvidia-prime 1.0-4
nvidia-prime-rtd3pm 1.0-2
nvidia-settings 545.29.06-1
nvidia-utils 545.29.06-1
opencl-nvidia 545.29.06-1

also output of cat /etc/kernel/cmdline

nvme_load=YES nowatchdog rw root=UUID=d33eac31-9405-4c71-816e-f965cf51100f resume=UUID=d33eac31-9405-4c71-816e-f965cf51100f resume_offset=5529600

I would try a series of things one at a time:

  1. Add nvidia-drm.modeset=1 to /etc/kernel/cmdline and run sudo reinstall-kernels
  2. Remove all those nvidia packages you have installed that aren’t from the Arch repos as a debugging step and see if any those are the cause of the issue
  3. Early load the nvidia drivers as described in our wiki

Hi, I will try these soon and let you know how it goes. Thanks.

The steps above didn’t help but I found the solution on a reddit thread. The fix is to add the following kernel parameters: amd_iommu=pgtbl_v2 iommu=pt acpi=copy_dsdt to /etc/kernel/cmdline and then run sudo reinstall-kernels to regenerate the initrds. It appears to be an issue of the AMD iGPU.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.