Skip to content

Instantly share code, notes, and snippets.

@jncsw
Created February 27, 2022 22:26
Show Gist options
  • Save jncsw/90feb59488e02801de3e1cfa50c0e636 to your computer and use it in GitHub Desktop.
Save jncsw/90feb59488e02801de3e1cfa50c0e636 to your computer and use it in GitHub Desktop.
watch nvidia-smi on windows
import subprocess
import os
import time
print(1)
while True:
# out_bytes = subprocess.check_output(['C:/Program Files/NVIDIA Corporation/NVSMI/nvidia-smi.exe'])
out_bytes = subprocess.check_output(['nvidia-smi'])
out_text = out_bytes.decode('utf-8')
os.system('cls')
print(out_text)
time.sleep(1)
@koyomitan3
Copy link

Lifesaver

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment