Cloud Service >> Knowledgebase >> General >> Creating a VM Instance with Attached GPUs
submit query

Cut Hosting Costs! Submit Query Today!

Creating a VM Instance with Attached GPUs

VMs with connected GPUs are effective for Operations that consume a lot of computational resources for example, machine learning, scientific simulations, and video rendering.

 

This knowledge base guide will describe to you how it is possible to create a VM instance with attached GPUs using a CSP. Let’s get started!

 

Step 1: Choose Your Cloud Provider

Select a cloud service provider that offers GPU-enabled VM instances. Popular options include:

 

- Cyfuture Cloud

- Amazon Web Services (AWS)

- Google Cloud Platform (GCP)

- Microsoft Azure

 

This guide uses AWS as an example, but the steps are generally the same for any cloud hosting provider.

 

Step 2: Log In to Your Console

 

The first step is to open your preferred web browser and log in to the AWS Management Console. 

 

Step 3: Navigate to the EC2 Dashboard

 

Then, having logged in, go to the ‘Services’ tab located in the main window. Still under ‘Compute,’ choose “EC2” as it’s an acronym for Elastic Compute Cloud.

 

Step 4: A New Instance

Go to the EC2 Dashboard. There should be a button marked “Launch Instance” to launch instance creation.

 

Step 5: Choose an Amazon Machine Image (AMI)

Select an AMI that supports GPU acceleration. Look for AMIs with NVIDIA drivers pre-installed or those specifically designed for GPU workloads. You can find these in the AWS Marketplace or use Amazon's own GPU-optimized AMIs.

 

Step 6: Select an Instance Type

Choose an instance type with GPU support. Typically, these in AWS begin with "p" or "g" (p3.2xlarge, g4dn.xlarge, etc.). The decision is based on your financial situation and individual needs.

 

Step 7: Configure Instance Details

Set up the basic details of your instance:

- Number of instances

- Network settings

- Subnet preferences

- IAM role (if required)

- Shutdown behavior

- Enable termination protection (recommended)

 

Step 8: Add Storage

Specify the amount and type of storage you need. For GPU workloads, consider using SSD-based volumes for better performance.

 

Step 9: Add Tags (Optional)

To better manage and organize your materials, use tags. This is especially helpful if you're working in a group setting or managing several instances.

 

Step 10: Configure Security Group

Create a security group to manage traffic entering and leaving your instance. For remote management, at the very least, permit SSH access (port 22) from your IP address.

 

Step 11: Review and Launch

Review all your settings to ensure they're correct. If everything looks good, click the "Launch" button.

 

Step 12: Create or Select a Key Pair

Select an already-existing pair of keys or make a new one. This key pair is essential to safely get SSH access to your instance. The private key file (.pem) should be downloaded and stored in a secure location.

 

Step 13: Launch the Instance

Click "Launch Instances" to create your VM. AWS will now provision your GPU-enabled instance.

 

Step 14: Wait for Instance Initialization

It may take a few minutes for your instance to initialize. You can monitor its status in the EC2 Dashboard.

 

Step 15: Connect to Your Instance

Once the instance is running, you can connect to it:

1. In the EC2 Dashboard, select your instance and click "Connect"

2. Follow the instructions to connect via SSH using your key pair

 

Step 16: Verify GPU Attachment

After connecting, verify that the GPUs are properly attached and recognized:

1. Run the command: `nvidia-smi`

2. This should display information about the attached NVIDIA GPUs

 

Step 17: Install Necessary Software

Depending on your use case–you may need to install additional tools or frameworks (such as PyTorch, TensorFlow, or the CUDA toolkit). 

 

Step 18: Configure Your Environment

Set up your development environment, transfer necessary data, and configure any required settings for your GPU workload.

 

Troubleshooting:

- If `Nvidia-semi` doesn't work, ensure you've selected a GPU-enabled instance type and an appropriate AMI.

- Check the instance status checks in the EC2 Dashboard if you can't connect to your instance.

- Review the system logs for any error messages during startup.

Conclusion:

 

Creating a VM instance with attached GPUs allows you to harness significant computational power for demanding tasks. By following this guide, you should now have a functioning GPU-enabled VM instance ready for your specific workload. Remember to monitor your usage and costs, and always follow security best practices to protect your resources and data.

 

Cut Hosting Costs! Submit Query Today!

Grow With Us

Let’s talk about the future, and make it happen!