clbr / radeontop

GNU General Public License v3.0
810 stars 72 forks source link

Is it possible to print total vram using when writing values to stdout? #162

Closed Samueru-sama closed 10 months ago

Samueru-sama commented 10 months ago

I'm trying to write a polybar script that takes the used/total vram of the GPU and prints the results.

The issue I have is that while radeontop with its GUI does show the total VRAM of the GPU, when printing the info witth radeontop -d - the value is not shown, only used vram is shown instead. Any help?

clbr commented 10 months ago

IIRC this came up before. Printing the total each line would grow the logs unnecessarily. I recommend either calculating the total from the percentage, or grabbing the total dmesg. It may also be available in /sys, not sure though.

clbr commented 10 months ago

*from dmesg.

clbr commented 10 months ago

Alternatively, I'd be open to taking a patch for a new cli option like "--print-maximums" that would just output the vram/gtt/clock max amounts and exit.

Samueru-sama commented 10 months ago

IIRC this came up before. Printing the total each line would grow the logs unnecessarily. I recommend either calculating the total from the percentage, or grabbing the total dmesg. It may also be available in /sys, not sure though.

I see, well you know what is funny? amdgpu_top -d prints the used/total vram but doesn't print the gpu usage in percentage like radeontop does, looks like I will have to use it along with radeontop to get the info lol.

Edit: I ended up using amdgpu_top, if anyone wants it:

amdgpu_top -J -n 1 | jq -c -r '(.devices[] | ((.gpu_activity.GFX.value|tostring) + "% " + ((.VRAM."Total VRAM Usage".value/1024*10|round/10|tostring) + "/" + (.VRAM."Total VRAM".value/1024*10|round/10|tostring)) + "GiB"))'

Which nicely prints the gpu usage plus vram in GiB.