From c33e278fc0419354bb32551befadc24f9e7309ff Mon Sep 17 00:00:00 2001 From: Mel Henning Date: Fri, 7 Nov 2025 18:15:32 -0500 Subject: [PATCH] nak/nvdisasm_tests: Skip SM70 on cuda 13 cuda 13 drops support for sm70, including nvdisasm support. This matches the default sm list to the detected nvdisasm version. Reviewed-by: Mary Guillemard Part-of: --- src/nouveau/compiler/nak/nvdisasm_tests.rs | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/nouveau/compiler/nak/nvdisasm_tests.rs b/src/nouveau/compiler/nak/nvdisasm_tests.rs index e2e9fa021da..cb7e9ad2ddc 100644 --- a/src/nouveau/compiler/nak/nvdisasm_tests.rs +++ b/src/nouveau/compiler/nak/nvdisasm_tests.rs @@ -11,6 +11,7 @@ use std::process; use std::process::Command; use std::slice; use std::sync::atomic::AtomicUsize; +use std::sync::OnceLock; static FILE_NUM: AtomicUsize = AtomicUsize::new(0); @@ -158,8 +159,27 @@ impl DisasmCheck { } } +static SM_LIST_CELL: OnceLock<&'static [u8]> = OnceLock::new(); + fn sm_list() -> &'static [u8] { - &[70, 75, 80, 86, 89, 90, 100, 120] + SM_LIST_CELL.get_or_init(|| { + let out = Command::new("nvdisasm") + .arg("--version") + .output() + .expect("failed to execute process"); + + std::io::stderr().write_all(&out.stderr).expect("IO error"); + assert!(out.status.success()); + let stdout = std::str::from_utf8(&out.stdout).unwrap(); + + if stdout.find("cuda_12").is_some() { + &[70, 75, 80, 86, 89, 90, 100, 120] + } else if stdout.find("cuda_13").is_some() { + &[75, 80, 86, 89, 90, 100, 120] + } else { + panic!("Unknown nvdisasm version. stdout: {stdout}"); + } + }) } #[test]