FreeBSDDesktop / kms-drm

the DRM part of the linuxkpi-based KMS
63 stars 26 forks source link

[amdgpu] hwmon? #150

Open rszibele opened 5 years ago

rszibele commented 5 years ago

Hi, Is it possible to read GPU hardware values like on Linux? On Linux it's possible to read and set voltages, clocks, temperature, fan speed, etc. of the graphics card.

It seems like sysctl is the way to do this on FreeBSD, but I wasn't able to find any relevant variables or information on this.

See: Reading/Writing on Linux: https://wiki.archlinux.org/index.php/AMDGPU#Overclocking FreeBSD patch for radeon temps? https://marc.info/?l=freebsd-hackers&m=150713012322431&w=2

valpackett commented 5 years ago

powerplay/overdrive is available under the sys.device.drmn0 sysctl tree.

Here's an example script for setting Vega clocks and voltages:

#!/bin/sh
sysctl sys.device.drmn0.power_dpm_force_performance_level=manual
sysctl sys.device.drmn0.pp_od_clk_voltage="r"
sysctl sys.device.drmn0.pp_od_clk_voltage="s 0 852 800"
sysctl sys.device.drmn0.pp_od_clk_voltage="s 1 991 900"
sysctl sys.device.drmn0.pp_od_clk_voltage="s 2 1084 950"
sysctl sys.device.drmn0.pp_od_clk_voltage="s 3 1138 970"
sysctl sys.device.drmn0.pp_od_clk_voltage="s 4 1200 1000"
sysctl sys.device.drmn0.pp_od_clk_voltage="s 5 1401 1020"
sysctl sys.device.drmn0.pp_od_clk_voltage="s 5 1536 1050"
sysctl sys.device.drmn0.pp_od_clk_voltage="s 7 1560 1100"
sysctl sys.device.drmn0.pp_od_clk_voltage="m 0 167 800"
sysctl sys.device.drmn0.pp_od_clk_voltage="m 1 500 800"
sysctl sys.device.drmn0.pp_od_clk_voltage="m 2 1000 1000"
sysctl sys.device.drmn0.pp_od_clk_voltage="m 3 1090 1000"
sysctl sys.device.drmn0.pp_od_clk_voltage="c"

hwmon is not implemented as far as I know, so no fan/temperature monitoring