Is it possible to create an image that has the Nvidia driver pre-installed?
Installing the nvidia GPU driver is effectively required for doing anything with a GPU instance, but needing to install it and reboot every time I create a new Linode adds several minutes to the setup process and makes scripting that process a bit more complicated. It'd be great to be able to create an image that has the driver pre-installed so that new Linodes are ready to go as soon as they boot.
The process I've tried is:
- Create a GPU instance
- Install the nvidia GPU driver
- Reboot, verify it works
- Create an image from that Linode
- Create a new GPU instance with that image
But after booting that instance, the driver seems broken. Running nvidia-smi fails with this error:
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.
apt says the driver is already installed, and I could uninstall and reinstall it and then reboot, but that completely defeats the point of making an image with the driver installed in the first place.
Has anybody successfully done this?
Yes, it definitely is possible. I think the issue you're running into is with the configuration profile of the Image when it is booted. By default, Images are booted with the latest Linode kernel. If you switch that to GRUB2 and boot up your instance, your driver should work as expected.
I tested this myself using a Community Stackscript to install the driver. Once I had the Image created and booted it using the upstream kernel, the
nvidia-smi command returned the same output it did in the origin instance.
It's worth noting that my Image was pretty large, roughly 17.5GB. With that in mind, you'd need to reach out to the Support Team in a ticket with details of your use case to request an increase in Image size limit since the default maximum size is 6GB.