Skip to content

Instantly share code, notes, and snippets.

View phimachine's full-sized avatar
🎯
Focusing

Jason phimachine

🎯
Focusing
View GitHub Profile
@phimachine
phimachine / parse_nvidia_smi.py
Created August 7, 2020 06:15 — forked from telegraphic/parse_nvidia_smi.py
Parse nvidia-smi from python
"""
Parse output of nvidia-smi into a python dictionary.
This is very basic!
"""
import subprocess
import pprint
sp = subprocess.Popen(['nvidia-smi', '-q'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)