From 83d705139c44dacedccbd55958afd557877a7e22 Mon Sep 17 00:00:00 2001 From: Joseph Melber Date: Thu, 24 Oct 2024 19:57:14 -0600 Subject: [PATCH] Try enabling run_on_npu2 --- .../passthrough_kernel/run_strix_makefile.lit | 2 +- programming_examples/lit.cfg.py | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/programming_examples/basic/passthrough_kernel/run_strix_makefile.lit b/programming_examples/basic/passthrough_kernel/run_strix_makefile.lit index 1818ba9813..81c8264aa0 100755 --- a/programming_examples/basic/passthrough_kernel/run_strix_makefile.lit +++ b/programming_examples/basic/passthrough_kernel/run_strix_makefile.lit @@ -5,6 +5,6 @@ // // RUN: make -f %S/Makefile clean // RUN: make -f %S/Makefile device=npu2 -// RUN: %run_on_npu make -f %S/Makefile run device=npu2 | FileCheck %s +// RUN: %run_on_npu2 make -f %S/Makefile run device=npu2 | FileCheck %s // CHECK: Running... // CHECK: PASS! diff --git a/programming_examples/lit.cfg.py b/programming_examples/lit.cfg.py index 97e1246045..2368b262ea 100755 --- a/programming_examples/lit.cfg.py +++ b/programming_examples/lit.cfg.py @@ -46,6 +46,7 @@ llvm_config.with_environment("PYTHONPATH", os.path.join(config.aie_obj_root, "python")) run_on_npu = "echo" +run_on_npu2 = "echo" xrt_flags = "" # Not using run_on_board anymore, need more specific per-platform commands @@ -131,18 +132,25 @@ 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-(npu\d))") + p = re.compile(r"[\|]?(\[.+:.+:.+\]).+(Phoenix|RyzenAI-(npu1\d))") + p2 = re.compile(r"[\|]?(\[.+:.+:.+\]).+(Phoenix|RyzenAI-(npu4\d))") for l in result: m = p.match(l) - if not m: + m2 = p2.match(l) + if not m and not m2: 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") - run_on_npu = ( - f"flock /tmp/npu.lock {config.aie_src_root}/utils/run_on_npu.sh" - ) + if m: + run_on_npu = ( + f"flock /tmp/npu.lock {config.aie_src_root}/utils/run_on_npu.sh" + ) + if m2: + run_on_npu2 = ( + f"flock /tmp/npu.lock {config.aie_src_root}/utils/run_on_npu.sh" + ) break except: print("Failed to run xrt-smi")