You need to start an instance and open the required port on Google Cloud. For detailed instructions, refer to this video. Additionally, ensure you increase the GPU quota to 1, as the default GPU quota on Google Cloud is set to 0.
I would recommend using the disk image Deep Learning on Linux -> Deep Learning VM with CUDA 12.4 M126.
Configure Jupyter notebook
There is a known issue with Jupyter Server under Anaconda. The easiest workaround is to downgrade jupyter-server as below.
pip install jupyter-server==1.24.0
We also need to generate a jupyter notebook configuration file for further configuration, run
jupyter notebook --generate-config
Create jupyter password
jupyter notebook password
Run Jupyter
jupyter notebook --ip=0.0.0.0 --no-browser
The default port is 8888. You should now be able to connect to the Jupyter Notebook locally. Assuming the external IP is 33.11.2.11, open your browser and navigate to:
http://33.11.2.11:8888
Enter the password you selected, and you can start creating a new notebook.
Make life easier
In .jupyter/jupyter_notebook_config.py, uncomment and change the following
- c.NotebookApp.ip = ‘0.0.0.0’
- c.NotebookApp.open_browser = False
- c.NotebookApp.port = 8888 # or something else if you want to use a different port. Remember to open the port through the firewall setting if you do so.
Then you can run jupyter notebook simply by
jupyter notebook
Update:
GPUs are often unavailable during weekdays. In such cases, you may want to provision a spot instance instead of a standard instance. Spot instances are slightly cheaper but may terminate unexpectedly, typically with a brief warning.
To allocate a spot instance, go to the instance creation page. In the left-hand panel, select Advanced, then locate the Provisioning model option and choose SPOT. Keep in mind that this choice is permanent, and you cannot switch back to a standard instance once selected. A possible strategy is to create both a standard and a spot instance, using the spot instance when the standard instance is unavailable.