We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 565e791 commit 2de0c82Copy full SHA for 2de0c82
kernel_tuner/observers/tegra.py
@@ -23,9 +23,16 @@ def __init__(self):
23
@staticmethod
24
def get_dev_path():
25
"""Get the path to device core clock control in /sys"""
26
- root_path = Path("/sys/devices/gpu.0")
27
- gpu_id = root_path.readlink()
28
- return root_path / Path("devfreq") / gpu_id
+ # loop to find GPU device name based on jetson_clocks
+ for dev in Path("/sys/class/devfreq").iterdir():
+ with open(dev / Path("device/of_node/name")) as fp:
29
+ name = fp.read().strip().rstrip("\x00")
30
+ if name in ("gv11b", "gp10b", "ga10b", "gpu"):
31
+ root_path = dev
32
+ break
33
+ else:
34
+ raise FileNotFoundError("No internal tegra GPU found")
35
+ return root_path
36
37
def _read_railgate_file(self):
38
"""Read railgate status"""
0 commit comments