Platform: Google Cloud Platform (GCP)

@pinaki should be fine - just pip install fastai2.

1 Like

Account is upgraded with a valid Credit card. Maybe this issue is specific to my account.
However, they specifically stated that the 300$ credit could not be used towards a GPU.

I’m fairly sure that’s wrong.

from GCP site:

so indeed free tier needs to be upgraded to paid account in order to use GPU!

You must upgrade to a paid account to use Google Cloud after the free trial ends. To take advantage of the features of a paid account (using GPUs, for example), you can upgrade before the trial ends. When you upgrade, the following conditions apply:

Any remaining, unexpired free trial credit remains in your account.
Your credit card on file is charged for resources you use in excess of what’s covered by any remaining credit.

2 Likes

Let me start over with a new account and I will report back.

1 Like

My experience on this matter is that GPU’s are allowed for free tier(credit card added). However, when you’re building a preemptible instance, your VM just does not start or it starts and by the time you SSH into it, it just stops. This was not my experience last year. I’ve not tried non-premptible instance yet. I’ll update once I try it.

It seems preemptible instances are not allowed on the free tier. Thanks to @Harvey for the info. Leaving a link from another thread.

1 Like

Yes @vijaysai, I was just about to report the exact same thing !
I will try a non pre-emptible instance

1 Like

Works with non preemptible instance
Just comment out --preemptible from the create instance command:

export IMAGE_FAMILY="pytorch-latest-gpu" # or "pytorch-latest-cpu" for non-GPU instances
export ZONE="us-west1-b"
export INSTANCE_NAME="my-fastai-instance"
export INSTANCE_TYPE="n1-highmem-8" # budget: "n1-highmem-4"

# budget: 'type=nvidia-tesla-k80,count=1'
gcloud compute instances create $INSTANCE_NAME \
        --zone=$ZONE \
        --image-family=$IMAGE_FAMILY \
        --image-project=deeplearning-platform-release \
        --maintenance-policy=TERMINATE \
        --accelerator="type=nvidia-tesla-p100,count=1" \
        --machine-type=$INSTANCE_TYPE \
        --boot-disk-size=200GB \
        --metadata="install-nvidia-driver=True" \
#        --preemptible

1 Like

Make sure you STOP your instance especially now that it seems only non preemptible instances work. Your are charged as long as the instance is running.
I find using the GOOGLE CLI is easier and safer for me than the GCP web console.
You can setup aliases in bash.

gcloud compute instances list

NAME ZONE MACHINE_TYPE PREEMPTIBLE INTERNAL_IP EXTERNAL_IP STATUS
fastai us-west1-b n1-highmem-8 1.1.1.1 TERMINATED

gcloud compute instances start fastai

No zone specified. Using zone [us-west1-b] for instance: [fastai].
Starting instance(s) fastai…done.
Updated [https://compute.googleapis.com/compute/v1/projects/eloquent-hold-271417/zones/us-west1-b/instances/fastai].
Instance internal IP is xxx
Instance external IP is xxx

gcloud compute instances list
NAME ZONE MACHINE_TYPE PREEMPTIBLE INTERNAL_IP EXTERNAL_IP STATUS
fastai us-west1-b n1-highmem-8 ### ### RUNNING

gcloud compute instances stop fastai

No zone specified. Using zone [us-west1-b] for instance: [fastai].
Stopping instance(s) fastai…done.
Updated [https://compute.googleapis.com/compute/v1/projects/eloquent-hold-271417/zones/us-west1-b/instances/fastai].

gcloud compute instances list
NAME ZONE MACHINE_TYPE PREEMPTIBLE INTERNAL_IP EXTERNAL_IP STATUS
fastai us-west1-b n1-highmem-8 ### TERMINATED

Always make sure the list command returns a TERMINATED status when you are done.

I’m having trouble getting off the ground with GCP on MacOS High Sierra, despite having successfully used it on several machines previously. When I attempt to run gcloud init, I get the following error: zsh: command not found: gcloud. Upon Googling, I found this page and I’ve tried adding the following to my .zshrc file:

# The next line updates PATH for the Google Cloud SDK.
source /Users/dwchiang/google-cloud-sdk/path.zsh.inc

# The next line enables zsh completion for gcloud.
source /Users/dwchiang/google-cloud-sdk/completion.zsh.inc

And the following to my path.zsh.inc file:

script_link="$( readlink "$0" )" || script_link="$0"
apparent_sdk_dir="${script_link%/*}"
if [ "$apparent_sdk_dir" == "$script_link" ]; then
  apparent_sdk_dir=.
fi
sdk_dir="$( cd -P "$apparent_sdk_dir" && pwd -P )"
bin_path="$sdk_dir/bin"
export PATH=$bin_path:$PATH

That didn’t work, so I tried another suggestion on the same page, which was to add gcloud to the list of plugins on my ~/.zshrc file, but this also hasn’t worked, and I’m still getting the same error.

I’d greatly appreciate any pointers!

I believe you haven’t installed the gcloud CLI for Mac correctly.

Try:
curl https://sdk.cloud.google.com | bash
exec -l $SHELL

And then try initializing it. Hopefully, that works!

2 Likes

Thanks! That looks like the same code in the tutorial Jeremy linked, which I used originally. I also tried copying and pasting from your post, and still have the same error.

Hi,

I need some help in trying to SCP some of the notebooks I have created while following along the fastai v2 docs on GCP.

It looks like the setup guide for GCP puts me on the jupyter instance where I have access to the tutorials and the gcloud ssh code puts me in a different place. So when I try to use the provided SCP command, I get an error saying the folder/file I’m trying to transfer doesn’t exist…

Thanks! :slight_smile:

If you want to clone course-v4 quickly without setting up ssh keys, you can use http instead as described in https://github.community/t5/How-to-use-Git-and-GitHub/why-is-public-key-needed-to-clone/m-p/38447. But will probably need to set that up anyway if you want to later push your work into your own remote repo.

You should run the commands with bash shell
switch your default shell to bash: https://www.howtogeek.com/444596/how-to-change-the-default-shell-to-bash-in-macos-catalina/

chsh -s /bin/bash
close and re open your terminal window

Then run
curl https://sdk.cloud.google.com | bash
exec -l $SHELL

1 Like

I’m avoiding the CLI by directly using the console.

You can spin up an instance using ai-platform notebooks.
https://console.cloud.google.com/ai-platform/notebooks/instances

I had to increase the GPU quota via
https://console.cloud.google.com/iam-admin/quotas

2 Likes

Thanks! I do like zsh, though, so I’m a bit loathe to switch. I think I’ve got everything set up in Colab instead, so I’ll stick with that for now.

1 Like

Dear all - I need some help!

My laptop OS is Ubuntu 16.04.6 LTS, and I’ve got a paid Google Cloud account which seems to be working fine (e.g. I have GPUs set up).

I’ve set up my instance (Step 3 in the fast.ai guide.)

I get errors when trying to set up ssh to Jupyter Notebook. I’ve tried to ssh into the instance without Jupyter too (i.e. gcloud compute ssh --project $PROJECT_NAME $INSTANCE_NAME ) but that gives errors too.

I’ve also noticed that in the console the VM instance has the “ssh” connection button greyed out, and the only option to connect is to use another ssh client. image

These are the errors I get. I’ve verified that the firewall and instance are set up to accept ssh traffic.

If I set up an instance directly in the console it works fine and I can ssh into console. But I’m not sure quite how to set up a VM in the console with the same specs as via the guide - I’ll try to figure this out as a next step I suppose.

Any help would be greatly appreciated. If I can’t get this to work, I’ll go back to using Kaggle which I set up really quickly to do last year’s version of the course.

When cloning the fastai v4 folder. I got the following error.

Warning: Permanently added the RSA host key for IP address ‘140.82.112.3’ to the list of known hosts.
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Does anyone know why that is the case? Thank you.

Try using http instead of ssh.