clbr / radeontop

GNU General Public License v3.0
808 stars 70 forks source link

stats wrong when GPU goes offline #13

Open tobiasjakobi opened 10 years ago

tobiasjakobi commented 10 years ago

Hello,

I'm using radeontop on a laptop system with a Intel Haswell and a Radeon R9 M265X (through PRIME). So when just using the Intel, the kernel driver keeps the Radeon switched off. Then radeontop doesn't even start ("Can't find Radeon cards"). When the Radeon is used, then radeontop works perfectly.

However, when I then quit the application using the Radeon, the kernel driver switches the GPU off again after some time. Then radeontop just prints 100% for every stats entry.

I don't know what's the most logical way to proceed here. Let radeontop exit once the GPU disappears? Stop data collection and display as long as the GPU is offline and proceed with it once it comes online again?

Greets, Tobias

clbr commented 10 years ago

I'm not sure of the best way to detect that either, a very pathological case could cause a 100% load over all units. Doing PCI polling would be needless overhead for "normal" systems.

I don't have such a system to test with, so I wouldn't be able to implement either solution really. Leaving open for discussion.

tobiasjakobi commented 10 years ago

At least for my system config the power state can be read from '/sys/class/drm/card1/device/power_dpm_state'. I haven't tried this, but maybe one can use inotify to watch this node and act accordingly (suspend generation of statistics) when the state changes. I think this should be less heavy than PCI polling.

rafaelnp commented 9 years ago

@tobiasjakobi: I have the same hardware here (Radeon R9 M265X) and the same issue and 2 questions:

  1. How could I make the kernel use the Radeon GPU?
  2. How can I know which GPU is being used (i915 or radeon)?
tobiasjakobi commented 9 years ago

@rafaelnp: Depends on your setup (DRI2 or DRI3). Usually you can just use plain old glxinfo to check what GPU is currently in use.

rafaelnp commented 9 years ago

I am running Arch Linux, Kernel 4.1.0 (Custom kernel) and also run 4.0.6-ARCH. Does it work with DRI2 or DR3?

So far I was not able to get the AMD GPU to be used. I read a lot of content regarding the PRIME configuration butt so far I had no success running the radeontop. I am currently using DRI2.

If you could suggest some reference to this regard, that would be appreciated. Thanks in advance.