Skip to content
This repository has been archived by the owner on Jul 21, 2020. It is now read-only.

Fix file not found error #80

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
21 changes: 11 additions & 10 deletions WattmanGTK/wattman.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,16 +147,17 @@ def main():

hwmondir = '/sys/class/hwmon/'
for i,folder in enumerate(os.listdir(hwmondir)):
if open(hwmondir + folder + '/name').readline().rstrip() == 'amdgpu':
print(f"amdgpu card found in {hwmondir}{folder} hwmon folder")
print("Checking which device this hwmon path belongs to")
for card in GPUs:
if str(Path(f"{hwmondir}{folder}/device").resolve()) == card.cardpath:
print(f"{hwmondir}{folder} belongs to {card.cardpath} ({card.fancyname})")
card.hwmonpath = hwmondir + folder
card.sensors = card.init_sensors()
card.get_states()
break
if os.system("[ -e " + hwmondir + folder + '/name' + " ]") == 0:
if open(hwmondir + folder + '/name').readline().rstrip() == 'amdgpu':
print(f"amdgpu card found in {hwmondir}{folder} hwmon folder")
print("Checking which device this hwmon path belongs to")
for card in GPUs:
if str(Path(f"{hwmondir}{folder}/device").resolve()) == card.cardpath:
print(f"{hwmondir}{folder} belongs to {card.cardpath} ({card.fancyname})")
card.hwmonpath = hwmondir + folder
card.sensors = card.init_sensors()
card.get_states()
break

# Initialise and present GUI
builder = Gtk.Builder()
Expand Down