Using a pre-built public AMI
Based on the instructions in this blog post, I’ve created an AMI and shared it publicly. So the easiest thing to do is just use that pre-built AMI:
- Image: ami-2cbf3e44 for US-East or ami-c38babf3 for US-West (Ubuntu Server 14.04 LTS (HVM) – CUDA 6.5)
- Instance type: g2.2xlarge (if you skip this step, you won’t have an nvidia device)
- Storage: Use at least 8 GB, 20+ GB recommended
If you use the pre-built AMI, then you can skip down to the Verify CUDA is correctly installed section, since all of the rest of the steps are “baked in” to the AMI.
Note regarding AMI regions: the AMI only currently works in the US-East and US-West regions. If you need it added to another region, please post a comment below
Building from scratch
Or if you prefer to build your own instance from scratch, keep reading.
Create a new EC2 instance:
- Image: ami-9eaa1cf6 (Ubuntu Server 14.04 LTS (HVM), SSD Volume Type)
- Instance type: g2.2xlarge
- Storage: Use at least 8 GB, 20+ GB recommended
Install build-essential:
1
|
|
Get CUDA installer:
1
|
|
Extract CUDA installer:
1 2 3 |
|
Run Nvidia driver installer:
1 2 |
|
At this point it will popup an 8-bit UI that will ask you to accept a license agreement, and then start installing.
At this point, I got an error:
1 2 3 4 5 6 7 |
|
After reading this forum post I installed:
1
|
|
When it prompted me what do to about the grub changes, I chose “choose package maintainers version”.
Reboot:
1
|
|
Disable nouveau
At this point you need to disable nouveau, since it conflicts with the nvidia kernel module.
Open a new file
1
|
|
and add these lines to it
1 2 3 4 5 |
|
and then save the file.
Disable the Kernel Nouveau:
1
|
|
Reboot:
1 2 |
|
One more try — this time it works
Get Kernel source:
1 2 |
|
Rerun Nvidia driver installer:
1 2 |
|
Load nvidia kernel module:
1
|
|
Run CUDA + samples installer:
1 2 |
|
Verify CUDA is correctly installed
1 2 3 |
|
You should see the following output:
1 2 |
|
References
- http://www.r-tutor.com/gpu-computing/cuda-installation/cuda6.5-ubuntu
- http://askubuntu.com/questions/451672/installing-and-testing-cuda-in-ubuntu-14-04
- https://devtalk.nvidia.com/default/topic/547588/error-installing-nvidia-drivers-on-x86_64-amazon-ec2-gpu-cluster-t20-gpu-/
- https://devtalk.nvidia.com/default/topic/769719/drm-ko-missing-on-ubuntu-14-04-1-lts-aws-ec2-g2-2xlarge-instance/
- http://askubuntu.com/questions/451221/ubuntu-14-04-install-nvidia-driver