Skip to main content
GameDev.net gamedev.net
🔒 Locked

Weird framedrops

Started by RmbRT Feb 14 at 7:36 PM 5 replies 400+ views
Original Post
RmbRT
RmbRT

I posted this on stackoverflow and instantly got my question closed and hidden by some (probably AI) moderator with the reason:

Closed. This question needs debugging details. It is not currently accepting answers.

Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.

Somehow they had the resources to instantly close my question after I posted it, but when editing it and appealing, they can't react for over half an hour? Definitely AI. Not going to use that shitty site ever again.

Anyway, here's the (original, unedited) question:

——————————————————————————

(Ubuntu 25) Chrome/Brave occasionally displays at 33ms intervals, dropping committed frames (rendered at 60fps)

I am writing a WASM application with WebGL, rendering to a fullscreen canvas. Occasionally, I get stutters or dropped frames. I am running this in Brave (Chrome) on an Ubuntu 25.04 (Gnome 48/X11, Linux 6.14.0-37-generic) machine, and using requestAnimationFrame() to schedule my rendering. As can be seen in the screenshot below, my render loop gets scheduled neatly at the start of each frame, and then finishes within around a millisecond in the main thread. The GPU also finishes in around 100µs. But for some reason, there is this occasional frame that takes 33.3ms for no discernible reason, despite containing two fully rendered and committed (the "Commit" compositor event in the profiler) frames. Also, there is no measurable GC work going on within that time.

Is this my fault, or is this Chrome's fault, or is this Ubuntu's fault? Could it be that the GPU driver is somehow having a GC that is not part of the profiling, and can cause missed frames? Or could it be my monitor that occasionally desyncs? Are there any known issues that could cause this?

It is not that my frame logic takes too long, because then, it would not skip a rendered frame, but simply render fewer frames. But when I have things that are only shown for a single frame, these sometimes do not show up at all, as the entire rendered frame gets dropped and never displayed. Is there anything I can do about this?

Walk with God.
JoeJ
JoeJ

RmbRT said:
or is this Chrome's fault

This one is easy to figure out. Just install and try any browser there is. You surely want to do this anyway.

RmbRT
RmbRT

It seems my entire Gnome is dropping frames. Even other programs have the same stutters, it's just hard to see a frame drop in a text editor, so I hadn't noticed in other programs. I already went through great troubles to isolate Brave from writing too much to disk, because I'm a bit paranoid since my SSD died on my last laptop after just 5 years. Even just launching firefox already does 129MiB of disk writes, so I hate to even use it. I modified my Brave to mostly just use /tmp/, which is backed by RAM. And I also disabled the swap partition and all that. Also had to lock some files on disk so that Brave can't rewrite them every few seconds. I still get 3-5 GiB of disk writes per day even when not doing anything, really. I also had to do the same thing to sublime text, because saving a single file somehow also wrote multiple megabytes to disk in addition to the file.

I asked a pal who uses Windows and he could find no stutters, so it must be some linux regression or ubuntu regression, because I never had frame drops before on my linux machines.

I can't wait for the day where I can just roll my own minimal software runtime bare-metal. Let me out of this hellhole that is modern software.

Walk with God.
RmbRT
RmbRT

Just configured my system to use lightdm instead of gdm3 (Gnome display manager). Massive reduction in frame drops. Even when I go into power saving mode where the CPU throttles massively, I barely get any drops. Prior, I got massive drops in power saving mode, and quite noticeable ones in balanced or even performance mode. Now I still get a few dropped frames, but never more than one in succession, so the stutters are not really noticeable.

I guess I should also switch away entirely from gnome and to some other desktop environment. It was never this bad before. I bet some super genius open source programmer must have contributed a lot to gdm3 recently.

Walk with God.
JoeJ
JoeJ

Grown up in the 80's i still expect from a computer it only does what i command it to do, and nothing else behind my back.

Sadly those times are gone.

When i saw the youtuber who bought Commodore talking about his vision, i felt some hope. He shared my opinion on what computers should be, and what not. So i was hoping for a mini PC running Linux maybe, simple and without all the bloat.

But then all we got was a 8bit C64 in a translucent case so we can see shiny LEDs inside. /:D\

RmbRT
RmbRT

Operating systems should go back to DOS-level complexity. Literally called “Disk operating system”. Windows was supposed to be an operating system supporting windowed programs. Now you got cortana and even ads on the desktop (if you got the free windows license), and the windows terminal can't even render quickly enough to make a terminal-based roguelike without flickering on re-render.

All you really need is a way to talk to disk, network, GPU, speakers & microphone, mouse & keyboard and maybe joysticks / gamepads. The rest can be user-space addons, like printer support or something. Everything else is basically just junk. Maybe also throw in a C/C++ compiler and a terminal or something and you're good to go. Even a graphical file browser is fine to have.

Once I'm done with my game and hopefully got a few years of leisure time before the money from that runs out, I'll look into stuff like this where they run bare metal OpenGL, and see whether I can make a minimal windowing system out of that. Then an application simply receives a render buffer it can render into, or something, and all display is done through OpenGL. Later on, I'd maybe extend that with vulkan, idk. But if you're going to use all that stuff anyway in the application, why have a different rendering stack in the OS than what the user applications use? And in exclusive fullscreen mode, you get direct access to the bare metal OpenGL context / its framebuffer. Or something like that anyway.

With a lean stack, it should be impossible to get random frame drops. The only “downside” would be that you can't run a browser on such a system, but they are super bloated anyway and the biggest liability in the system anyway. Maybe I'd support a browser that can do HTML1, but even that would be entirely useless since basically no useful parts of the web still use the old protocols. So unless you enter the W3C web spec treadmill of constant updates and millions of lines of code written by google, you can't participate in “the web”. Which means you then have to constantly update your system to keep up with the browser releases that try to keep up with the web spec changes, and you also cannot diverge in OS design from Windows or whatever I should call modern Linux distros, as the browser can't simply be ported to another environment. And then even if you have a browser, you still get massive disk thrashing.

A computer should run for decades without updates. The internet shouldn't need revisions. And it certainly shouldn't need 30 million lines of code to be usable.

Walk with God.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.