Return to Level1Techs.com

Stutter when launching an application

Got a small issue I can’t seem to figure out. Might be normal behavior for all I know.

Just for the record, I have used Linux for a whole week now on my desktop computer after being a DOS/Windows user my whole life. I chose to use Fedora with KDE. Exception being running Debian for server tasks, like FTP. I know a few basic things, but overall not experienced.

So far everything has been fairly smooth with a few hiccups along the way, like spending 2-3 hours figuring out why I had no audio. I managed to iron out all these things, but one issue remains.

Everytime I open a new application, be it terminal, System Settings, Firefox, whatever, there is a couple of seconds where everything stutters. Most noticable if I play a movie on youtube or something that is in motion. Audio is not affected by this, only the graphical side of things.

This isn’t a huge problem, but it still bothers me a little as I would expect the computer to be powerful enough to handle this in a smooth manner.

My hardware:
AMD Ryzen 9 3950X
ASUS ROG Strix X570-F
ASUS GeForce RTX 2070
G.Skill Trident Z 32GB DDR4 (3600MHz) RAM
Corsair Force M510 m.2 SSD
Creative Sound Blaster ZxR

I ran fpaste, link here: https://paste.centos.org/view/2e67fefa

I am using the nVidia drivers, and have tried turning composition and full composition on and off in the settings without any change. I do not experience any screen tearing. Everything runs great except when launching applications.

Is this stutter, chopping, lag, or what to call it, for a couple of seconds normal behavior, or should starting applications be a smooth process? I do not know if Windows did something similar, as I literally got my current hardware last week and installed Fedora first thing.

I would recommend experimenting with a different desktop environment. I haven’t experienced lag like that using Gnome Wayland with a Vega GPU. Also running Fedora 32 here.

It could also be a memory leak somewhere. If the starting app had to force a lot of memory out to swap in order to start up, that would cause a lot of stutter.

Would installing multiple desktop enviroments cause issues?

I installed htop and tried to monitor what happened when I launched something. Memory remains fine (and swap unused), but CPU usage spikes during the moment everything stutters. It has been hard to catch what caused the spike, but I saw /usr/libexec/Xorg something something pop up with the spike. Could this be driver related? My understanding is that nVidia is still wonky with linux?

EDIT: I tried cpulimit on the process that spikes, but the stutter just got worse. Almost like there’s a lack of resources and not because they’re exhausted. I’m starting to think there’s driver issues.

That is possible, yes. Just use a USB for testing.

I have no experience with soundblaster cards on linux, could that be it? Did you try it without the card?

You don’t have a polaris or vega GPU around somehow, I guess?

Just thought I’d chip in… I’m currently using a Soundblaster Z under Linux with no issues. ZxR could be different though?

I have no issues with the sound. What I struggled with initially after the installation was that the system tried to use a microphone as an output device. I changed it in the GUI that came with KDE, but still wouldn’t work. Had to do the output device changes through terminal. I guess the changes in the GUI didn’t stick for some reason.

What I meant with driver issues is the graphics. Maybe not correctly installed, or some oddball setting missing?

I do not have any AMD GPUs on hand, unfortunately.

Are you really sure it is running the Nvidia driver? Because huge X.org CPU spikes sound like it’s using Nouveau or VESA or LLVMpipe.

Double check in your X.org log which I think should be in /var/log somewhere. Make sure the driver it loads is “nvidia”.

when I changed DE on ubuntu it asked me to change the display manager… I suppose you installed kde on top of standard gnome fedora, right?

on fedora it doesn’t ask you to change the DM, if I recall correctly, so that might be it.

if you really want kde you could try the version that comes with it as default (?)

I’d nuke it

I used the official Fedora with KDE (what they call a spin?), it isn’t installed on top of something else.

Something odd happened last night. I had been playing a game for a few hours without any performance issues. Afterwards I were just browsing some forums and the desktop suddenly went into snail pace lag. I managed to throw up htop to discover Xorg was at 100% on the CPU. I also opened some temperature sensor monitor and saw it gave errors on the graphics card. Temperature was rising and fans were not spinning.

I did a reboot command and it rebooted without any noticable trouble. When I were back in the desktop enviroment, everything was fine again. Actually, felt better for some reason. The stutter when launching applications was gone.

However, when you gain some, you lose some. Now it seems effects are not working, like wobbly windows or jumping program icon at the mouse pointer when launching something.

In System Settings, under “Display and Monitor” and then “Compositor”, a message saying:

OpenGL composing (the default) has crashed KWin in the past.
This was most likely due to a driver bug.
If you think that you have meanwhile upgraded to a stable driver, you can reset this protection but be aware this might result in an immediate crash!
Alternatively, you might want to use the XRender backend instead.

I did check the logs and Xorg is loading the nVidia drivers.

Not sure where to go from here to fix this. I sort of expected the video drivers to just work at this point in time, but I guess it isn’t less of a headache than it was 15 years ago.

I haven’t had any problem with video drivers on Linux for 15 years. But then, I run Intel integrated or AMD graphics with my Linux. I think the Linux server I ran up until about 2007 used a Matrox G200 maybe.

Too bad Matrox sort of gave up. Their cards were nice.

Actually that isn’t entirely true. But the problems I have had were plainly caused by bad or overclocked hardware.

My latest system for example, completely stopped crashing with IOMMU errors from its Vega GPU when I stopped using 3,600 MHz RAM and switched to 2,666 ECC instead.

I’ve had other adventures in overclocking too. Plenty of weird crashes, but in the end it was always solved by fixing the hardware.

Have you perhaps considered that the GPU is bad? Or if it is one of those factory overclocked cards, is it perhaps trying to use its overclock speed while just running the KDE desktop? Windows might be handling variable clocks in a better way. See if you can find a Linux tool to adjust the Nvidia speeds and slow it down some. You certainly don’t need to be running at “OMG OC GAMING SUPERSPEED RGB PLUS!!!” or whatever just on the desktop.

Video drivers have been one thing I always struggled with when it came to Linux. I thought it would be at the point where “it just works” now, but here I am trying to troubleshoot why I get stutter when launching applications on the desktop.

The model I bought shouldn’t be factory overclocked. I never saw the point in it anyway. It is also running in some adaptive clocking mode, so it is underclocked most of the time, like on the desktop.

As a sidenote, one complaint I have with the card is the lack of RGB controls in the settings. I want to turn that damn light off!

I will try to install gnome desktop enviroment or something tomorrow just to test if the issue persists. Seems like it should be easy to install and switch on Fedora.

I do find a lot of references with bugs related to KDE and nVidia, but they were apparently fixed last year?

I installed gnome desktop enviroment now, and everything is seamless there. Something is going on with KDE specifically, then.

Oh, and the stutter came back after a reboot, and so did the effects. I suppose it could be the compositor KDE uses that causes the issues, since everything were smooth after the crash. I assume it temporarily disabled the compositor, or whatever is making the effects.

Is it possible to use other compositors?

I have been tinkering a bit more the last few days. My conclusion is that it is Kwin that is the culprit, rather than xorg that I initially thought. If I disable compositor in the settings, everything is fine (at the cost of no effects on the desktop). I also tried something called compiz which seemed to replace it (things got a bit wonky on an aesthetic level, but was just for testing), and no stuttering with that combination as well.

Now to find out why Kwin isn’t playing nice. I am at version 5.18.5, and see a version 5.19.3 is released. Seems this isn’t available yet in the fedora repositories, so not sure if it is something I should try to manually update in an attempt to solve this.