External monitor freezes when using dedicated GPU

Same problem here:

  • Garuda Linux (arch linux)
  • Kernel: 6.11.5-zen1-1-zen
  • RTX 2060 Laptop
  • AMD 4800h with AMD Radeon Vega Series / Radeon Vega Mobile Series
  • Driver open-nvidia-dkms 565.57.01
  • XOrg

When i use 2 monitor (integrated + HDMI) it works like a charm, I use heavily CUDA with AI models.
But if I connect another screen to USB-C thus having 3 screens, is sufficient a simple application that uses the GPU and it totally freezes both external monitors. The frozen image persists all the time, even starting the shutdown procedure, it remains until the laptop completely shuts down. if I use optimus-manager to force ā€œGPU-onlyā€ mode, the integrated is no longer detected, and even using the GPU heavily with all 3 screens, no problem. Only there is horrible stuttering and the screens are laggy, looks like 45fps… Over all, the session comes to occupy 1GB spent in the video card’s VRAM, and the remaining 5GB of VRAM is not enough for my activities, so the only-GPU is not a valid option…

2 Likes

Did you try reinstalling distro?

Because i did that in my friends pc who had the same issue, it did work…

So at this point i really think it’s the installation orchestration because as soon as a user does something to the driver after the installation, it’s messed up.

1 Like

Same problem with CachyOS. Please fix this major bug, thank-you.

Today, I installed the KDE spin of Fedora, and using the default drivers installed when checking ā€œinstall third-party packagesā€ during setup, and the default Wayland environment, this issue seems to be completely gone.

I did nothing other than add these kernel parameters to fix KDE desktop animations not being very smooth:

nvidia-drm.fbdev=0 nvidia-drm.modeset=1

The included driver version seems to be 560.35.03, which had freezing issues for me on EndeavorOS but seems to be completely fine on Fedora with no further adjustments.

2 Likes

As I said, I had a completely clean installation, and still experienced the issue.

Did you try to run glxgears/vkcube reising test with your fresh setup, as described in post External monitor freezes when using dedicated GPU - #87 by dmakc ?

Did you try to run glxgears/vkcube reising test with your fresh setup, as described in post External monitor freezes when using dedicated GPU - #87 by dmakc ?

Yes, running an instance of vkcube and rapidly resizing windows was the very first thing I tested, with seemingly no issue.

I also later tested with an instance of Godot Engine, as well as a variety of games on Steam. None of these applications caused intermittent freezing. Not sure how or why, but the issue seems to not be present on a clean KDE Fedora install.

I just saw, that Nvidia is mentioning this bugfix as part of the linux driver version 560.35.03:

Fixed a bug that could cause external displays to become frozen until the next modeset when using PRIME Display Offloading with the NVIDIA dGPU acting as the display offload sink.

https://www.nvidia.com/de-de/drivers/details/230926/

I upgraded to said version and also added the suggested kernel parameters but I still get monitor freezes. It took quite long this time though, so not sure if it had an effect. Only difference which I have to your described setup is that I don’t use KDE.

4 Likes

Updated my install to 565.57.01 (it seemingly just got pushed to the Fedora 41 repos) and it seems to still be doing fine. Not sure why.

1 Like

Are you using Xorg or Wayland? On my installation with wayland i don’t have the freeze but the screens are extremely laggy due to a GNOME bug… (Overview animation stutters with 2 monitors with differing refresh rate (#2315) Ā· Issues Ā· GNOME / mutter Ā· GitLab)
I am in a condition where I can neither go down nor up :'(

1 Like

I’m still using Xorg. I just tested Wayland for half an hour and indeed no freezes (so far).
But therefore I run into a lot of other problems:

  • As you described the external monitor is extremly laggy and not a pleasure to work on
  • If I start glxgears with Nvidia it crashes as soon as I resize the window
  • Some 3d-applications refuse to start completely

I guess these problems are likely not part of this bug at all, but switching to wayland as a workaround doesn’t seem to be an option yet.

1 Like

Have you tried the kernel parameters I listed above? Those helped with performance on KDE for me, though the external display connected over USB C is sometimes a little under-performant, maybe due to mismatched refresh rates.

Also, yes, I am using Wayland on Fedora 41 as it is the only officially supported default. I haven’t had too many problems with it surprisingly, other than having to move on from some applications (Flameshot → Spectacle, Redshift → KDE Night Light, etc.).

I’ve tried 560.35.03 with Fedora 41-1.4 and Plasma Waylaynd (kwin_wayland) with kernel 6.11 and nvidia-drm.fbdev=0 nvidia-drm.modeset=1 - it works without freezes while I’m running glxgears/vkcube test. But I’ve got very low FPS in glxgears, sometime falling to 20-30. It’s extremely slow for me.

Then I’ve switched back to Plasma X11 (kwin_x11) under the same setup and I’ve got freezes again. So it seems for me, that freezes are connected to NVidia X11 driver/libraries, which are not used when we are running Wayland. Or there is something wrong in NVidia X11 <=> kernel driver interaction, don’t know.

3 Likes

Yes but it didn’t help. In the end both, the laggy monitor and not being able to use some of the 3d applications are an exclusion criteria for me right now of using wayland (Being able to use 3d-applications on an external monitor would be the reason to switch to a non freezing setup in the first place ;) )

I have the same problems with my ASUS ROG Strix Hero III Gaming Laptop and Zorin OS 17.2.

With two externally connected monitors (one via HDMI, one via USB-C to HDMI), I experience screen freezes. Sometimes they occur after a few minutes, other times after hours of work.

I switched from Wayland to X11, and all the freezes are gone for good.

Changing the Nvidia driver version did not make a difference. I am currently using the one from Nvidia (version 565) for better gaming performance.

1 Like

If I’m getting this straight, the reverse worked out for you? As in, you were getting freezes on Wayland but don’t get them on X11? That would be interesting because it would rule out it being entirely display system-dependent.

Precisely! I am working and gaming for 5 Days now without a single freeze with X11. (the last three days without a reboot/shutdown/sleep, just to make sure)

2 Likes

I have a laptop with amd cpu and nvidia 4070 laptop gpu combination, connected to an external monitor using an usb-c to displayport cable, both gpus active.
I am on ArchLinux, kernel 6.12.1-arch1-1, nvidia driver 565.57.01-8 system is updated today as of 2024-12-07
I did several testing following scenarios on the system:
KDE Plasma with KWin Wayland: No freezes with either vkcube, glmark2 or both is running and resizing continuously, tested all internal monitor, external monitor and both active modes with no issues.
KDE Plasma with KWin X11 on external monitor only: When vkcube is resized, it sometimes resized very quickly and continue to render correctly just like in wayland, but around 10-20% percent possibility of freezing the screen for 2-3 seconds on resizes, and also has like 1-5% percent of freezing the screen forever, which is the main problem for now, it is a lower percentage so it may not be noticed by everyone on every time, so i suggest testing more deeply and longer with more combinations if a fix was done, glmark2 running or not doesn’t affect anything.
KDE Plasma with KWin X11 on internal monitor only: Behaviour is similar to external monitor scenario but the difference is whole screen doesn’t get frozen, only vkcube window is frozen with a black content when it happens, sometimes it just become black forever too, i guess screen doesn’t get frozen because it is output using amdgpu, whereas external monitor output is using nvidia gpu.
Openbox X11 window manager without any desktop or compositor on external monitor only: Similar to KDE but more likely to have straight freeze when i resize vkcube window for the first or second time, results are worse.
Openbox X11 window manager without any desktop or compositor on internal monitor only: Similar to KDE, more likely to have straight freeze of the vkcube window only, not the whole screen, sometimes 5 seconds, sometimes forever.
I usually play steam games in KDE Plasma X11 with external monitor only, rarely some games (No Man’s Sky) fail to launch and freeze the entire screen. Alt+tabbing from games to desktop and back to the game has 50% chance of game slow down to 2-3 FPS speeds, more alt+tabbing several times would fix it and back to normal high FPS, and just like previous test, has 5% chance of game will freeze and could not be continued but screen doesn’t get frozen, in that case i have to terminate the game.
I use CTRL+Alt+F3 then CTRL+Alt+F2 if entire screen is frozen, this sometimes have to be repeated several times to unfreeze the screen, and rarely screen can never be unfrozen, so i use terminal command to kill screen freezing application to continue.
I did not try to test nvidia gpu only scenarios, i couldn’t test amd gpu only scenarios too because external monitor could not be connected to amd gpu, it only connects to nvidia gpu.

I hope it helps.

2 Likes

I want to share my experience.

My pc have the following specs:

  • Host: (Lenovo Legion 5 15ARH05H)
  • Kernel: 6.12.1-zen1-1-zen
  • Resolution: 3840x2160
  • DE: GNOME 47.2
  • WM: Mutter (X11)
  • CPU: AMD Ryzen 7 4800H (16) @ 2.90 GHz
  • GPU: NVIDIA GeForce RTX 2060 Mobile
  • GPU: AMD Radeon Vega Series / Radeon Vega Mobile Series [In]
  • Memory: 31457 MiB
  • Driver Version: 565.57.01

I have posted in this thread in the past since my workstation had:

  • My integrated monitor (1920x1080@120hz)
  • My external monitor on the left (1920x1080@75hz)
  • My mini monitor 10" (2K 16:10 60hz)

With these three monitors connected, all it took was any application using the dedicated video card, and the 2 external monitors would freeze completely.

Recently, however, I was annoyed by all these monitors with different sizes and resolutions, so I bought a Gigabyte M32U (3840x2160@144hz).

I then attached the USB-C cable to the monitor to project and closed the lid of my laptop, thus disabling the laptop monitor.

Result:
4k screen perfectly smooth and running, even using cuda heavy applications such as blender, AI models etc (under X11)

Hypothesis:

  1. The graphics compositor cannot handle different monitors at different frequencies and resolutions well, so it causes the freeze
  2. Some component (maybe the nvidia driver, or maybe the kernel or maybe the window manager) can’t handle the screen projection on 3 separate devices well

I hope these details can help someone who, like me, has had to work in uncomfortable conditions that hinder productivity.

2 Likes

I think freezes are not compositor issues. I’ve tried to disable effects (compositor) in KWin and this doesn’t change anything.

According to the profiling results by sysprof the main cause of freezes is NVidia DRM driver internal ioctl handlers. We are talking about reverse PRIME, when internal GPU (f.e. Intel) rendering pipeline synchronizes with discrete GPU rendering pipeline (NVidia). They must synchronize cause iGPU writes to the dGPU video memory, whose contents are later output to the external monitor, connected to the dGPU output port (HDMI, eDP, etc). So I think, that root causes of NVidia freezes are hidden somewhere in DRM linux kernel subsystem and NVidia driver <=> DRM interactions.

3 Likes