Skip to content

Instantly share code, notes, and snippets.

@korakot
Last active November 9, 2022 11:51
Show Gist options
  • Save korakot/1f014ddf6886ccefb4cabada4f3320cb to your computer and use it in GitHub Desktop.
Save korakot/1f014ddf6886ccefb4cabada4f3320cb to your computer and use it in GitHub Desktop.
Repeat reset until you get P100 GPU in Colab
# reset all จนกว่าจะได้ ดีกว่า K80
from IPython.display import HTML
from subprocess import getoutput
s = getoutput('nvidia-smi')
if 'K80' in s:
gpu = 'K80'
elif 'T4' in s:
gpu = 'T4'
elif 'P100' in s:
gpu = 'P100'
display(HTML(f"<h2>{gpu}</h2>"))
print(s)
# or simply
!nvidia-smi -L
@parth2134
Copy link

how to use it

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