Last active
November 9, 2022 11:51
-
-
Save korakot/1f014ddf6886ccefb4cabada4f3320cb to your computer and use it in GitHub Desktop.
Repeat reset until you get P100 GPU in Colab
This file contains 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
# 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
how to use it