1. Install build-essential
$ apt-get update && apt-get install build-essential
2. Install linux-image-extra-virtual
$ sudo apt-get install linux-image-extra-virtual
This step is important for virtual system.
If this package is not installed, the error “Unable to load the kernel module ‘nvidia.ko’. ” will appear.
3. Download CUDA and install the package.
This step is same as installing on a normal PC.
4. Set LD_LIBRARY_PATH and test sample code.
Main reference:
http://docs.nvidia.com/cuda/cuda-getting-started-guide-for-linux/index.html
http://tleyden.github.io/blog/2014/10/25/cuda-6-dot-5-on-aws-gpu-instance-running-ubuntu-14-dot-04/