From 04707b09b7240e19039c991ffc6981335c649caa Mon Sep 17 00:00:00 2001 From: Yineng Zhang Date: Wed, 21 Aug 2024 02:14:51 +1000 Subject: [PATCH] misc: add hypervisor vendor (#1165) --- python/sglang/check_env.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/python/sglang/check_env.py b/python/sglang/check_env.py index cc8ba10e0..4db1f82fc 100644 --- a/python/sglang/check_env.py +++ b/python/sglang/check_env.py @@ -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