Startup scripts allow you to configure and setup your instance, meaning automatically running scripts or installing software as soon as the instance has booted for the first time. 

We offer both, predefined installer scripts like the NVIDIA® GPU driver in the dashboard or the possibility to run any custom user-defined startup script via the API.

Let's first take one step back. When you create a new instance it contains all the software that comes with the image that you selected. For example in the case of Ubuntu 16 all the software that comes with a vanilla Ubuntu 16 installation.

For a lot of applications, especially GPU applications you will need additional software to be installed in order to successfully run those applications. 

For example, to install and run TensorFlow on an NVIDIA® GPU, you will also need an NVIDIA® GPU driver, NVIDIA® CUDA and of course installing TensorFlow itself. In order, to set up the most common types of software like the GPU driver, we will provide predefined startup scripts to make it easier to be up and running.

With startup scripts, you can inject a script that is automatically executed after the instance becomes active. Under the hood, it uses a mechanism called cloud-init and is also used to deploy your public SSH key on the instance. 

Please Note: The startup script is executed after the instance is booted and active, meaning if you log in to your instance the execution might still happen in the background. 

Please, don't snapshot, shutdown or restart your instance while a startup script is running

You can check the logs of your startup scripts via

journalctl | grep cloud-init

If your startup scripts have finished you will see the in last 2 lines of the logs something like this

Mär 12 12:47:06 julians-instance cloud-init[1891]: Cloud-init v. 19.4-33-gbb4131a2-0ubuntu1~16.04.1 running 'modules:final' at Thu, 12 Mar 2020 12:43:47 +0000. Up 33.96 seconds.
Mär 12 12:47:06 julians-instance cloud-init[1891]: Cloud-init v. 19.4-33-gbb4131a2-0ubuntu1~16.04.1 finished at Thu, 12 Mar 2020 12:47:06 +0000. Datasource DataSourceOpenStackLocal [net,ver=2].  Up 232.33 seconds

Installing the NVIDIA® GPU driver (version 418.56)

Please Note: Installing the driver will take about 4-5 minutes after the instance is active. This means in the first 4-5 minutes you will not be able to use the GPU. Please also don't snapshot or restart the instance during this time. This will fail the driver installation.

You can check if the NVIDIA driver installation already finished using the NVIDIA System Management Interface utility by running:


If the driver installation is not yet finished you will likely see error messages such: 

 -bash: nvidia-smi: command not found

Or later in the process:

NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

Once the installation successfully finished you should see a proper nvidia-smi response like this one.

Thu Mar 12 12:47:16 2020       
| NVIDIA-SMI 418.56       Driver Version: 418.56       CUDA Version: 10.1     |
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|   0  GeForce GTX 108...  Off  | 00000000:00:05.0 Off |                  N/A |
|  0%   16C    P0    53W / 250W |      0MiB / 11178MiB |      0%      Default |
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|  No running processes found                                                 |

Via the Compute Dashboard

In order to install the NVIDIA® GPU driver version 418.56 on your instance just select the checkbox from the Instance Configuration section. 

Via the public Compute API

In order to install the NVIDIA® GPU driver version 418.56 on your instance via the public Compute API you can pass the following shell script as startup_script in your create instance request.

"metadata": {
        "startup_script": "#!\/bin\/sh\r\nset -eux\r\n__nvidia_full_version=\"418_418.56-0ubuntu1\"\r\n__nvidia_short_version=\"418\"\r\nis_installed=false\r\nfor i in $(seq 1 5)\r\ndo\r\n  echo \"Connecting to http:\/\/ site for $i time\"\r\n  if curl -s --head  --request GET http:\/\/\/ubuntu\/pool\/restricted\/n\/nvidia-graphics-drivers-${__nvidia_short_version} | grep \"HTTP\/1.1\" > \/dev\/null ;\r\n  then\r\n      echo \"Connected to http:\/\/ Start downloading and installing the NVIDIA driver...\"\r\n      __tempdir=\"$(mktemp -d)\"\r\n      apt-get install -y --no-install-recommends \"linux-headers-$(uname -r)\" dkms\r\n      wget -P \"${__tempdir}\" http:\/\/\/ubuntu\/pool\/restricted\/n\/nvidia-graphics-drivers-${__nvidia_short_version}\/nvidia-kernel-common-${__nvidia_full_version}_amd64.deb\r\n      wget -P \"${__tempdir}\" http:\/\/\/ubuntu\/pool\/restricted\/n\/nvidia-graphics-drivers-${__nvidia_short_version}\/nvidia-kernel-source-${__nvidia_full_version}_amd64.deb\r\n      wget -P \"${__tempdir}\" http:\/\/\/ubuntu\/pool\/restricted\/n\/nvidia-graphics-drivers-${__nvidia_short_version}\/nvidia-dkms-${__nvidia_full_version}_amd64.deb\r\n      dpkg -i \"${__tempdir}\"\/nvidia-kernel-common-${__nvidia_full_version}_amd64.deb \"${__tempdir}\"\/nvidia-kernel-source-${__nvidia_full_version}_amd64.deb \"${__tempdir}\"\/nvidia-dkms-${__nvidia_full_version}_amd64.deb\r\n      wget -P \"${__tempdir}\" http:\/\/\/ubuntu\/pool\/restricted\/n\/nvidia-graphics-drivers-${__nvidia_short_version}\/nvidia-utils-${__nvidia_full_version}_amd64.deb\r\n      wget -P \"${__tempdir}\" http:\/\/\/ubuntu\/pool\/restricted\/n\/nvidia-graphics-drivers-${__nvidia_short_version}\/libnvidia-compute-${__nvidia_full_version}_amd64.deb\r\n      dpkg -i \"${__tempdir}\"\/nvidia-utils-${__nvidia_full_version}_amd64.deb \"${__tempdir}\"\/libnvidia-compute-${__nvidia_full_version}_amd64.deb\r\n      rmmod nouveau\r\n      modprobe nvidia\r\n      nvidia-smi\r\n      is_installed=true\r\n      rm -r \"${__tempdir}\"\r\n      break\r\n  fi\r\n  sleep 2\r\ndone\r\nif [ $is_installed = true ];\r\nthen\r\n  echo \"NVIDIA driver has been installed.\"\r\nelse\r\n  echo \"NVIDIA driver has NOT been installed. Because we can NOT reach to http:\/\/ site which hosted necessary deb packages for installation.\"\r\nfi"

Installing NVIDIA® CUDA

This feature is coming soon. Feel free to add or upvote on

Running custom startup scripts

This feature is coming soon. Feel free to add or upvote on