Skip to content

Commit 94cd569

Browse files
feat: RDNA4 support (#12)
* feat: initial rdna4 support * fix: avoid setting min range value * feat: add support for new sclk offset format * fix: write sclk offset line in one operation * fix: handle relative fan info path correctly for test usage * chore: bump version
1 parent bcb940d commit 94cd569

74 files changed

Lines changed: 370 additions & 26 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "amdgpu-sysfs"
3-
version = "0.17.6"
3+
version = "0.18.0"
44
authors = ["Ilya Zlobintsev <ilya.zl@protonmail.com>"]
55
edition = "2021"
66
license = "GPL-3.0"

src/gpu_handle/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use std::{
2424
fmt::{self, Display, Write as _},
2525
fs,
2626
io::Write,
27-
path::PathBuf,
27+
path::{Path, PathBuf},
2828
str::FromStr,
2929
};
3030
#[cfg(feature = "overdrive")]
@@ -379,7 +379,7 @@ impl GpuHandle {
379379
}
380380

381381
fn read_fan_info(&self, file: &str, section_name: &str, range_name: &str) -> Result<FanInfo> {
382-
let file_path = self.get_path().join("gpu_od/fan_ctrl").join(file);
382+
let file_path = Path::new("gpu_od/fan_ctrl").join(file);
383383
let data = self.read_file(file_path)?;
384384
let contents = FanCtrlContents::parse(&data, section_name)?;
385385

src/gpu_handle/overdrive/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ where
238238
}
239239

240240
/// A range.
241-
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
241+
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
242242
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
243243
pub struct Range {
244244
/// The lower value of a range.

src/gpu_handle/overdrive/snapshots/amdgpu_sysfs__gpu_handle__overdrive__tests__detect_type_phoenix.snap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ data:
77
current_sclk_range:
88
min: 800
99
max: 2700
10+
sclk_offset: ~
11+
rdna4_sclk_offset_workaround: false
1012
current_mclk_range:
1113
min: ~
1214
max: ~
@@ -16,6 +18,7 @@ data:
1618
sclk:
1719
min: 800
1820
max: 2700
21+
sclk_offset: ~
1922
mclk: ~
2023
curve_sclk_points: []
2124
curve_voltage_points: []

src/gpu_handle/overdrive/snapshots/amdgpu_sysfs__gpu_handle__overdrive__vega20__tests__parse_6700xt_full.snap

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ expression: table
55
current_sclk_range:
66
min: 500
77
max: 2725
8+
sclk_offset: ~
9+
rdna4_sclk_offset_workaround: false
810
current_mclk_range:
911
min: 97
1012
max: 1000
@@ -14,10 +16,10 @@ od_range:
1416
sclk:
1517
min: 500
1618
max: 2800
19+
sclk_offset: ~
1720
mclk:
1821
min: 674
1922
max: 1075
2023
curve_sclk_points: []
2124
curve_voltage_points: []
2225
voltage_offset: ~
23-

src/gpu_handle/overdrive/snapshots/amdgpu_sysfs__gpu_handle__overdrive__vega20__tests__parse_6800_full.snap

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ expression: table
55
current_sclk_range:
66
min: 500
77
max: 2314
8+
sclk_offset: ~
9+
rdna4_sclk_offset_workaround: false
810
current_mclk_range:
911
min: 97
1012
max: 1000
@@ -14,10 +16,10 @@ od_range:
1416
sclk:
1517
min: 500
1618
max: 2600
19+
sclk_offset: ~
1720
mclk:
1821
min: 674
1922
max: 1075
2023
curve_sclk_points: []
2124
curve_voltage_points: []
2225
voltage_offset: ~
23-

src/gpu_handle/overdrive/snapshots/amdgpu_sysfs__gpu_handle__overdrive__vega20__tests__parse_6900xt_full.snap

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ expression: table
55
current_sclk_range:
66
min: 500
77
max: 2499
8+
sclk_offset: ~
9+
rdna4_sclk_offset_workaround: false
810
current_mclk_range:
911
min: 97
1012
max: 1000
@@ -14,10 +16,10 @@ od_range:
1416
sclk:
1517
min: 500
1618
max: 3000
19+
sclk_offset: ~
1720
mclk:
1821
min: 674
1922
max: 1075
2023
curve_sclk_points: []
2124
curve_voltage_points: []
2225
voltage_offset: ~
23-

src/gpu_handle/overdrive/snapshots/amdgpu_sysfs__gpu_handle__overdrive__vega20__tests__parse_7800xt_full.snap

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ expression: table
55
current_sclk_range:
66
min: 500
77
max: 2660
8+
sclk_offset: ~
9+
rdna4_sclk_offset_workaround: false
810
current_mclk_range:
911
min: 97
1012
max: 1219
@@ -14,6 +16,7 @@ od_range:
1416
sclk:
1517
min: 500
1618
max: 5000
19+
sclk_offset: ~
1720
mclk:
1821
min: 97
1922
max: 1500
@@ -22,4 +25,3 @@ od_range:
2225
voltage_offset:
2326
min: -450
2427
max: 0
25-

src/gpu_handle/overdrive/snapshots/amdgpu_sysfs__gpu_handle__overdrive__vega20__tests__parse_7900xt_full.snap

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ expression: table
55
current_sclk_range:
66
min: 500
77
max: 2735
8+
sclk_offset: ~
9+
rdna4_sclk_offset_workaround: false
810
current_mclk_range:
911
min: 97
1012
max: 1250
@@ -14,6 +16,7 @@ od_range:
1416
sclk:
1517
min: 500
1618
max: 5000
19+
sclk_offset: ~
1720
mclk:
1821
min: 97
1922
max: 1500
@@ -22,4 +25,3 @@ od_range:
2225
voltage_offset:
2326
min: -450
2427
max: 0
25-

src/gpu_handle/overdrive/snapshots/amdgpu_sysfs__gpu_handle__overdrive__vega20__tests__parse_7900xtx_full.snap

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ expression: table
55
current_sclk_range:
66
min: 500
77
max: 3005
8+
sclk_offset: ~
9+
rdna4_sclk_offset_workaround: false
810
current_mclk_range:
911
min: 97
1012
max: 1250
@@ -14,6 +16,7 @@ od_range:
1416
sclk:
1517
min: 500
1618
max: 5000
19+
sclk_offset: ~
1720
mclk:
1821
min: 97
1922
max: 1500
@@ -22,4 +25,3 @@ od_range:
2225
- min: -450
2326
max: 0
2427
voltage_offset: ~
25-

0 commit comments

Comments
 (0)