Documentation of Setting Up EC2 Instance

- How to set EC2 virtual environment *(WARNING: Don’t follow course.fastai.ec2 setup instructions)*

1) Create EC2 instance with g4dn.xlarge by selecting options

2) Remember to use ubuntu version 20.4 not 22.0 because of dependency issues

3) Don’t delete your key pair which you have chosed for particular instance in your local machine

4) So your instance is ready

5) Remember selecting at least 100 GB volume while creating instance

6) You have started the amazon server in your terminal by doing ssh -i <name of pm file> ubuntu @ <public ipv4 dns >

7) Do the following in terminal :

sudo apt update && sudo apt -y install git

git clone https://github.com/fastai/fastsetup.git

cd fastsetup

sudo ./ubuntu-initial.sh

8) And then write exit or logout in terminal to disconnect from amazon

9) Then eneter the comman in local terminal

ssh -L localhost:8888:localhost:8888 -i <name of pemfile> ubuntu@<public ipv4 Dns>

10) Make sure of the directory of the pem file path

*(No you are connected to amazon terminal)*

11) Do the following <amazon ec2 terminal>:

cd fastsetup

./setup-conda.sh

source ~/.bashrc

12) Do not enter the following as described in course.fast.ai:

conda install -yq mamba

13) Now setup your nvidia-drivers:

ubuntu-drivers devices

14) You have to look at recommended drivers version and then install it

sudo apt-fast install -y nvidia-driver-<recommended driver version>-server

15) Make sure you install nvidia driver successfully

16) Enter the following commands:

sudo modprobe nvidia

nvidia-smi

17) Now time to install fastai libraries. *REMEMBER TO DO IT WITH pip NOT conda/mamba*

pip –upgrade pip

pip install fastai

pip install -uqq fastbook

pip install graphvis

pip install notebook

18) Enter the following:

cd

git clone https://github.com/fastai/fastbook

19) Run jupyter notebook: jupyter notebook

20) Type localhost:8888 in your browser.

21) If it is not connected open the new terminal and type following:

ssh -L localhost:8888:localhost:8888 -i <pemfile> ubuntu@<public ipv4 Dns>

*Email us if you are facing issues*