connect to local runtime via google colab with gpu

Viewed 8816

my goal is connect to goocle colab gpu from my local machine via jupyter notebook

done this things from documentation:

pip install jupyter_http_over_ws

jupyter serverextension enable --py jupyter_http_over_ws

opening jupyter with this command:

jupyter notebook --NotebookApp.allow_origin='https://colab.research.google.com' --port=8888 --NotebookApp.port_retries=0

after i'm connecting to colab with my url from terminal like this:

enter image description here

after this i've got this in my terminal

[I 18:12:04.374 NotebookApp] 302 GET /?token=HERE IS MY TOKEN (MY IP) 0.000000ms

actually idk what is 302 GET

finally, if i'm using os.getcwd() in Colab that shows me my LOCAL directory from my PC and print(torch.cuda.is_available()) is False

so i've connected to Colab from my machine, but goal is vice versa, to get GPU on my local machine. so maybe i'm doing something wrong.

1 Answers

I think you get it wrong.

Colab is only GUI which runs in web browser and on normal Google web server (with some access to Google Drive), not on special Google server with GPU.

Colab can connect to hosted runtime which means Google server (hardware) with GPU - and then you can directly access files on this server and you can run code on hardware with GPU.

Or it can connect to local runtime which means your local computer (hardware) without GPU - and then you can directly access local files and you can run code only on local hardware.

You don't have access to both runtimes (hardwares) at the same.


This is how I see it

Connect to Google Server with GPU/TPU:

enter image description here

Connect to Local Computer without GPU:

enter image description here

Related