Gnome-shell-system-monitor-applet: gpu utilization graph is empty

Created on 19 Mar 2018  Â·  18Comments  Â·  Source: paradoxxxzero/gnome-shell-system-monitor-applet

I have installed gnome-shell-system-monitor-applet on ubuntu 17.10. The nvidia driver has been installed and I can see the gpu utilization from the nvidia-smi. However, the applet shows nothing.
How can I debug to see what is the problem?

Most helpful comment

EDIT: I tried Seranth's solution again and it worked. I must have had a typo. The below instructions work too though.

Building on the previous answers...

My issue is that running nvidia-smi prints "N/A" for the GPU utilization. I have an GTX 780, and there is some compatibility problem with nvidia-smi.

On Ubuntu 18.04, Seranth's sed line didn't work for me.

Here's what I did... Edit the file:

~/.local/share/gnome-shell/extensions/[email protected]/gpu_usage.sh

Replace the last line (which gets the GPU usage from nvidia-smi) with the following:

sed -e 's/[^0-9]*//g' <<< $(nvidia-settings -q all | grep -i GPUUtilization | grep graphics | awk '{print $4}')

All 18 comments

I just tried it out and it seems to work fine. What hardware are you using? Can you try out the script (gpu_usage.sh) in the installation directory and tell its output?

You might also need to restart the session to make sure it's working.

Otherwise, you can try what @piegamesde suggested, and look for errors on sudo journalctl /usr/bin/gnome-shell that could be relevant.

I have noticed that when I restart the machine, the gpu graph is fine. However, after some minutes the chart becomes empty. Previously I thought that the problem is related to screen lock (lock after some minutes). But, now I see it fails even without screen lock.

Please see the picture as below. As you can see the gpu_usage.sh is fine! I think something happens between 21:13:00 and 21:15:00. However, I am not sure that was the correct time period. If you think the log is ok, I will try one more time.

https://pasteboard.co/HcEHJDm.png

What if you enable the digit display? What does it show?

Yes it also freezes at the last value.

I'm having this same issue, at startup the GPU meter seems to follow the output of nvidia-smi but pretty quickly it either

a) goes to 0-1% even when GPU usage is higher
b) gets fixed at some value it was at (e.g. 30% and doesn't budge
c) goes to NaN

Restarting the window manager helps for a few minutes but doesn't solve the problem. I'll try the script you mentioned when I get back to my workstation next week.

Thanks for reporting. Unfortunately I don't own an Nvidia GPU, so it's really hard to debug. One thing I can do is provide a debug branch, and then ask for logs. Give me some time for this. Anyone else pitching in would be appreciated obviously!

I'd be happy to help debug, I just cloned master and tested the gpu_usage.sh script included in the install directory which works as expected, but the gnome applet freezes after a few minutes. Happy to try some debug branch if one is available.

nvidia-smi doesn't work for my GTX 650 for some reason to get GPU utilization information. You can get it from nvidia-settings though.

Edit the 'gpu_usage.sh' file, comment out the last line and paste the following at the end of the file instead:
sed -e 's#.*=()#\1#;s'/.$//'' <<< $(nvidia-settings -q all | grep -i GPUUtilization | grep graphics | awk '{print $4}')

That line will get the graphics card utilization from nvidia-settings instead of from nvidia-smi and it seems to be way more reliable.

EDIT: I tried Seranth's solution again and it worked. I must have had a typo. The below instructions work too though.

Building on the previous answers...

My issue is that running nvidia-smi prints "N/A" for the GPU utilization. I have an GTX 780, and there is some compatibility problem with nvidia-smi.

On Ubuntu 18.04, Seranth's sed line didn't work for me.

Here's what I did... Edit the file:

~/.local/share/gnome-shell/extensions/[email protected]/gpu_usage.sh

Replace the last line (which gets the GPU usage from nvidia-smi) with the following:

sed -e 's/[^0-9]*//g' <<< $(nvidia-settings -q all | grep -i GPUUtilization | grep graphics | awk '{print $4}')

I'm having the same issue as cbcoutinho on a fresh Ubuntu 18.04 with a 1050 Ti — GPU graph "gets fixed at some value it was at (e.g. 30% and doesn't budge".

What I've also noticed is that frequently this value seems to 'ramp up'. Starts at 4 or 6%, then goes up to 12 or 16%, then goes up to 24 or 27%. I doubt that those numbers are magical. When it does this it feels like it's displaying a _maximum value_ instead of the current value.

Could also be a buffering/caching issue — I guess — because when this happens the output of gpu_usage.sh does not match what is shown in the graph.

As an additional note, this symptom can be reliably reproduced by simply restarting the session, switching to Firefox, picking almost any YouTube video (longer than about 8 minutes), pressing play and then going full-screen. By the time the video finishes the GPU graph is pretty-much always locked. I have no idea what interplay could be causing it, but it is at least a test case.

Like Seranth and kgreenek with my card (a GTX 780 like kgreenek), running nvidia-smi prints "N/A" for the GPU utilization. kgreenek's solution worked but i got an error with Seranth's one.
So thank you kgreenek, but I guess
sed -e 's/[^0-9]*//g' <<< $(nvidia-settings -q [gpu:0]/GPUUtilization | grep graphics | awk '{print $4}')
may be less greedy

I'm having the same issue as @TimP69, gpu_usage.sh reads the correct value but at some point system monitor will stop reading new values.

I looked in journctl and didn't see anything interesting

Having the same issue. But I don't think it has anything to do with what is in gpu_usage.sh file.

Cause I rewrote gpu_usage.sh to output usage of my AMD GPU using radeontop and the gpu part still freezes after some time. Restarting Gnome shell also only helps for a few minutes.

So the problem probably lies somewhere else that causes gpu stat to stop updating to new values.

I confirm that I have the same issue. My system is running Ubuntu 18.04 with Nvidia RTX2070. gpu_usage.sh works all the time, but the applet only works at the beginning and then it stops updating the GPU stat and then shows only 0% and 0/0 MiB. I have not determined what action I have to do to make it stop working. All other stats (CPU, Mem, HD, etc.) work fine.
I do not think it is the problem of nvidia-smi as gpu_usage.sh works and therefore changing to nvidia-settings can hardly help.

Update: Yesterday I have been working on my computer whole day and GPU stats were working fine. Today it worked fine in the morning and then I left my computer for a hour (display went to the power-saving mode as usual) and GPU stats stopped working. To enable it I have to reboot, not even logout and login helps. The script gpu_usage.sh works all the time.
Maybe the script does not get called periodically anymore. Can someone tell me, how can I check that the script is being called?

There's definitely a bug in gpu_usage.sh (notice the // in the middle of the command name):

https://github.com/paradoxxxzero/gnome-shell-system-monitor-applet/blob/1903feb7dbf7dae64c788afba7ff520b40c34a5d/system-monitor%40paradoxxx.zero.gmail.com/gpu_usage.sh#L34

Aside from that, when I fixed that bug locally, it still doesn't show up any GPU utilization or RAM. I looked at the list of processes, and it seems nobody periodically calls gpu_usage.sh

I've got it fixed for me in #569. Can somebody test the fix?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nirik picture nirik  Â·  7Comments

dkumor picture dkumor  Â·  10Comments

Strykar picture Strykar  Â·  12Comments

jakethelizard99 picture jakethelizard99  Â·  4Comments

ceyhunn picture ceyhunn  Â·  9Comments