Creating a VM with a GPU 

We need to create a Google Compute Engine instance in order to be able to utilize GPUs on GCP.

You may need to increase your GPU quota.  To do so, you can follow the steps at the following URL:
https://cloud.google.com/compute/quotas#requesting_additional_quota

At the time of writing, the NVIDIA P4 GPU is the least expensive on the platform, and has ample power to demonstrate our work.  You can verify your quota by checking the NVIDIA P4 GPUs metric on the IAM Admin quotas page:

To do this, we can visit the VM instances page on the Google Cloud console. A screenshot of this page follows. Click on the Create button in the center of the screen:

We next create an Ubuntu 18.04 VM with a GPU attached. Our VM instance configuration for this example is shown in the following screenshot:

We are using Ubuntu 18.04 here as an example, rather than Fedora 29, to show how to set CUDA up for multiple architectures.

Our OS and other configuration parameters are shown in the following screenshot:

After we click the Create button, we are taken back to the VM instances page. Wait for your VM to be fully provisioned (it'll have a green checkmark to the left of its name):

Next, we can SSH to the instance, as seen in the following screenshot:

 

In the next subsections, we will install all the necessary dependencies for running our GPU enabled CGo program.  I've also included a script that performs all these actions at the end of the explanation for your convenience.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.129.148.210