7

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.

germanjke
  • 529
  • 1
  • 5
  • 13
  • Did you see this? https://stackoverflow.com/questions/63087188/can-you-run-google-colab-on-your-local-computer – Roman Czerwinski Apr 24 '21 at 15:29
  • yes but its didnt looks useful for me :( – germanjke Apr 24 '21 at 15:32
  • `302` means redirection for one addres to another - I see it always when I run in console on local computer because it redirects from `localhost` to `localhost/?token=...` – furas Apr 24 '21 at 18:43
  • I don't know if you can have both - local runtime/files and external hardware/GPU. When you connect from external `Colab` to local runtime then you have access to local files and local hardware. If you run local `jupyter lab` (instead of `jupyter notebook`) and you could connect to external runtime (on Google server) then you would have access to external files and external hardware. – furas Apr 24 '21 at 18:55
  • 1
    I think you get it wrong. `Colab` is only `GUI` which runs in web browser and on normal server, not on server with `GPU`, and it 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 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. – furas Apr 24 '21 at 19:38

1 Answers1

19

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

furas
  • 134,197
  • 12
  • 106
  • 148
  • I'm a little confused. Why there are 2 My computers? – Cyber Avater Mar 01 '22 at 14:49
  • 1
    @CyberAvater one shows that you can run it directly on local computer, other shows that you can use ssh to redirect to your server in Cloud and run on server. Maybe I should create third image which has green arrow only to second `my computer` – furas Mar 01 '22 at 17:53