mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
tests: vfio: Capture guest dmesg when nvidia-smi failed
The guest dmesg can provide more context from the guest kernel, say Nvidia driver errors, IOMMU faults, etc. Signed-off-by: Bo Chen <bchen@crusoe.ai>
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user