Created
December 11, 2023 10:34
-
-
Save cvramanan/8fa21e55f5415a9a0eccc92b4febbe4e to your computer and use it in GitHub Desktop.
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 time | |
| cmd = [ 'nvidia-smi', '--query-gpu=utilization.gpu,utilization.memory', '--format=csv' ] | |
| while True: | |
| time.sleep(1) | |
| output = subprocess.Popen( cmd, stdout=subprocess.PIPE ).communicate()[0] | |
| print(output.decode('utf-8').strip()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment