Skip to content
This repository was archived by the owner on Nov 7, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/adjustor/fuse/gpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from typing import Literal, NamedTuple
from typing import Sequence

from adjustor.fuse.utils import find_igpu as find_amd_igpu
from adjustor.fuse.utils import find_amd_igpu

logger = logging.getLogger(__name__)
GPU_FREQUENCY_PATH = "device/pp_od_clk_voltage"
Expand Down
17 changes: 6 additions & 11 deletions src/adjustor/fuse/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,36 +10,31 @@
FUSE_MOUNT_SOCKET = "/run/hhd-tdp/socket"


def find_igpu():
def find_amd_igpu():
for hw in os.listdir("/sys/class/hwmon"):
if not hw.startswith("hwmon"):
continue
if not os.path.exists(f"/sys/class/hwmon/{hw}/name"):
continue
with open(f"/sys/class/hwmon/{hw}/name", 'r') as f:
with open(f"/sys/class/hwmon/{hw}/name", "r") as f:
if "amdgpu" not in f.read():
continue

if not os.path.exists(f"/sys/class/hwmon/{hw}/device"):
logger.error(f'No device symlink found for "{hw}"')
continue

if not os.path.exists(f"/sys/class/hwmon/{hw}/device/local_cpulist"):
logger.warning(
f'No local_cpulist found for "{hw}". Assuming it is a dedicated unit.'
)
continue

pth = os.path.realpath(os.path.join("/sys/class/hwmon", hw))
return pth
# This assume dGPU will come with VRAM vendor while iGPU will not
if not os.path.exists(f"/sys/class/hwmon/{hw}/device/mem_info_vram_vendor"):
return os.path.realpath(os.path.join("/sys/class/hwmon", hw))

logger.error("No iGPU found. Binding TDP attributes will not be possible.")
return None


def prepare_tdp_mount(debug: bool = False, passhtrough: bool = False):
try:
gpu = find_igpu()
gpu = find_amd_igpu()
logger.info(f"Found GPU at:\n'{gpu}'")
if not gpu:
return False
Expand Down