()
| 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: |