Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small support request #51

Closed
franglais125 opened this issue Aug 16, 2017 · 9 comments
Closed

Small support request #51

franglais125 opened this issue Aug 16, 2017 · 9 comments

Comments

@franglais125
Copy link

Hi,

I'm working on adding support for GPU loads for a Gnome Shell extension (paradoxxxzero/gnome-shell-system-monitor-applet#386).

Since I don't own a Radeon GPU, I can't test the tool. I was wondering if you could provide me with a way of getting the information needed in a succinct CLI way. I need: the GPU load, the vRAM used, and total vRAM.

Dummy example command:

radeontop | grep load
radeontop | grep vRAM

Thanks a lot for your time!
Fran

@clbr
Copy link
Owner

clbr commented Aug 16, 2017

Use the dump option.

radeontop --help

        RadeonTop for R600 and above.

        Usage: /usr/sbin/radeontop [-ch] [-b bus] [-d file] [-l limit] [-t ticks]

-b --bus 3              Pick card from this PCI bus
-c --color              Enable colors
-d --dump file          Dump data to this file, - for stdout
-l --limit 3            Quit after dumping N lines, default forever
-t --ticks 50           Samples per second (default 120)

-h --help               Show this help
-v --version            Show the version

So "radeontop -d -" to output to a pipe continuously, or if you want one-shot, add "-l 1".

Sample line:

1502903295.84311: gpu 0.00%, ee 0.00%, vgt 0.00%, ta 0.00%, sx 0.00%, sh 0.00%, spi 0.00%, sc 0.00%, pa 0.00%, db 0.00%, cb 0.00%, vram 30.01% 153.66mb

@clbr
Copy link
Owner

clbr commented Aug 16, 2017

For total VRAM, you need to get that some other way.

@franglais125
Copy link
Author

franglais125 commented Aug 16, 2017

Thanks a lot! That's exactly what I was looking for.

As for the total VRAM, can I do 153.66 / 30.01% = 512 MB to get the total?

@9898287
Copy link

9898287 commented Aug 16, 2017

# radeontop -d - -l 1
Dumping to -, line limit 1.
1502903993.303070: gpu 0.83%, ee 0.00%, vgt 0.00%, ta 0.00%, sx 0.00%, sh 0.00%, spi 0.00%, sc 0.83%, pa 0.00%, db 0.00%, cb 0.83%, vram 4.95% 201.15mb
, gtt 0.12% 4.80mb

@franglais125
Copy link
Author

franglais125 commented Aug 16, 2017

@9898287 , so in your exampe, the total VRAM is 201.15 / 4.95% = 4064mb ? I'm asking just to be sure.

Thanks a lot for the quick support!

@9898287
Copy link

9898287 commented Aug 16, 2017

Yes, that's correct. Also,

$ echo $(dmesg | grep -o -P -i "(?<=vram:).*(?=M 0x)")$" Mb"
4096 Mb

@franglais125
Copy link
Author

Thanks again! Cheers.

@franglais125
Copy link
Author

It seems that root privileges are required to run radeontop. Any way around that?

@clbr
Copy link
Owner

clbr commented Aug 17, 2017

Root rights are not required if your kernel is new enough, libdrm is new enough, and your user has access to the DRM node. If you tried to run radeontop without a Radeon card, it would fail to find one in DRM, and assume it needed the root path - even if your system otherwise was set up for non-root access.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants