Google Cloud Platform

(Rachel) #1


I am following the guidance here:

Is anyone else having quota problems with GCP when trying to set up an instance?

$export IMAGE_FAMILY=“pytorch-latest-gpu”
$export ZONE=“us-west2-b”
$export INSTANCE_NAME=“my-fastai-instance”
$export INSTANCE_TYPE=“n1-highmem-8”
$gcloud compute instances create $INSTANCE_NAME

I receive this error in return:

ERROR: (gcloud.compute.instances.create) Could not fetch resource:- Quota ‘GPUS_ALL_REGIONS’ exceeded. Limit: 0.0 globally.

What quota do I change on the free account in ‘IAM and accounts’ > ‘Quotas’? I would like to have Standard Compute + Storage

I have linked my billing account to the project.

Thank you for any advice in advance.



(Alexander Zehetmaier) #2

Hey I have a similar problem … I thought it doesn’t work since I am from Europe and I need a different zone.

Following it says:
ERROR: (gcloud.compute.instances.create) Could not fetch resource:

  • Invalid value ‘“europe-west4-a“’. Values must match the following regular expression: ‘[a-z] (?:[-a-z0-9]{0,61}[a-z0-9])?’

(Jeremy Howard (Admin)) #3

Please use the appropriate topic:

1 Like

(Hoxie Ackerman) #4

Hey, @datalass1.

I’m just getting started with Part 1 2019 using GCP myself, and I ran into the same error message about “Quota ‘GPUS_ALL_REGIONS’ exceeded. Limit: 0.0 globally.” while following the setup directions you posted.

A little Googling turned up this suggestion. I followed the instructions in the only answer posted, and by setting the filter (1) and then “EDIT QUOTAS” (2), I was able to submit a request to increase my GPU count from 0 to 1.

My request hasn’t been approved yet, but it seems like it has potential :crossed_fingers:

1 Like

(Hoxie Ackerman) #5

Just a quick update: I received a couple of emails from Google Cloud Support between yesterday and today, giving me periodic updates about their review of my request. About 24 hours after my request was submitted, I received an email saying that my request had been approved.

When I reran the code in the (setup instructions)[], my instance was created without any issues or error messages.

I also notice that this exact workaround is provided in the Google Cloud Platform instructions. (Looks like they were added yesterday.) Awesome :+1:


(Rachel) #6

Thank you @hoxie this was exactly what I needed to do and I can now ssh to GCP. I’m enjoying my free credits and hope you do too!


(Arsalan Gundroo) #7

Hi, how much time did it take for your request to get approved?


(Bernd Heidemann) #8

In my case, a few hours.


(Robert Bracco) #9

A trick that most of you know about but maybe some windows users don’t, is that you can create an alias for the start command (it’s really long) so that you dont have to type or copy paste each time

gcloud compute ssh --zone=$ZONE jupyter@$INSTANCE_NAME -- -L 8080:localhost:8080

In ubuntu, go to your home folder (cd ~) and you should have a .bashrc file, it’s hidden so ls won’t show it but you can see it with ls -a. Then open it in an editor, I prefer nano so

nano .bashrc then scroll to the bottom and add the line
alias gc='gcloud compute ssh --zone=$ZONE jupyter@$INSTANCE_NAME -- -L 8080:localhost:8080'
filling in your own details.

Save and exit to terminal and enter source .bashrc to load the changes. Then all you need to do to connect to your instance is type gc!

Steps without text

  1. cd ~
  2. nano .bashrc
  3. Add alias gc='gcloud compute ssh --zone=$ZONE jupyter@$INSTANCE_NAME -- -L 8080:localhost:8080' with your details at the bottom of file
  4. Save and exit
  5. source .bashrc
  6. Type gc to start instance

Hope this helps


(Christian Olivo) #11

First, thanks for posting this. I followed your instructions; however it gives me this:

I saved it pushing: Ctrl + x
then, it asked me to save it in: .bashrc and i just hit enter
but then i go back and it showed me what is on the picture and it stays there. When i type the whole command, it works; but just typing ‘gc’ doesn’t.


(Robert Bracco) #12

Hey Christian, sorry it isn’t working. Can you post the exact line you put in your .bashrc file? To save make sure you type ‘y’ then enter. Did you make sure to refresh it by running source .bashrc? Here’s my exact line, looks like we chose the same instance name haha.

alias gc='gcloud compute ssh --zone=us-west2-b jupyter@my-fastai-instance -- -L 8080:localhost:8080'

Post more details and we’ll get it figured out. It’s a huge time saver so worth any trouble imo.

1 Like

(Christian Olivo) #13

Thanks for the willingness to help out. I figure it out after some tries. Your documentation is well done. The only thing that i was doing wrong is putting a space like this between the ‘’=" sign:

alias gc = 'gcloud…

I fixed it by having no space in between like is in your post:

alias gc='gcloud…

Now it’s working. Thanks for this time saver!


(Shruti Mittal) #14

I have my data stored in google drive, how can I access this file in GCP?

[EDIT] I tried wget

This downloads the data to the VM, however, I didn’t want to DOWNLOAD the data but to simply access the google drive via VM.