Use Google Colab GPU's and TPU's via an ssh connection locally in your device.
Installation is easy!
$ pip install VSColab
Using this package we can ssh into the Google Colab instance and also perform remote developement using VSCode.
GetSSH()
function automates the process of getting the Tunnel URL.
- Install the package
- Use the
Connect()
function to create an Ngrok tunnel, by passing a password string as a parameter. - Then Enter the Authentication Key (which can be obtained from:https://dashboard.ngrok.com/auth/your-authtoken) and press Enter.
- To get the ssh command, run the
GetSSH()
function. - Use the
VSconfig()
function to get the contents for the VSCode Config file, by passing the Tunnel URL (which can be obtained from theGetSSH()
function). - To kill the tunnel, use the
Kill()
function.
- First create a tunnel using the
Connect()
function. - Use the
VSconfig()
function to get the contents for the VSCode Config file, by passing the Tunnel URL (which can be obtained from theGetSSH()
function). - Then install the remote-ssh plugin in VSCode, and click the button at the bottom left corner.
- Then select the Open Configuration Files.. option and enter the copied text there.
- Then select the Connect to Host.. option and Enter the password when asked.
- Viola!! A fully functional Development environment powered by the GPU's and TPU's of Google Colab
If the command $ nvidia-smi
doesn't work in the ssh session, simply type :
export LD_PRELOAD=/usr/lib64-nvidia/libnvidia-ml.so
Then press Enter.