Poor refresh rate in Jetbrains Rider while using Vulkan rendering #4242
Replies: 22 comments 1 reply
|
Please replicate on sway and cosmic-comp Attempt replicating with the iGPU |
|
I would assume this is just an Nvidia driver issue which would not be our issue, or a duplicate of this: #3562 |
|
Considering this works with all other compositors (including Cosmic) so far, saying this is not a Niri issue seems a bit hastily. |
|
@ferencgyenezs I'm assuming it's fine without vulkan..? And does it work fine with vulkan on xwayland..? |
|
My tests are the same as op's. Jetbrains IDEs with Vulkan enabled are very laggy on switching between windows/selecting multiple lines then scrolling, when multiple project windows are opened; if they're displayed within the same screen (e.g. side-by-side aka. 50%-50%, it's fine), however 100%-100% causes the lag. When the lag happens, no significant overload is observed for CPU %util, GPU %util, GPU PCIe Rx/Tx.
Yes. Removing
Yes. and this won't happen with the iGPU. That is:
edit: ah yea Vulkan only works when Wayland is active. Confirmed that using the mangohud layer ( Won't happen on Hyprland and cosmic-comp. But Hyprland has this: hyprwm/Hyprland#13346 and its fix, not sure if this yields any clue. |
Yes, the lockup doesn't happen, but it also feels like 20fps. Imo Vulkan rendering only works when Wayland (WLToolkit) is active, so with XWayland the Vulkan flag does nothing. @bczhc |
|
Thanky both of you |
|
I would be genuinely curious if someone with an AMD GPU is able to replicate this issue too |
|
Just tried on a laptop with an AMD APU and I can't replicate this issue. Multiple instances whether visible together (50%-50%) or not (100%-100%) don't seem to change anything. I do, however, get a very different bug. Scrolling is fast and smooth, but slams the GPU. The longer you scroll the more of the GPU you use. Where it does lag is when you scroll to the top or bottom of a file. Curious. Edit: Turns out top and bottom are only special in that they tend to change the context display at the top. Not sure what you call it, but the thing that shows which class and method you are inside of. |
|
I can reproduce the issue in Cosmic desktop (Nvidia GPU obviously) by placing two maximised (non-fullscreen) RustRover instances in separate workspaces. |
|
This is almost certainly an nvidia problem. On an AMD APU I forced Rider to use the latest vulkan package for my distro and that fixed the lag. It still eats unreasonable amounts of gpu compute, though. Anyone who can test on an nvidia card, what is your driver number? Version 596.36 seems to still have certain vulkan regression, which, curiously enough, cause bad frame pacing in certain situations. Some hotfixes were released since 596 to theoretically fix it, but a fair number of people on reddit and forums have found that the fix didn't work for them.
For some reason the Islands theme causes extra CPU and GPU work over the old themes. Maybe that's just my system being weird, but maybe somebody else can test on nvidia if switching to an old theme through the launcher either avoids or makes the glitch less bad? |
|
Latest Nvidia Linux driver is 595.71.05 which is the one I'm using. Half of your links are related to Windows driver specifically.
Did you mean Cosmic? If so, then yes, it's also based on smithay.
That's exactly what we are trying to pinpoint. I'm hoping that somebody who has other compositors set up (and Nvidia GPU), will try my steps and report back.
Normal |
|
Since this issue is my only pain point with Niri, I had to do something about it. So this week, I decided to do the most sensible thing and gave Claude the task to fix this issue. Quick recap: If both Rider instances are visible, the performance in both is fine: sidebyside-stock.mp4But the moment I switch both instances to full screen, the first one is fine after a while, but the second instance never recovers. Interestingly enough, in my original videos, the second instance would recover and render just fine after 10 seconds. In this demo, it is stuck at 1 fps. fullscreen-stock.mp4Finding the fix took some iteration, and honestly, I'm not really confident if this is THE fix, since I have no Wayland compositor experience. the-fix.mp4fix branch: https://github.com/ferencgyenezs/niri/tree/%233890-poor-refresh-rate-in-jetbrains-ide-with-vulkan The README.md explains everything in great detail. Mainly because I also had to understand how the compositing pipeline works. The branch includes two fixes:
I don't think that the "Fast, continuous fallback frame callbacks feed regardless of whether the window committed damage" is the right way to go. Mainly because surely you waste compute cycle on windows that are not in focus. Hence, we only give them a callback every 1Hz. Implementing Explicit sync is not enough. Not to mention I don't know, 1. why this is not implemented to begin with, 2. if the implementation is good or not. But one thing is for sure: to make this "fix" work, I needed both. |
|
@ferencgyenezs Your investigation gives a hint! Because of this defect I've disabled my Jetbrains Vulkan rendering mode. But now after rereading it I suddenly am feeling this has something to do with #1525 (and its pr). I tested #2609 and surely, it does fix it. Just enable window-rule {
match app-id=r#"^jetbrains-.*"#
force-render true
}Also I tested your patch and yes it also enables "force rendering" for background applications - anyway but, it breaks Vulkan's fifo present mode (aka. vsync) and makes apps consume unneeded GPU. If mangohud is installed, test it using |
|
So is just a thing that needs the force render and fifo PRs..? Just making sure I'm reading this correctly |
|
Yea I confirmed just #2609 + enabling force-render for jetbrains apps solve the issue. There's nothing related to fifo present mode here. If a GPU program has its "render attachment" surface configured as "fifo present mode" (e.g. Vulkan's |
wgpu-multiwindow.mp4I wrote a wgpu program to demonstrate the similar case. The two windows share the same event loop and they both render a stripe animation. If any of them goes outside the viewport then it only has frame callback @ 1Hz thus even the visible window gets capped at 1Hz. |
|
Would anyone be against me closing this issue as a duplicate of #539 ..? |
|
Sounds fair and I've tested sway and cosmic one more time and am able to reproduce the issue on them (put jb windows in different workspaces. But for me, only with NVIDIA DRM device explicitly specified, see below for details). Though idk if #539 is the final root cause to be blamed but at least a force-render is a workaround. I have an intel+nvidia hybrid GPU + external monitor setup and can only reproduce this issue with an explicit drm render device specified: e.g. for sway it's Maybe we can transfer it to a discussion then. This is more like an application+nvidia-specific problem. |
|
Ya, a discussion is probably better |

Uh oh!
There was an error while loading. Please reload this page.
Config
System Information
CPU: AMD Ryzen 9 5900HX (16) @ 4.68 GHz
Laptop: Lenovo ThinkBook 16p Gen 2
Disclaimer:
The problem: I've been using Rider with Wayland for a while now, but as it turns out, if you do that, the IDE is still doing software rendering. Which means every UI interaction is generally pretty slow, but bearable.
This command enabled Wayland:
Dawt.toolkit.name=WLToolkitThis command enables Vulkan rendering:
Dsun.java2d.vulkan=TrueMy Rider's logs:
To be fair, Vulkan rendering is currently beta: https://youtrack.jetbrains.com/issue/JBR-7558/WLToolkit-Vulkan-rendering-pipeline
And I think Wayland became the default with 2026.1
My problem:
If Vulkan rendering is enabled, and if I have more than one Rider instance running on the same display, when switching between these instances, there is a 5-7second time frame when the IDE is unusable, you can't scroll, barely can interact with anything.
In my demo, this issue is a bit extreme because Instance1 has this 5-7sec unusable period, but Instance2 is permanently slow. This Instance2 behavior is not always true, mostly behaves like I1, so it is slow for the first 5-7 seconds.
If I move Instance2 off to my second screen, everything is fine on the recorded display, but the moment I bring it back to the main screen, the issue is back.
One important thing: I don't have this issue with KDE, I'm doing the same test, on the same laptop, same boosted Nvidia card.
Video demos:
https://gofile.io/d/JDL7yc
niri_rider.mp4
kde_rider.mp4
I did the same test on my desktop, which has a 5070Ti, no iGPU, runs on the stable niri version, and behaves exactly the same.
To be clear, I'm not sure if this has anything to do with niri, or maybe it is Rider, but KDE doesn't have this problem.
All reactions