radeon-profile
radeon-profile copied to clipboard
feature: support for multiple temperature sensors
Newer radeon graphics cards since vega20 – including AFAIK all navi based cards – expose three temperature sensors via the hwmon: Edge temperature (the "classic" GPU temp), junction temperature and memory temperature. radeon-profile so far only read the first temperature sensor (edge temp).
This set of changes enables detecting all available temperature sensors when hwmon is available. Including any other sensors not listed above - should there ever be any. This data is then made available to the user throughout the UI in the following places:
- display current temperature in the GPU data list
- also display critical and emergency temperature limits in GPU data list
- all sensors can be selected to display temperature in topbar widgets
- all sensors can be selected to display in charts in the Graphs tab
- the temperature sensor to use for fan curves can be selected when creating fan curves in the fan control -> custom curves tab. Different fan profiles can use different temperature sensors.
- all sensors readings can be used to generate events in the events tab
- Exec logs include all temperature readings
(On top of that, I also changed the hysteresis setting in the fan control tab to a per profile setting rather than a global one, since that seemed more consistent).
Any card not supporting more than one temperature sensor should still work as it had before. It was so far only tested on a Radeon VII (vega20) though.
For easier review, each of those features is split into its own commit. The most intrusive change is the replacement of the ValueID enum with a struct containing two components in the first commit: the type enum, and a new instance id. This allows to use multiple values of the same ValueID type with each their own unique key in gpu::gpuData. I considered just adding more values to the ValueID enum for junction/mem temperature and their min/max/before values respectively, but this would not allow dynamically creating an arbitrary number of sensors. It would also require to blow up a lot of switch statements with a lot of new cases for each new sensor. Using a key with two components seemed more flexible for future use to me.
This has been merged on my fork, with the other commits found under merge-e-world/master. I added some signals/slots to flag modifications in the Fan Control tab and ask to save the modification.
That being said, the configuration's saving and restoring processes will need to be modified to properly represent the information and deal with multi-GPU setup. But this is another topic I will work on soon.