Skip to content

Instantly share code, notes, and snippets.

@amrakm
Created October 4, 2022 22:04
Show Gist options
  • Save amrakm/2ac8d3bd5ca4fdcf4867e0985967cfc0 to your computer and use it in GitHub Desktop.
Save amrakm/2ac8d3bd5ca4fdcf4867e0985967cfc0 to your computer and use it in GitHub Desktop.
print_GPU_name_and_memory
#@markdown **NVIDIA GPU**
import subprocess
sub_p_res = subprocess.run(['nvidia-smi', '--query-gpu=name,memory.total,memory.free', '--format=csv,noheader'], stdout=subprocess.PIPE).stdout.decode('utf-8')
print(sub_p_res)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment