I own one of the latest Lenovo Legion 5 Pro gen 8 with AMD iGPU and Nvidia RTX 4070.
I’ve install PopOS on it:
Nvidia Driver version: 545.29.02
Linux version: 6.5.6 X.Org X Server 1.21.1.4
I dont have a xorg.conf
In /etc/modprobe I have the following:
options nvidia-drm modeset=1
options nvidia NVreg_DynamicPowerManagement=0x02
options nvidia NVreg_PreserveVideoMemoryAllocations=1
Running in Hybrid mode it’s working relatively fine, except for application like glxgears or GoogleChrome. Then the refresh rate of those application drop to 1 FPS. Meanwhile it’s running perfectly fine at 177 FPS on internal display.
I discover that running those application with “vblank_mode=0” is “solving” the problem. But that is not a real solution.
Could someone help me understand the issue and get this fixed ?
I added LIBGL_DRI3_DISABLE=true in /etc/environment.
1.glxgears running on internal display run at 60FPS
2. glxgears running on external display run at 60FPS
3. switcherooctl glxgears running on internal display run at 60FPS
4. But switcherooctl glxgears running on external display run at 1FPS
So I still have an issue, but adding LIBGL_DRI3_DISABLE=true changes the behavior…
Interesting. Does it again change behaviour if you instead of setting the env variable disable dri 3 at driver level by creating
/etc/X11/xorg.conf.d/amdgpu-dri2.conf
I remove LIBGL_DRI3_DISABLE=true from /etc/environment and create the xorg file as describe.
glxgears running on internal display run at 60FPS
glxgears running on external display run at 60FPS
switcherooctl glxgears running on internal display run at ~470-500FPS
But switcherooctl glxgears running on external display run at ~470-500FPS
I doubt 400FPS is normal since it supposed to be closer to the refresh screen. I’ve set it to 60Hz for testing.
I will try to work with this setup today and report back. But the external monitor “froze” at least once during my quick testing. Meaning, the system is still responsive, but the monitor display the same image until I unplug and re plug the monitor.
The freezing might be an independent prime output sink bug of the nvidia driver. Regarding your initial issue, there seems to be some synchronization issue between the amdgpu and nvidia driver, the amdgpu driver being a special case.
At some time, IIRC the nvidia docs stated something like “amdgpu implements it differently” and Michael Dänzer stated “we’re not implementing prime sync because I think it’s over-engineered”.
So you might also want to ask the amdgpu people about your issue.
@generix I’ve discovered the problem only occur with a specific user. When login in with a different user, the problem goes away. So it might be related to the compositor settings. Do you have any clue what might cause that ?.
A quick test. This seams to be related to the “Primary display”. As soon as I change it from the “internal Display” to either the HDMI monitor or the DP Monitor, I get 1 FPS in glxgears.
I’ve played with other settings, like screen arrangement, frequency, etc. it as not impact.
@generix Any idea what could be the issue ? For now, I simply configure the Dock to be displayed on all screen as a workarround. But changing the “Primary Display” to one of my external monitor causes issue.
I manage to get the same issue in X11 and Wayland. If that’s of any help.
I have another similar laptop with AMG iGPU and Nvidia dGPU. With the extact same configuration (I literally copy the content of the SSD over that other laptop), I dont have any issue.