Skip to content

Commit 740ed48

Browse files
hunhoffeclaude
andauthored
Propagate NPU2=1 into lit subprocesses on Strix (#3128)
Co-authored-by: Claude Opus 4 (1M context) <noreply@anthropic.com>
1 parent bc7a3e3 commit 740ed48

5 files changed

Lines changed: 16 additions & 0 deletions

File tree

programming_examples/lit.cfg.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
config.xrt_include_dir,
6363
config.xrt_bin_dir,
6464
config.aie_src_root,
65+
llvm_config,
6566
config.vitis_components,
6667
)
6768

programming_guide/lit.cfg.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
config.xrt_include_dir,
4545
config.xrt_bin_dir,
4646
config.aie_src_root,
47+
llvm_config,
4748
config.vitis_components,
4849
)
4950

python/aie_lit_utils/lit_config_helpers.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ def detect_xrt(
256256
xrt_include_dir: str,
257257
xrt_bin_dir: str,
258258
aie_src_root: str,
259+
llvm_config,
259260
vitis_components: Optional[List[str]] = None,
260261
) -> HardwareConfig:
261262
"""
@@ -409,6 +410,7 @@ def detect_xrt(
409410
)
410411
config.features.extend(["ryzen_ai", "ryzen_ai_npu2"])
411412
config.substitutions["%run_on_npu2%"] = run_on_npu2
413+
llvm_config.with_environment("NPU2", "1")
412414
logger.info(
413415
"Running tests on NPU2 with command line: %s", run_on_npu2
414416
)

test/lit.cfg.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
config.xrt_include_dir,
7171
config.xrt_bin_dir,
7272
config.aie_src_root,
73+
llvm_config,
7374
config.vitis_components,
7475
)
7576

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// (c) Copyright 2026 Advanced Micro Devices, Inc.
2+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3+
//
4+
// Regression: NPU2=1 must propagate from lit into test subprocesses on Strix
5+
// so Makefile-driven examples whose devicename defaults to
6+
// `$(if $(filter 1,$(NPU2)),npu2,npu)` pick the AIE2P target.
7+
//
8+
// REQUIRES: ryzen_ai_npu2
9+
//
10+
// RUN: %python -c "import os; print('NPU2=' + os.environ.get('NPU2','<unset>'))" | FileCheck %s
11+
// CHECK: NPU2=1

0 commit comments

Comments
 (0)