The following guide shows you how to spawn a GPU-instance in skyhigh. There are GPU's available within some of our openstack-clouds, and access are given by request (we do not have GPU's for all projects unfortunatley).
GPU Flavors
Currently we have the following GPU's available in the different platforms
SkyHiGh
General purpose flavors, all IIK affiliates are eliginle (SFI NORCICS included)
Common for all of these flavors, is that ve have a very limited amount of physical GPUS available, so the total concurrent VMs we can run of each flavor is therefore also quite limited. There might be times where we have no free resources.
| Flavor | vCPUs | RAM | GPU | VRAM | Type | Comments |
|---|---|---|---|---|---|---|
| gx5.8c90r.v100-16g | 8 | 90GB | 1/2 of a Nvidia Tesla V100 | 16GB | VGPU / GRID | |
| gx5.16c180r.v100-16g | 16 | 180GB | 1/2 of a Nvidia Tesla V100 | 16GB | VGPU / GRID | |
| de3.24c120r.a100-20g | 24 | 120GB | 1/2 of a Nvidia Tesla A100 | 20GB | VGPU / GRID | |
| de3.48c240r.a100-40g | 48 | 240GB | 1/1 of a Nvidia Tesla A100 | 40GB | VGPU / GRID | Very limited amount of instances available |
| dx3.24c55r.p100 | 24 | 55GB | 1x Nvidia Tesla P100 | 16GB | PCI Passthrough | Max driver version: 580-series |
| dx3.48c110r.2p100 | 48 | 110GB | 2x Nvidia Tesla P100 | 2x16GB | PCI Passthrough | Max driver version: 580-series |
| dx4.24c110r.p100 | 24 | 110GB | 1x Nvidia Tesla P100 | 16GB | PCI Passthrough | Max driver version: 580-series |
| dx4.48c220r.2p100 | 48 | 220GB | 2x Nvidia Tesla P100 | 2x16GB | PCI Passthrough | Max driver version: 580-series |
Flavors only available for Norwegian Biometrics Lab
| Flavor | vCPUs | RAM | GPU | VRAM | Type | Comments |
|---|---|---|---|---|---|---|
| dx4.24c60r.p40-24g | 24 | 60GB | 1/1 of a Nvidia Tesla P40 | 24GB | VGPU / GRID | |
| de2.24c240r.a100-20g | 24 | 240GB | 1/2 of a Nvidia Tesla A100 | 20GB | VGPU / GRID | |
de3.24c120r.a100d-20g | 24 | 120GB | 1/4 of a Nvidia Tesla A100D | 20GB | VGPU / GRID | |
dx6.40c650r.l40s-48g | 40 | 650GB | 1/1 of a Nvidia Tesla L40s | 48GB | VGPU / GRID | Only available for the SALT project |
Flavors only available for the cPAID project
| Flavor | vCPUs | RAM | GPU | VRAM | Type | Comments |
|---|---|---|---|---|---|---|
| dx6.24c50r.l40s-24g | 24 | 50GB | 1/2 of a Nvidia Tesla L40s | 24GB | VGPU / GRID |
StackIT (NTNU IT's production platform)
| Flavor | vCPUs | RAM | GPU | VRAM | Type | Comments |
|---|---|---|---|---|---|---|
| gx3.20c64r.a40-16g | 20 | 64GB | 1/3 of a Nvidia Tesla A40 | 16GB | VGPU / GRID | |
| gx3.20c150r.a40-16g | 20 | 150GB | 1/3 of a Nvidia Tesla A40 | 16GB | VGPU / GRID | |
| ||||||
| gx4.96c340g.a100-40g | 96 | 340GB | 1/1 of a Nvidia Tesla A100 | 40GB | VGPU / GRID | Only available for the Kavli Institute |
| gx5.10c120r.a100d-80g | 10 | 120GB | 1/1 of a Nvidia Tesla A100D | 80GB | VGPU / GRID | Only available for the Indecol project |
| gx5.20c120r.a100d-80g | 20 | 120GB | 1/1 of a Nvidia Tesla A100D | 80GB | VGPU / GRID | Only available for the Indecol project |
| gx5.20c320r.a100d-40g | 20 | 320GB | 1/2 of a Nvidia Tesla A100D | 40GB | VGPU / GRID | Only available for the IEDL project |
| gx5.40c640r.a100d-40g | 40 | 640GB | 1/2 of a Nvidia Tesla A100D | 40GB | VGPU / GRID | Only available for the IEDL project |
| gx5.80c1280r.a100d-40g | 80 | 1.3TB | 1/2 of a Nvidia Tesla A100D | 40GB | VGPU / GRID | Only available for the IEDL project |
| gx5.88c1280r.a100d-80g | 88 | 1.3TB | 1/1 of a Nvidia Tesla A100D | 80GB | VGPU / GRID | Only available for the Indecol project |
| gx5.96c470r.a100d-80g | 96 | 470GB | 1/1 of a Nvidia Tesla A100D | 80GB | VGPU / GRID | Only available for the Indecol project |
SkyLow (IIK's development platform)
| Flavor | vCPUs | RAM | GPU | VRAM | Type | Comments |
|---|---|---|---|---|---|---|
| dx4.8c20r.m10-8G | 8 | 20GB | 1 core of a Nvidia Tesla M10 | 8GB | VGPU / GRID | The M10 has 4GPUs on a single PCB |
| gx3.12c30r.k80 | 12 | 30GB | 1x Nvidia Tesla K80 | 12GB | PCI Passthrough | Max driver version: TBA |
| gx3.24c60r.2k80 | 24 | 60GB | 2x Nvidia Tesla K80 | 2x12GB | PCI Passthrough | Max driver version: TBA |
PileIT (NTNU IT's development platform)
| Flavor | vCPUs | RAM | GPU | VRAM | Type | Comments |
|---|---|---|---|---|---|---|
| dx4.28c120r.a100-20g | 28 | 120GB | 1/2 of a Nvidia Tesla A100 | 20GB | VGPU / GRID | |
| dx2.6c50r.p100 | 6 | 50GB | 1x Nvidia Tesla P100 | 16GB | PCI Passthrough | Max driver version: 580-series |
| dx2.12c100r.2p100 | 12 | 100GB | 2x Nvidia Tesla P100 | 2x15GB | PCI Passthrough | Max driver version: 580-series |
Flavors with GPUs exposed with PCI Passthrough
For the few flavors that expose the GPU as PCI Passthrough, you specifically can not use our "GPU-enabled images" mentioned further down in this article. For these flavors, you can in theory boot whatever image you want, and you have to install the nvidia-driver, CUDA and cuDNN yourself.
GPU-enabled images
We provide an image with pre-installed Nvidia driver and CUDA package. This image contains the word "GRID" in its name and are a regular Ubuntu Server LTS image with the following additions:
- There is a script which installs the correct version of the Nvidia GRID driver at boot. After a driver-update on the hypervisor this script will also update the driver in the VM.
- The CUDA-tools and cuDNN are pre-installed.
The installation of the drivers requires a restart; so the newly created instance will reboot shortly after creation.
Starting a GPU-instance
To start a GPU-enabled instance you simply create a VM as you usually would, but make sure to select:
- a GPU-enabled flavor
- a GRID-enabled image (if your flavor is of type VGPU/GRID)
After creating the VM it will boot, install the GRID-driver, and then reboot. So, do not be supprised if you suddenly loose access to your freshly booted machine. It will come back!
It is vital that the VM uses the same driver as the hypervisor. If you update this driver your vGPU will cease to function. When the driver is updated on the hypervisor a new driver will also be installed in your VM.
CUDA-versions are somewhat tightly coupled with the driver version. The CUDA-version bundled with the image is proved working. You can therfore not expect that a newer CUDA-version would work, but it might be possible. Read the CUDA chapter below carefully
CUDA
Our GRID image comes with a pre-installed CUDA version from Nvidias apt-repo, that's the default version for the Nvidia driver we're currently using. That means that the image always has a known-to-be-working combinantion of a CUDA Toolkit and the Nvidia Driver. It might be possible to get a newer version working. Please consult the Nvidia CUDA Compatibility Matrix to check if your desired configuration is possible via a compat-package.
An example here could be: "The image has CUDA 12.2, and the R535 series Nvidia driver. I need CUDA 12.6". Referring to the compatibility matrix, this should be a compatible combination, and you can do:
sudo apt install cuda-toolkit-12-6 cuda-compat-12-6
Note that this will consume a fair amount of disk space, so check that you have at least 7-8GB of free space before you proceed. If anything works fine, it might also be wise to purge all the cuda-12-2 packages in this example.
The "nvidia-smi" command does not print the currently installed and/or "active" CUDA version. It just simply prints the default CUDA-version for the current driver. To check which CUDA version that's currently you default, run "nvcc -V".
If you get any errors similar to CUDA error: device kernel image is invalid when running CUDA code after installing a cuda-compat package, then try to do the following change.
# Edit the file /etc/profile.d/cuda.sh and add on the last line:
export LD_LIBRARY_PATH=/usr/local/cuda/compat${LD_LIBRARY_PATH:+:${LD_LIBRAY_PATH}}
# Save the file, log out of your VM and log back in. That should solve the issue.
cuDNN
libcudnn8 and libcudnn8-dev is pre-installed in our GRID image. Other versions are available from the Nvidia apt-repo which is also pre-configured in the image.
The info below is valid for VMs created before 31.10.2024
Many of our GPU users will probably need Nvidia's cuDNN library. This is not pre-installed in our image, because Nvidia requires all users to register for the Nvidia Developer Program before dowloading. So, please follow the instructions here, to install it on your VM; and use tar file options. DO NOT USE THE DEB OR RPM ALTERNATIVE. Be sure to download the cuDNN version that corresponds to our current CUDA version.
Verify the GPU instance
After installation the presence of a GPU can be verified with lspci:
ubuntu@gputest:~$ lspci | grep NVIDIA 00:05.0 3D controller: NVIDIA Corporation Device 20f1 (rev a1)
If you run a VGPU / GRID type VM - you can also verify that a license for the GPU is acquired successfully (yes, we need licences to use our GPUs...):
ubuntu@gputest:~$ journalctl -u nvidia-gridd | tail Sep 04 08:54:23 jammy-gpu systemd[1]: Starting NVIDIA Grid Daemon... Sep 04 08:54:24 jammy-gpu nvidia-gridd[724]: Started (724) Sep 04 08:54:24 jammy-gpu systemd[1]: Started NVIDIA Grid Daemon. Sep 04 08:54:24 jammy-gpu nvidia-gridd[724]: Configuration parameter ( ServerAddress ) not set Sep 04 08:54:24 jammy-gpu nvidia-gridd[724]: vGPU Software package (0) Sep 04 08:54:24 jammy-gpu nvidia-gridd[724]: Ignore service provider and node-locked licensing Sep 04 08:54:24 jammy-gpu nvidia-gridd[724]: NLS initialized Sep 04 08:54:24 jammy-gpu nvidia-gridd[724]: Acquiring license. (Info: nvidiadls02.it.ntnu.no; NVIDIA Virtual Compute Server) Sep 04 08:54:27 jammy-gpu nvidia-gridd[724]: License acquired successfully. (Info: nvidiadls02.it.ntnu.no, NVIDIA Virtual Compute Server; Expiry: 2023-9-5 8:54:16 GMT)
The "nvidia-smi" tool will show you the GPU status
ubuntu@gputest:~$ nvidia-smi
Mon Sep 4 08:58:11 2023
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 525.125.06 Driver Version: 525.125.06 CUDA Version: 12.0 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 GRID V100D-8C On | 00000000:00:05.0 Off | N/A |
| N/A N/A P0 N/A / N/A | 0MiB / 8192MiB | 0% Default |
| | | Disabled |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| No running processes found |
+-----------------------------------------------------------------------------+
Starting from CUDA 12.x, the samples are no longer included in the install packages. If you want to verify that the GPU/license works, you have to download them from github:
$ git clone https://github.com/NVIDIA/cuda-samples.git
And the you can compile and run a sample. For instance you could do like so:
ubuntu@jammy-gpu:~$ cd cuda-samples/Samples/1_Utilities/deviceQuery
ubuntu@jammy-gpu:~/cuda-samples/Samples/1_Utilities/deviceQuery$ make
... lots-of-text-from-make ...
ubuntu@jammy-gpu:~/cuda-samples/Samples/1_Utilities/deviceQuery$ ./deviceQuery
./deviceQuery Starting...
CUDA Device Query (Runtime API) version (CUDART static linking)
Detected 1 CUDA Capable device(s)
Device 0: "GRID V100D-8C"
CUDA Driver Version / Runtime Version 12.0 / 12.0
CUDA Capability Major/Minor version number: 7.0
Total amount of global memory: 8192 MBytes (8589934592 bytes)
(080) Multiprocessors, (064) CUDA Cores/MP: 5120 CUDA Cores
GPU Max Clock rate: 1380 MHz (1.38 GHz)
Memory Clock rate: 877 Mhz
Memory Bus Width: 4096-bit
L2 Cache Size: 6291456 bytes
Maximum Texture Dimension Size (x,y,z) 1D=(131072), 2D=(131072, 65536), 3D=(16384, 16384, 16384)
Maximum Layered 1D Texture Size, (num) layers 1D=(32768), 2048 layers
Maximum Layered 2D Texture Size, (num) layers 2D=(32768, 32768), 2048 layers
Total amount of constant memory: 65536 bytes
Total amount of shared memory per block: 49152 bytes
Total shared memory per multiprocessor: 98304 bytes
Total number of registers available per block: 65536
Warp size: 32
Maximum number of threads per multiprocessor: 2048
Maximum number of threads per block: 1024
Max dimension size of a thread block (x,y,z): (1024, 1024, 64)
Max dimension size of a grid size (x,y,z): (2147483647, 65535, 65535)
Maximum memory pitch: 2147483647 bytes
Texture alignment: 512 bytes
Concurrent copy and kernel execution: Yes with 7 copy engine(s)
Run time limit on kernels: No
Integrated GPU sharing Host Memory: No
Support host page-locked memory mapping: Yes
Alignment requirement for Surfaces: Yes
Device has ECC support: Disabled
Device supports Unified Addressing (UVA): Yes
Device supports Managed Memory: No
Device supports Compute Preemption: Yes
Supports Cooperative Kernel Launch: Yes
Supports MultiDevice Co-op Kernel Launch: Yes
Device PCI Domain ID / Bus ID / location ID: 0 / 0 / 5
Compute Mode:
< Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >
deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 12.0, CUDA Runtime Version = 12.0, NumDevs = 1
Result = PASS
If the output results in a "PASS" you should be fine. The GPU is then ready to use.
Using Docker
Our GPU-enabled VMs altso supports NVIDIA Container Toolkit in order to use docker with GPUs. Rule of thumb is to follow the current installation guide from NVIDIA. Don't bother with the driver pre-requsities. We have already sorted those out for you in our image. You will of course need to install docker before you begin. That part is also described in NVIDIA's documentation. We've summed up the commands below. The examples is for Ubuntu only.
Install docker
curl https://get.docker.com | sh && sudo systemctl --now enable docker
Install Nvidia Container Toolkit
# Enable the repositories
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
&& curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \
sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
# Install the package
sudo apt update && sudo apt -y install nvidia-docker2
# Restart the docker daemon
sudo systemctl restart docker
# Run a test to verifiy that it works
sudo docker run --rm --gpus all nvidia/cuda:12.9.1-cudnn-runtime-ubuntu24.04 nvidia-smi
# Optionally run a test with Tensorflow that actually runs a bit of code on the GPU via docker
sudo docker run --gpus all -it --rm tensorflow/tensorflow:2.14.0-gpu \
python -c "import tensorflow as tf; print(tf.reduce_sum(tf.random.normal([1000, 1000])))"