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 <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38322>
This commit is contained in:
Mel Henning 2025-11-07 18:15:32 -05:00 committed by Marge Bot
parent 31e47c178d
commit c33e278fc0

View file

@ -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]