diff --git a/test_infra/src/lib.rs b/test_infra/src/lib.rs index 248e4efa3..47d022cd6 100644 --- a/test_infra/src/lib.rs +++ b/test_infra/src/lib.rs @@ -1316,11 +1316,18 @@ impl Guest { #[cfg(target_arch = "x86_64")] pub fn check_nvidia_gpu(&self) { - assert!( - self.ssh_command("nvidia-smi") - .unwrap() - .contains("NVIDIA L40S") - ); + let output = self.ssh_command("nvidia-smi").unwrap(); + if !output.contains("NVIDIA L40S") { + let dmesg = self + .ssh_command("sudo dmesg") + .unwrap_or_else(|e| format!("Failed to get dmesg: {e:?}")); + eprintln!( + "\n\n==== Guest dmesg (nvidia-smi check failed) ====\n\n\ + {dmesg}\n\ + \n==== End guest dmesg ====\n\n" + ); + panic!("nvidia-smi output did not contain 'NVIDIA L40S': {output}"); + } } pub fn reboot_linux(&self, current_reboot_count: u32) {