Run AllenNLP on AWS P2 with ArchLinux
- DISCLAIMER
-
uplinklabs discontinued support for EC2, so this blog post will probably stop working in the future!
Quest: Run AllenNLP with GPU support on an AWS p2/p3 instances with ArchLinux.
Steps:
Go to https://www.uplinklabs.net/projects/arch-linux-on-ec2/
Start a new EC2 instance by clicking on the "ebs hvm x86_64 lts"-link for your preferred region.
Choose
p2.xlarge
as instance type (all other p2 and p3 will work the same)Configure the stuff you need (allow ssh, storage, ...)
Launch instance (save the pem-certificate!)
Get the IP address from the ec2 instances view
Connect to server
Yay! We have a shell on archlinux.
First you may have to repopulate the archlinux-keyring
Next update the already installed packages
Install a few packages (we need
nvidia-dkms
and notnvidia
because the kernel is a custom one and not default archlinux)
Reboot server to load new kernel with nvidia module
After the reboot, connect to server again
Test if nvidia module is loaded
Add virtualenvwrapper to your shell
And create a virtualenv
Install
allennlp
And test if PyTorch/AllenNLP finds the gpu
(Optional) run the AllenNLP testsuite
Now you can use AllenNLP with GPU on AWS!