Intel® Developer Cloud
Help connecting to or getting started on Intel® Developer Cloud
132 Discussions

Inquiry Regarding GPU Availability on Free IDC Instances for Student Ambassador

barzamini
Beginner
246 Views

Hi everyone,

I hope you're all doing well. As a newbie Student Ambassador (SA), I've recently been granted access to a free IDC instance as part of our program. Excited to dive in, I attempted to run a few examples from the Intel oneAPI repository to get a feel for how things work.

Since my main goal is to develop code using PyTorch, I decided to explore the ResNet50_Inference example, which utilizes PyTorch. However, upon running the notebook, I encountered an issue. It seems that when attempting to set up the Python environment for both CPU and GPU, I encountered an error specifically related to the GPU:

 

/glob/intel-python/versions/2018u2/intelpython2/etc/profile.d/conda.sh: /glob/intel-python/versions/2018u2/intelpython2/bin/conda: /glob/intel-python/versions/2018u2/intelpython2/bin/python: bad interpreter: No such file or directory

 

I do not have any idea how to fix this issue, and I'm uncertain whether this free instance supports GPU usage or not.

 lspci | grep -i vga 
02:00.0 VGA compatible controller: ASPEED Technology, Inc. ASPEED Graphics Family (rev 41)

Additionally, in JupyterLab, after selecting the PyTorch kernel, I checked for GPU availability using the following code, which returned:

import torch

# Check if CUDA (GPU support) is available
if torch.cuda.is_available():
    # If CUDA is available, use the GPU
    device = torch.device("cuda")
    print("CUDA is available. Using GPU...")
else:
    # If CUDA is not available, fall back to CPU
    device = torch.device("cpu")
    print("CUDA is not available. Using CPU...")

# Create tensors on the chosen device
x = torch.randn(3, 3).to(device)
y = torch.randn(3, 3).to(device)

# Perform some tensor operations on GPU
z = x.mm(y)

print("Result tensor z computed on device:", z.device)
CUDA is not available. Using CPU...
Result tensor z computed on device: cpu

Could you please help me with the following questions:

  1. Do the free instances provided come with GPUs?

  2. If yes, how can I utilize the GPU with PyTorch?


Your assistance would be greatly appreciated.

Labels (3)
0 Kudos
1 Solution
Megat_Intel
Moderator
201 Views

Hi Barzamini,

Thank you for reaching out to us.

 

Are you using the JupyterLab IDC instance in the IDC Training section? For your information, the JupyterLab instance has GPU devices that can be used to run inferences.

 

You can check the GPU details by opening a new notebook and selecting the pytorch-gpu kernel. Then run the code below:

import torch
import intel_extension_for_pytorch as ipex
print(ipex.__version__)
[print(f'[{i}]: {torch.xpu.get_device_properties(i)}') for i in range(torch.xpu.device_count())];

 

It should display the Intel® Data Center GPU Max 1100 details. To use Intel® GPU with PyTorch, you need to use the Intel® Extension for PyTorch. You can check out the Intel® Extension for PyTorch* with Intel GPU examples for Resnet50 for more information.

 

On the other hand, you can also refer to our Text-to-Image with Stable Diffusion training for reference on how to run the GPU with Pytorch through the PyTorch xpu device. Hope this helps.

 

 

Regards,

Megat

View solution in original post

0 Kudos
2 Replies
Megat_Intel
Moderator
202 Views

Hi Barzamini,

Thank you for reaching out to us.

 

Are you using the JupyterLab IDC instance in the IDC Training section? For your information, the JupyterLab instance has GPU devices that can be used to run inferences.

 

You can check the GPU details by opening a new notebook and selecting the pytorch-gpu kernel. Then run the code below:

import torch
import intel_extension_for_pytorch as ipex
print(ipex.__version__)
[print(f'[{i}]: {torch.xpu.get_device_properties(i)}') for i in range(torch.xpu.device_count())];

 

It should display the Intel® Data Center GPU Max 1100 details. To use Intel® GPU with PyTorch, you need to use the Intel® Extension for PyTorch. You can check out the Intel® Extension for PyTorch* with Intel GPU examples for Resnet50 for more information.

 

On the other hand, you can also refer to our Text-to-Image with Stable Diffusion training for reference on how to run the GPU with Pytorch through the PyTorch xpu device. Hope this helps.

 

 

Regards,

Megat

0 Kudos
Megat_Intel
Moderator
47 Views

Hi Barzamini,

Thank you for your question. This thread will no longer be monitored since this issue has been resolved. If you need additional information from Intel, please submit a new question.

 

 

Regards,

Megat


0 Kudos
Reply