無法在 Ubuntu 20.04 中變更 amd GPU 和 Mem 時脈和電壓

無法在 Ubuntu 20.04 中變更 amd GPU 和 Mem 時脈和電壓

從 Ubuntu 18.04 LTS 升級到 Ubuntu 20.04 LTS 後,我無法再調整 Sapphire Radeon RX 580 Pulse 或 Sapphire Radeon RX 580 Nitro+ SE 的時脈和電壓設定。更改風扇和功率限制沒有問題。我使用的是 amdgpu 驅動程式 20.30-1109583。我嘗試使用 amdgpu 驅動程式 20.20 但遇到了相同的問題。

我嘗試使用 Bash 腳本、Wattman_GTK、amdgpu-clocks 手動執行此操作,並嘗試使用 CoreCtrl (會崩潰)。

我已更改 /etc/default/grub 以包括:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash amdgpu.ppfeaturemask=0xffffffff"

並且也嘗試過

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash radeon.si_support=0 amdgpu.si_support=1 amdgpu.dpm=1 amdgpu.ppfeaturemask=0xffffffff"

這是我的 Bash 腳本:

#!/bin/bash
# Get path for card 1
card_path=`readlink -f /sys/class/drm/card1/device`

echo "Path for card: $card_path"
echo "Initial values for card:"
echo "Power limit: $(cat $card_path/hwmon/hwmon2/power1_cap)"
echo "Fan settings: $(cat $card_path/hwmon/hwmon2/pwm1)"
pwm1_max=`cat $card_path/hwmon/hwmon2/pwm1_max`
echo "pwm1_max: $pwm1_max"
echo "GPU and memory clocks and voltages"
echo "$(cat $card_path/power_dpm_force_performance_level)"
echo "$(cat $card_path/pp_od_clk_voltage)"
echo " "

# Set power limit

echo "Setting card power limit:"
echo 101000000 > $card_path/hwmon/hwmon2/power1_cap

echo " "

# Set GPU and mem clocks and voltages

echo "Setting GPU and Mem clocks and voltages:"
echo manual > $card_path/power_dpm_force_performance_level

echo 's 0 300 750' > $card_path/pp_od_clk_voltage
echo 's 1 751 793' > $card_path/pp_od_clk_voltage
echo 's 2 848 806' > $card_path/pp_od_clk_voltage
echo 's 3 858 812' > $card_path/pp_od_clk_voltage
echo 's 4 900 820' > $card_path/pp_od_clk_voltage
echo 's 5 1059 840' > $card_path/pp_od_clk_voltage
echo 's 6 1194 880' > $card_path/pp_od_clk_voltage
echo 's 7 1280 890' > $card_path/pp_od_clk_voltage

echo 'm 0 300 750' > $card_path/pp_od_clk_voltage
echo 'm 1 1000 800' > $card_path/pp_od_clk_voltage
echo 'm 2 2215 895' > $card_path/pp_od_clk_voltage

echo c > $card_path/pp_od_clk_voltage

# Set Fan
echo " "
echo "Setting Fan:"
echo 1 > $card_path/hwmon/hwmon2/pwm1_enable
pwr_prc=$((pwm1_max * 7/10))
echo "$pwr_prc"
echo $pwr_prc > $card_path/hwmon/hwmon2/pwm1



# Check values 

echo " "
echo "Check settings"
echo "Power limit: $(cat $card_path/hwmon/hwmon2/power1_cap)"
echo " "
echo "Fan settings: $(cat $card_path/hwmon/hwmon2/pwm1)"
echo " "
echo "Clocks and voltages: "
echo "$(cat $card_path/power_dpm_force_performance_level)"
echo "$(cat $card_path/pp_od_clk_voltage)"

使用運行腳本

sudo sh -c ./card1.sh

產量:

Initial values for card:
Power limit: 101000000
Fan settings: 173
pwm1_max: 255
GPU and memory clocks and voltages
manual
OD_SCLK:
0:        300MHz        750mV
1:        751MHz        793mV
2:       1048MHz       1006mV
3:       1158MHz       1112mV
4:       1240MHz       1150mV
5:       1309MHz       1150mV
6:       1364MHz       1150mV
7:       1430MHz       1150mV
OD_MCLK:
0:        300MHz        750mV
1:       1000MHz        800mV
2:       2100MHz        950mV
OD_RANGE:
SCLK:     300MHz       2000MHz
MCLK:     300MHz       2250MHz
VDDC:     750mV        1200mV
 
Setting card power limit:
 
Setting GPU and Mem clocks and voltages:
./card1.sh: line 28: echo: write error: Invalid argument
./card1.sh: line 29: echo: write error: Invalid argument
./card1.sh: line 30: echo: write error: Invalid argument
./card1.sh: line 31: echo: write error: Invalid argument
./card1.sh: line 32: echo: write error: Invalid argument
./card1.sh: line 33: echo: write error: Invalid argument
./card1.sh: line 34: echo: write error: Invalid argument
./card1.sh: line 35: echo: write error: Invalid argument
./card1.sh: line 37: echo: write error: Invalid argument
./card1.sh: line 38: echo: write error: Invalid argument
./card1.sh: line 39: echo: write error: Invalid argument
./card1.sh: line 41: echo: write error: Invalid argument
 
Setting Fan:
178
 
Check settings
Power limit: 101000000
 
Fan settings: 173
 
Clocks and voltages: 
manual
OD_SCLK:
0:        300MHz        750mV
1:        751MHz        793mV
2:       1048MHz       1006mV
3:       1158MHz       1112mV
4:       1240MHz       1150mV
5:       1309MHz       1150mV
6:       1364MHz       1150mV
7:       1430MHz       1150mV
OD_MCLK:
0:        300MHz        750mV
1:       1000MHz        800mV
2:       2100MHz        950mV
OD_RANGE:
SCLK:     300MHz       2000MHz
MCLK:     300MHz       2250MHz
VDDC:     750mV        1200mV

Wattman_GTK 和 amdgpu-clocks 也產生了錯誤:

write error: Invalid argument

使用運行腳本

$sudo sh card1.sh

給出,而不是“echo:寫入錯誤:無效參數”,

echo: echo: I/O error

當我嘗試從命令列更改時脈和電壓時也會發生這種情況:

$sudo echo 's 7 1280 895' > /sys/devices/pci0000:00/0000:00:1c.7/0000:0d:00.0/pp_od_clk_voltage

產生:

-bash: /sys/devices/pci0000:00/0000:00:1c.7/0000:0d:00.0/pp_od_clk_voltage: Permission denied

答案1

我對預設內核(5.4)有同樣的問題。將核心更新到邊緣一(linux-generic-hwe-20.04-edge)後,問題就消失了。

答案2

這對我在 Radeon VII 20.04 和驅動程式 20.45 上有效

對於所有核心時鐘層級的變更:

echo 's 0 300 750' > $card_path/pp_od_clk_voltage

到:

echo 'vc 0 300 750' > $card_path/pp_od_clk_voltage

並且內存級別僅獲得最大頻率的一項設置,因此刪除:

echo 'm 0 300 750' > $card_path/pp_od_clk_voltage
echo 'm 1 1000 800' > $card_path/pp_od_clk_voltage

並改變:

echo 'm 2 2215 895' > $card_path/pp_od_clk_voltage

到:

echo 'm 1 2215' > $card_path/pp_od_clk_voltage

答案3

我遇到了同樣的問題,只是將雙引號 (") 更改為簡單引號 ('),效果很好

IE更改:

echo "s 0 300 750" > /sys/class/drm/card0/device/pp_od_clk_voltage

到:

echo 's 0 300 750' > /sys/class/drm/card0/device/pp_od_clk_voltage

希望這可以幫助。

相關內容