Skip to content

Commit

Permalink
Fixup lit cfg
Browse files Browse the repository at this point in the history
  • Loading branch information
jgmelber committed Oct 25, 2024
1 parent 6ea15fa commit d1f543f
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions programming_examples/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,22 +132,20 @@
result = result.stdout.decode("utf-8").split("\n")
# Starting with Linux 6.8 the format is like "[0000:66:00.1] : RyzenAI-npu1"
# Starting with Linux 6.10 the format is like "|[0000:41:00.1] ||RyzenAI-npu1 |"
p = re.compile(r"[\|]?(\[.+:.+:.+\]).+(Phoenix|RyzenAI-(npu1\d))")
p2 = re.compile(r"[\|]?(\[.+:.+:.+\]).+(Phoenix|RyzenAI-(npu4\d))")
p = re.compile(r"[\|]?(\[.+:.+:.+\]).+(Phoenix|RyzenAI-(npu\d))")
for l in result:
m = p.match(l)
m2 = p2.match(l)
if not m and not m2:
if not m:
continue
print("Found Ryzen AI device:", m.group(1))
if len(m.groups()) == 3:
print("\tmodel:", m.group(3))
config.available_features.add("ryzen_ai")
if m:
if m.group(3) == "npu1":
run_on_npu = (
f"flock /tmp/npu.lock {config.aie_src_root}/utils/run_on_npu.sh"
)
if m2:
if m.group(3) == "npu4":
run_on_npu2 = (
f"flock /tmp/npu.lock {config.aie_src_root}/utils/run_on_npu.sh"
)
Expand Down

0 comments on commit d1f543f

Please sign in to comment.