Skip to content

Commit dc96fd5

Browse files
authored
[Misc] Avoid stripping meaningful whitespace from nvidia-smi topo -m output in collect_env.py (#16272)
Signed-off-by: imkero <[email protected]>
1 parent 1f5d13a commit dc96fd5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

collect_env.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,14 @@ def run(command):
105105
else:
106106
enc = locale.getpreferredencoding()
107107
output = raw_output.decode(enc)
108+
if command == 'nvidia-smi topo -m':
109+
# don't remove the leading whitespace of `nvidia-smi topo -m`
110+
# because they are meaningful
111+
output = output.rstrip()
112+
else:
113+
output = output.strip()
108114
err = raw_err.decode(enc)
109-
return rc, output.strip(), err.strip()
115+
return rc, output, err.strip()
110116

111117

112118
def run_and_read_all(run_lambda, command):

0 commit comments

Comments
 (0)