Skip to content

Commit 07cb1e0

Browse files
Print system info for jetson
1 parent b5b47eb commit 07cb1e0

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

ci/system_info.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,35 @@ def _nvidia_smi_lines() -> List[str]:
160160
except (OSError, subprocess.SubprocessError, ValueError) as e:
161161
return [f'Failed to run nvidia-smi: {e}']
162162

163+
def _uname_lines() -> List[str]:
164+
try:
165+
result = subprocess.run(
166+
['uname', '-a'],
167+
check=False,
168+
capture_output=True,
169+
text=True,
170+
timeout=5,
171+
)
172+
if result.stdout:
173+
return [result.stdout.strip()]
174+
err = (result.stderr or '').strip()
175+
return [err or 'uname -a returned no output.']
176+
except subprocess.TimeoutExpired:
177+
return ['uname -a timed out.']
178+
except (OSError, subprocess.SubprocessError, ValueError) as e:
179+
return [f'Failed to run uname -a: {e}']
180+
181+
def _l4t_lines() -> List[str]:
182+
nv_path = '/etc/nv_tegra_release'
183+
if os.path.exists(nv_path):
184+
try:
185+
with open(nv_path, 'r', encoding='utf-8') as f:
186+
lines = [line.strip() for line in f if line.strip()]
187+
return lines if lines else [f'{nv_path} is present but empty.']
188+
except (OSError, IOError) as e:
189+
return [f'Found {nv_path} but failed to read: {e}']
190+
return [f'{nv_path} not present (likely non-Jetson).']
191+
163192
# System section
164193
os_info = _read_os_release() or {}
165194
pretty_name = os_info.get('PRETTY_NAME')
@@ -181,6 +210,10 @@ def _nvidia_smi_lines() -> List[str]:
181210
]
182211
_print_section('System Information', system_lines)
183212

213+
# Kernel / L4T sections
214+
_print_section('Kernel (uname -a)', _uname_lines())
215+
_print_section('Jetson L4T (nv_tegra_release)', _l4t_lines())
216+
184217
# Memory section
185218
_print_section('Memory', _memory_lines())
186219

0 commit comments

Comments
 (0)