dasunsrule32 / radeon-scripts Goto Github PK
View Code? Open in Web Editor NEWScripts to manage various aspects of the AMD line of cards in Linux
License: GNU General Public License v3.0
Scripts to manage various aspects of the AMD line of cards in Linux
License: GNU General Public License v3.0
I want to rewrite the scripts with the following in mind:
amd-*
, since this will bring the inclusion of other cards into the foldpstate|clock|voltage
values, this will allow for more cards, more easily, without having to store every cards hardware defaultspower_dpm_state
, as it's only provided for backwards compatibility. Should only be using power_dpm_force_performance_level
going forwardExample idea(s) for amd-power-control
:
amd-power-control -h
- Function to list out help
amd-power-control -r
- Function to reset to default, include c
to commit change to default card values
amd-power-control -p
- Function to set power_dpm_force_performance_level
: auto, low, high, manual
amd-power-control -l
- Function to set a custom profile using power_dpm_force_performance_level
: profile_standard, profile_min_sclk, profile_min_mclk, profile_peak
amd-power-control -s
- Function to set GPU clock pstate/clock/voltage level
amd-power-control -m
- Function to set memory clock pstate/clock level
amd-power-control -v
- Function to set memory clock pstate/voltage level
amd-power-control -i
- Function to get current card settings
amd-power-control -c
- Set powercap
FYI, I use this script to control the fans on my AMD R9 Nano:
https://github.com/grmat/amdgpu-fancontrol/blob/master/amdgpu-fancontrol
I like that you can enter all the temp & pwm pairs in just two lines (7 & 8). OTOH it doesn't feature your auto-detection.
This just as food for thought. :-)
It seems like the script depends on x.xx version numbers (like 4.20), but the newly released kernel uses 5.0.0 as version number and therefore resolves to 50, which is lower than 420.
Replacing the command for getting the kernel version with
KERNELVER=$(awk -F- '{print $1}' <<< `uname -r` | awk -F. '{print $1$2$3}')
seems to work for versions above 4.15 (...for now).
Edit: Never mind, this won't work for version numbers like 4.15.8.
If script is running and a suspend is done, on resume the following is dumped:
vega-fan-curve[6827]: /usr/local/bin/vega-fan-curve: line 65: echo: write error: No data available
On resume, pwm1_enable
is getting reset to 2
, which doesn't allow the fans to be controlled.
Currently running this on Linux Mint 19.1, but I had the same problem on Ubuntu 18.04, and Kubuntu 18.04. I tried it on both the default kernel and 4.20.
I believe I got the same results on Arch with the 4.20 kernel. Specifically Antergos with the Gnome DE.
I followed all the steps. Made sure to add the amdgpu.ppfeaturemask=0xffffffff to the grub config file.
Made sure the value actually changed. I then followed the install instructions for the vega-power-control.
No problems with any of the commands and the required files were successfully copied to their respective locations.
Typing
SYSPATH=$(awk '{print}' <<< find /sys/devices -name power_dpm_force_performance_level -type f -exec dirname {} \;
)
cat $SYSPATH/pp_od_clk_voltage
shows me the default clocks and voltages. So 1630mhz and 1200mv, etc.
Using the
systemctl status vega-power-control.service
watch -n 5 journalctl -n -b -u vega-power-control.service
commands I see
Feb 08 23:56:55 CM6870 systemd[1]: Started AMD Power Control.
Feb 08 23:56:55 CM6870 vega-power-control[3992]: Kernel requirements met, continuing...
Feb 08 23:56:55 CM6870 vega-power-control[3992]: Setting profile to: balanced...
then nothing else. On each reboot it generates that log and no settings actually apply.
Not sure if I did something wrong installing the scripts all those different times and on the different distros.
I'd also like to add that I have a core i7 3770 and an Asus P8H77-M PRO motherboard because that could be relevant to the issue.
I have been looking around for a way to undervolt and overclock my Vega 64 and found this. However, I can't seem to get it installed for some reason.
Went through and added amdgpu.ppfeaturemask=0xffffffff
to GRUB and confirmed it's set. Following the short guide on installing, I can copy and chmod the power and fan control, but whenever I get to
sudo cp systemd/vega-power-control.service /etc/systemd/system
I just get the error in the title. I checked the bin folder and both files are there. Is there something I'm missing? I get the same error for the fan control too.
Running Manjaro KDE 5.0 with the ASUS Strix Vega 64 (STRIX-RXVEGA64-O8G-GAMING)
The fan is ramping up to 3400 RPM during < 30C.
Currently, I'm using a simple case statement to set the FANRPM
, this works well enough, but we need more curve points for the FANRPM
. I'm looking to redo this with an if/then statement to add further refined controls to the fan curve. I'm not 100% sure if this is the most efficient way, since it would be executed in order. I'll do some testing to see if makes sense in this particular application.
ex.
if [$GPUTEMP -ge 20 && $GPUTEMP -le 24] ; then
$FANRPM=400
elif [$GPUTEMP -ge 25 && $GPUTEMP -le 29] ; then
$FANRPM=800
elif [$GPUTEMP -ge 30 && $GPUTEMP -le 34] ; then
$FANRPM=1000
elif [$GPUTEMP -ge 35 && $GPUTEMP -le 39] ; then
$FANRPM=1300
...
radeon-scripts/vega-fan-control
Line 68 in 9ac52e0
As requested, here are the stock clocks and voltages for the Sapphire Pulse Vega 56 (http://www.sapphiretech.com/productdetial.asp?pid=19E343EE-46D4-45E8-9E3E-1693AB30DF14&lang=eng).
== Core
Mhz mV
852 800
991 900
1138 950
1269 1000
1312 1050
1474 1100
1538 1150
1590 1200
== Memory
Mhz mV
167 800
500 800
700 900
800 950
None of the settings in the vega-undervolt-oc script are working on boot.
Need to optimize the code to autodetect the SYSFS location, reducing pipes and run less commands.
radeon-scripts/vega-fan-control
Line 22 in 9fa4656
Hey, it would be great if you could extend your script for the AMD R9 Nano series!
I posted all the infos below. Note that the the R9 Nano is only available with the AMD reference design, so there are no different OEM settings (and I can't even find any branding of the OEM on my card).
$ inxi -G
Graphics: Card-1: Advanced Micro Devices [AMD/ATI] Fiji [Radeon R9 FURY / NANO Series] driver: amdgpu
v: kernel
Display: x11 server: X.Org 1.20.3 driver: amdgpu resolution: 2560x1440~144Hz
OpenGL: renderer: AMD Radeon R9 Fury Series (FIJI DRM 3.27.0 4.19.12-1-CHAKRA LLVM 6.0.0)
v: 4.5 Mesa 18.2.6
$ SYSPATH=$(awk '{print}' <<< `find /sys/devices -name power_dpm_force_performance_level -type f -exec dirname {} \;`)
$ $SYSPATH
bash: /sys/devices/pci0000:00/0000:00:02.1/0000:01:00.0: Is a directory
$ cat $SYSPATH/pp_od_clk_voltage
OD_SCLK:
0: 300MHz 900mV
1: 508MHz 950mV
2: 717MHz 956mV
3: 874MHz 1087mV
4: 911MHz 1125mV
5: 944MHz 1168mV
6: 974MHz 1206mV
7: 1000MHz 1243mV
OD_MCLK:
0: 500MHz 900mV
OD_RANGE:
SCLK: 300MHz 2000MHz
MCLK: 500MHz 500MHz
VDDC: 900mV 1268mV
$ cat $SYSPATH/device
0x7300
$ cat $SYSPATH/subsystem_device
0x0b36
$ cat $SYSPATH/subsystem_vendor
0x1002
$ lspci -knn [snipped]
01:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Fiji [Radeon R9 FURY / NANO Series] [1002:7300] (rev ca)
Subsystem: Advanced Micro Devices, Inc. [AMD/ATI] Fiji [Radeon R9 FURY / NANO Series] (Radeon R9 FURY X / NANO) [1002:0b36]
Kernel driver in use: amdgpu
Kernel modules: amdgpu
$ cat /sys/kernel/debug/dri/0/amdgpu_pm_info
Clock Gating Flags Mask: 0x3ffff
Graphics Medium Grain Clock Gating: On
Graphics Medium Grain memory Light Sleep: On
Graphics Coarse Grain Clock Gating: On
Graphics Coarse Grain memory Light Sleep: On
Graphics Coarse Grain Tree Shader Clock Gating: On
Graphics Coarse Grain Tree Shader Light Sleep: On
Graphics Command Processor Light Sleep: On
Graphics Run List Controller Light Sleep: On
Graphics 3D Coarse Grain Clock Gating: Off
Graphics 3D Coarse Grain memory Light Sleep: Off
Memory Controller Light Sleep: On
Memory Controller Medium Grain Clock Gating: On
System Direct Memory Access Light Sleep: On
System Direct Memory Access Medium Grain Clock Gating: On
Bus Interface Medium Grain Clock Gating: Off
Bus Interface Light Sleep: On
Unified Video Decoder Medium Grain Clock Gating: On
Video Compression Engine Medium Grain Clock Gating: On
Host Data Path Light Sleep: On
Host Data Path Medium Grain Clock Gating: On
Digital Right Management Medium Grain Clock Gating: Off
Digital Right Management Light Sleep: Off
Rom Medium Grain Clock Gating: On
Data Fabric Medium Grain Clock Gating: Off
GFX Clocks and Power:
500 MHz (MCLK)
860 MHz (SCLK)
300 MHz (PSTATE_SCLK)
500 MHz (PSTATE_MCLK)
1087 mV (VDDGFX)
37.108 W (average GPU)
GPU Temperature: 52 C
GPU Load: 34 %
UVD: Disabled
VCE: Disabled
Set the script to autodetect the card by looking for the pp_od_clk_voltage
sysfs entry. This was commited already in adab68 and cabff4 commit.
Thanks for /u/partizann for the suggestion.
Get the temperature provided through SYSFS
API.
$SYSPATH/hwmon/hwmon0/temp1_input
radeon-scripts/vega-fan-control
Line 71 in 224fa29
The current implementation of the trap
command doesn't work. I want the script to reset the pwm1_enable
sys to be reset to stock settings on script exit. This should prevent odd issues, like overheating cards, etc. Currently, when the script exists, the fans will be at whatever FANRPM
was set to last.
# Restore default PWM settings on exit:
pwm_default() {
echo_text "Restoring PWM defaults"
echo "2" > "$SYSPATH/pwm1_enable"
}
# On exit set default fan controls:
trap "pwm_default" EXIT
if [ $DEBUG = 1 ]; then
echo_text "Hit ctrl-c to exit..."
fi
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.