Created
February 27, 2022 22:26
-
-
Save jncsw/90feb59488e02801de3e1cfa50c0e636 to your computer and use it in GitHub Desktop.
watch nvidia-smi on windows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Lifesaver