Pulsing rendering under X11 Opengl Ubuntu

Started by
3 comments, last by Tyranna 4 years ago

I am writing a game engine in C. I am having pulsing lag in my rendering. About ever 1 second there is a lag hiccup. I experienced a very similar problem when I used to play DOOM II. It would pulse lag 4 times in a row , about 1 second apart. The solution was to terminate the window manager explorer.exe . I am now on Ubuntu Linux using an OpenGL context with the X11 window manager. I think the window manager here may be doing the same thing. I do not think I can terminate the windon manager here though… Maybe someone has run into this as well and knows what the cure to this is.

Advertisement

Sure can you stop the display manager, just “sudo systemctl stop [displaymanager]” where [displaymanager] is your displaymanager. Ubuntu changes them with the weather. Try lightdm, just for fun (save your work), and you're back on Linux :-)

But that's not a solution. I'd leave the system in peace and debug and/or profile the application to see where it hangs. Speculating: memory leaking, memory being copied around, tasks that should be done once being executed every frame, like buffer allocation, … idk …

If you're using a compositing window manager (like most are these days), make sure you're setting your game window to fullscreen unredirect. That bypasses the compositing so you're rendering directly to the scanout. If stuttering is still a problem after that, the problem is in your game with dropped frames or thread blocks.

Stephen M. Webb
Professional Free Software Developer

Thanks for the input there....

Well, I think that I got the override_redirect and borderless fullscreen working.

No change. every 1 second its like uh , uh , uh , uh. Its not massive but noticeable. Kinda like a facial tick…..

I do notice with the top command , it shows that its running 100% CPU.

Turned the nice to -20 , no change.

Stopped grabbing mouse , no change.

Turned off glDebugMessageCallback , no change.

I turned off everything including my mouse and keyboard input routines , and just drew a single cube , Same.

Disabled my sound routines and callbacks , no change.

I set up a timer to record the time it takes to get thru the main loop that includes the

drawing routine , comes in at 1/750th of a second to process rendering in the main loop.

Added XFlush after glXSwapBuffers , same.

It feels like at the 1 second mark , that the framerate drops temporarily , then after the lag it speeds up again. So it lurches.

I am using the stock RADEON driver that comes with Ubuntu.

How do i turn off this #%^ double spacing….

This topic is closed to new replies.

Advertisement