misc: add hypervisor vendor (#1165)

This commit is contained in:
Yineng Zhang
2024-08-21 02:14:51 +10:00
committed by GitHub
parent ff2cfdb1a2
commit 04707b09b7

View File

@@ -170,6 +170,17 @@ def get_gpu_topology():
return None
def get_hypervisor_vendor():
try:
output = subprocess.check_output(["lscpu"], text=True)
for line in output.split("\n"):
if "Hypervisor vendor:" in line:
return line.split(":")[1].strip()
return None
except:
return None
def check_env():
"""
Check and print environment information.
@@ -184,6 +195,10 @@ def check_env():
if gpu_topo:
env_info["NVIDIA Topology"] = gpu_topo
hypervisor_vendor = get_hypervisor_vendor()
if hypervisor_vendor:
env_info["Hypervisor vendor"] = hypervisor_vendor
ulimit_soft, _ = resource.getrlimit(resource.RLIMIT_NOFILE)
env_info["ulimit soft"] = ulimit_soft