Platform: GCP ✅

Be sure to leave your terminal open when the command runs: if you close the connection, you won’t be able to access the notebook online.

Noob question, but how do I access the disk once it is attached? Like where is it in the file system?
Answer: https://devopscube.com/mount-extra-disks-on-google-cloud/

Currently the way they’ve set up the image doesn’t support “git pull”. I’m going to try to get that fixed. In the meantime, you have to clone yourself to get the most recent updates.

1 Like

Thanks for the great guide! Everything up and running over here…

This may be a paranoid question, but is it safe to use Google’s command-line utilities (gcloud) for accessing GCP? I wasn’t able to find any information about uninstallation on their site, and don’t know how much “reporting back home” is being done silently.

If any one faced issue in running the fastai like,

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-14-0dcb1b68c103> in <module>
----> 1 path = untar_data(URLs.PETS); path

NameError: name 'URLs' is not defined

Then we have to update the fast ai library.
conda update fastai -c fastai will probably help change version to 1.0.6.
This will also give some permission trouble.

Issue is, conda & related files are installed with owner & group as root. Your doesn’t have permission to update/create dir and it fails.

Following command will help to reach fastai 1.0.11.

sudo su
 cd /opt/anaconda3/bin/
 ls -l
 ./conda install anaconda -y
 ./conda update fastai -c fastai 
 ./conda update prompt_toolkit
1 Like

Hey! one can not attach a disk to 2 running instances as far as i know! You need to detach the disk from instance first to successfully attach it to other one.
command is “gcloud compute instances detach-disk INSTANCE_NAME --disk DISK_NAME”
Also i didnt remember this command i just did gcloud compute instances detach-disk --help and manual was opened. You can use this little trick next time. :slight_smile: Also if you dont remember the start of the command just write gcloud followed by 2 tabs and it will show you further available commands.

1 Like

how to download my saved csv file from GCP instance to my pc?

3 Likes

use this scp cmd, gcloud compute scp --recurse example-instance:~/narnia ~/wardrobe

see examples at https://cloud.google.com/sdk/gcloud/reference/compute/scp

from IPython.display import Filelink
Filelink(’/path/to/file’)

:wink:

3 Likes

It worked for me on Windows 7!

In summary, what I did differently from the tutorial is the following:

  • I replaced “step 2: Install Google CLI from the tutorial” with steps 1, 2 and 3 of the “Before you begin” section of Quickstart for Windows
  • Once the installation was done, in the Google Cloud SDK Shell I then picked my cloud project and then my default region (europe-west1-b in my case) as requested
  • To create an instance (step 3 of the tutorial), I simply typed the following command in the Google Cloud SDK Shell:

gcloud compute instances create “my-fastai-instance” --zone=“europe-west1-b” --image-family=“pytorch-1-0-cu92-experimental” --image-project=deeplearning-platform-release --maintenance-policy=TERMINATE --accelerator=“type=nvidia-tesla-p100,count=1” --machine-type=“n1-standard-8” --boot-disk-size=120GB --metadata=“install-nvidia-driver=True” --preemptible

Then I just followed the rest of the tutorial.

6 Likes

I’m really surprised how setup went smoothly. It took me around 10 minutes. I’ve used the guide completly (only altering location to EU).

3 Likes

Setup was real smooth for me too on Windows 10. Thanks for the excellent guide. Followed it exactly as it was it written.

2 Likes

Hmm I tried using attach-disk while both instances were stopped:

gcloud compute instances attach-disk "fastai-cpu" --disk "fastai-p100-gpu" --zone us-west1-b

However, this is the error that is given:

ERROR: (gcloud.compute.instances.attach-disk) Could not fetch resource:

  • The disk resource projects/.../disks/fastai-p100-gpu is already being used by projects/.../instances/fastai-p100-gpu

Am I missing something?

Hi @angert, actually i just updated my reply, please read it. The previous one was not complete. The error is because you didnt detach the disk. Also are you sure your external disk’s name is “fastai-p100-gpu” ? I think its the name of boot disk of your gpu-instance.

For a VA/DC resident, would it be ok to change the region/zone to us-east1-c? I originally was going to do us-east4, but didn’t seem to have GPU features, so decided the South Carolina region would be better. Or do you recommend us-west1-b even for us East Coasters?

Also, it never gave me the option to choose zone/region via command line for some reason…

Thanks!

When you do gcloud init, then you need to choose option 1[modify the default configuration]. then choose your account, followed by project. after that it asks for default region and zone.

1 Like

Makes sense, thanks! As for the region/zone, my understanding is that you want to pick a region/zone close to you for latency purposes. Is there something us-west1-b offers that us-east1-c doesn’t that I should opt for that data center, despite it being farther away?

just check if P100 and k80s are available in that region. sometimes pricing also differs!

1 Like

Is there terminal commands for starting and stopping the instances?

2 Likes