MCPcopy
hub / github.com/InternLM/lmdeploy / get_gpu_topo

Method get_gpu_topo

lmdeploy/cli/cli.py:127–143  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

125 env_info[req] = 'Not Found'
126
127 def get_gpu_topo():
128 import subprocess
129 import sys
130 if sys.platform.startswith('linux'):
131 try:
132 res = subprocess.run(['nvidia-smi', 'topo', '-m'],
133 capture_output=True,
134 text=True,
135 check=True)
136 if res.returncode == 0:
137 return '\n' + res.stdout
138 else:
139 return None
140 except FileNotFoundError:
141 return None
142 else:
143 return None
144
145 gpu_topo = get_gpu_topo()
146 if gpu_topo is not None:

Callers

nothing calls this directly

Calls 1

runMethod · 0.80

Tested by

no test coverage detected