[Knowledge trsf] If you have FPS drops, check your Conky config

I want to share my personal experience in this issue as it may well happen to others and I don't want you to go through all I did. loll

I have spent almost 12hours reading and testing and validating in order to pinpoint a 5-8FPS drop I was consistently getting every 5 sec, which was causing frame drops/freezings and made video streaming a bad experience, as well as freezing the mouse cursor a few msec every 5sec.

It was like that in Dr460nized and then I took my test HD with KDE Multimedia installed and damn I had the same issue, although it was less important and at every 8sec intervals.

It seemed XRENDER was almost getting rid of this, but openGL was hit bad.

I was about to get crazy. This was fine when I tested Garuda before using it and the issue started a few days ago. I thought it could be nvidia driver updates, kernel updates, etc...

My hardware is not low end: Ryzen 3700x, 16Gb, lots of fast enough HDs with space, nvidia GTX 1650, 4K 60FPS monitor and very low and controlled temperatures all around the machine. I do not do gaming either. And since when I boot from Kubuntu subvolume all is smooth with same nvidia driver and configuration, I knew it wasn't the hardware.

SOLUTION

Well out of nowhere during my lunch time I decided to look at the problem from a different tack. Maybe I should look around for what I have on my system that occurs every 5sec?

The obvious place to look at was Conky. I have added to the default Garuda Conky theme a bunch of data for my video card. Clock Speed, Fan Speed, Fan Load, GPU Usage, Mem Usage, Mem Speed... most of them use nvidia-smi to poke the data from and one uses nvidia-settings. All of them are poked every 5sec.
Then there is the CPU TOP processes at the bottom, and CPU freq/load at the top, but they aren't at every 5sec. Still who knows.
There was also HDDTEMP every 5 sec.

I decided to comment out one by one and once I got to the video card data I commented them out.

BAM! 59-62FPS steady, no more drop, no more freeze!

Then I uncommented them out one by one and it seems the more I had using nvidia-smi, the worst the FPS drop/freeze gets.

It's posible my lines in Conky are wrong, I'll look into that later, but at least I know this type of processing could cause you FPS drops. even with a fast machine and no CPU used.

I can now have fun again using Garuda! :smiley:
Just I'll be more careful when I change stuff. :smiley:

8 Likes

I don't have nVidia (judging by the problem counts, a good thing) but I do have Conky. Are these problem calls via ${execi}? If so, perhaps using ${texeci} could help, as it doesn't hold on until finished the full call. I do things (such as du calls) that way, and output text files for display calls, thus not slowing things down...

Just a possibility. Don't have any idea how you call nvidia-smi! Also, if you can, piggyback the calls to one 'iteration' (perhaps an exterior script which calls in succession all the features, and writes /tmp text files?). There are lots of workarounds possible in the conky environment :grin:

1 Like

texeci, now if I could just remember that till I next want to mess with Conky, but I often wander into kitchen and forget why I went in there....lol

1 Like

The idea of using a txt file was what I had in mind next, although I need to search on how to do it first of course. Having just one call to nvidia-smi instead of... 7 right now. lolll

texeci didn't seem to change anything from a human perspective, however it does not seem to cause any harm either so I am sticking with that one for now, still I am only calling 1 instance of nvidia-smi instead of 7 at the same time, so 6 lines are kept commented out.

My lines are certainly dirty, it's the 1st time I play with Conky I was not targeting -yet- perfection, just that if I could retrieve the data or not. I have simplified by removing the GOTO and COLOR parts at the beginning of each line for the purpose of posting here:

$Product Name${alignr}${color1}${exec nvidia-smi -q --gpu=0 | grep "Product Name" | awk {'print $4,$5,$6'}}${color}

Driver Version${alignr}${color1}${exec nvidia-smi -q --gpu=0 | grep "Driver Version" | awk {'print $4'}}${color}

Usage${alignr}${color1}${texeci 5 nvidia-smi -q --gpu=0 | grep "Gpu" | awk {'print $3'}}${color}%

Fan Load${alignr}${color1}${texeci 5 nvidia-smi -q --gpu=0 | grep "Fan Speed" | awk {'print $4'}}${color}%

Fan Speed${alignr}${color1}${texeci 5 nvidia-settings -q [fan:0]/GPUCurrentFanSpeedRPM | grep 'fan:0' | awk {'print $4+0'}}${color} RPM

Graphics Clock${alignr}${color1}${texeci 5 nvidia-smi -q | grep 'Graphics' | awk NR==1{'print $3'}}${color} MHz

Memory Clock${alignr}${color1}${texeci 5 nvidia-smi -q | grep 'Memory' | awk NR==6{'print $3'}}${color} MHz

Memory Usage${alignr}${color1}${texeci 5 nvidia-smi -q | grep 'Used' | awk NR==1{'print $3'}}${color} MiB

Temp${alignr}${color1}${texeci 5 nvidia-smi -q --gpu=0 | grep "GPU Current Temp" | awk {'print $5'}}${color}°C

Here's more or less what I mean with the texeci call:

${texeci 5 nvscriptname}

where nvscriptname is whatever (and wherever) you call a version of this:

sample script
#!/bin/bash
#Stick them all together
nvidia-smi -q --gpu=0 | grep "Product Name" | awk {'print $4,$5,$6'} > /tmp/nvname
nvidia-smi -q --gpu=0 | grep "Driver Version" | awk {'print $4'} > /tmp/nvdriver
nvidia-smi -q --gpu=0 | grep "Gpu" | awk {'print $3'} > /tmp/nvusage
nvidia-smi -q --gpu=0 | grep "Fan Speed" | awk {'print $4'} > /tmp/nvfanload
nvidia-settings -q [fan:0]/GPUCurrentFanSpeedRPM | grep 'fan:0' | awk {'print $4+0'} > /tmp/nvfanspeed
nvidia-smi -q | grep 'Graphics' | awk NR==1{'print $3'} > /tmp/nvgraphics
nvidia-smi -q | grep 'Memory' | awk NR==6{'print $3'} >/tmp/nvmemspeed
nvidia-smi -q | grep 'Used' | awk NR==1{'print $3'} >/tmp/nvmemusage
nvidia-smi -q --gpu=0 | grep "GPU Current Temp" | awk {'print $5'} > /tm,p/nvgputemp
# I have shown them all in /tmp - but I have a subdir in my conky woprking dir for keeping them from previous run
# because then it will run without waiting or error when starting up despite use of texeci

Then the individual calls are all like this:

Driver Version${alignr}${color1}${exec cat /tmp/nvdriver}

with colors and positioning as required. It's a lot of ${exec}s, but I don't find they hit performance as much as all that (with modern CPUs anyway) - the update runs in a separate thread once in 5 seconds to update the files...

Woaa! That works almost perfectly!! :smiley:
Still a few FPS drops but they don't freeze and skip frames, I'd say 98% perfect, I'll definitely keep this way of doing it.

Conky is really powerful! Can you believe I was using gkrellm since 2007? Conky can do a lot more no question there.
My next step is to learn how to code historical charts, this is important for me to monitor disk I/O over a course of say 60sec. I'm not there yet, bunch of stuff to test and play with, but with probably 2 weeks I'll get on the learning board for that.

Oh BTW, one small typo here:

A "comma" too many in "/tm,p". :slight_smile:

I will leave Product Name and Driver Version out of the script to keep it as small as possible, since those 2 usually don't change every 5 sec! I sure hope not! loll

Tnx big times for that, @freebird54!! :smiley:

I'm surprised there was only one typo - I was going pretty fast! Easy answer for the less often changed - split it into two scripts - and run the less frequent one less often...

Historical chart... I gather what is built in is not doing it for you? Just speculating here, but save io stats to a file, run gnuplot on it, and ${image} the results into conky? Hmmm...

3 Likes

Yeah that sucks I understand!

The 1st thing to do is to kill Conky. See if that helps.
If that does not help or if you don't have Conky running at all, then I highly suggest opening another thread in order to prevent mixing up multiple issues in one thread and also having a misleading thread subject.

I have solved that by deleted conky and pressing alt + shift + f12 (key to disable compositor)

That happened to me once.

Glad you fixed the FPS issue.

For the booting up (or lack of), can you open another thread so we can follow up?

ok sir as you say i am opening another topic

You gotta stop this or you will end up banned here too.

1 Like