Application like glxgears running at 1 FPS on external display

Hello,

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 ?

Is this while the internal display is on or off?

This happen then the internal display is “on”. I did not test with the internal display “off”

Regardless if the internal display is on or off, I have the same issue.

EDIT:

When only HDMI enabled, everything is “slow”, except the mouse pointer is fine.

When only DP (over USB-C) enabled, everything is “slow”, except the mouse pointer is fine.

When internal Display + HDMI. Only some application are “slow”, like GoogleChrome, GlxGears, etc.

With only Internal display, everything run as expected

Please run nvidia-bug-report.sh as root and attach the resulting nvidia-bug-report.log.gz file to your post.

@generix Thanks for helping.

Here are the bug reports generate with 545 & 535.

nvidia-bug-report-545.log.gz (476.1 KB)
nvidia-bug-report-535.log.gz (466.0 KB)

This was run with triple display: integrated display, HDMI and DisplayPort. With “hybrid” mode.

If you think it’s useful, I may run it with a single monitor too.

It might be related to this issue: Frequently Asked Questions · bayasdev/envycontrol Wiki · GitHub

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

Section "OutputClass"
    Identifier "AMDgpu"
    MatchDriver "amdgpu"
    Driver "amdgpu"
    Option "DRI" "2"
EndSection

@generix Thanks again for helping.

I remove LIBGL_DRI3_DISABLE=true from /etc/environment and create the xorg file as describe.

  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 ~470-500FPS
  4. 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.

Seems this is completely disabling vsync.

After time using the system. The external monitor on DisplayPort “froze” again.

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 Thanks will do

@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 ?.

Now that’s really odd. Does the affected user have any xrandr command set to run in autostart? You could also try to delete ~/.config/monitors.xml

Indeed, deleting .nvidia-setting-rc and .config/monitor.xml seams to “fix” the problem.

Will need to test it a bit further. Anything I can provide to you to help debug this issue ?

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.

Also using hybrid mode. After some time. I get image corruption.

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.