Configuring GPU on OCI instance and run Jupyter Notebook

In this blog, we will go through the steps required for configuring GPU on Oracle Cloud Instance.

oci1

Assuming that you have a private key for your instance named like privateKey.bsdcsce .

We will start by logging in the system. On the terminal type the following command:

$ chmod 500 privateKey.bdcsce
$ ssh -i privateKey.bdcsce username@ip_address_of_the_instance

You should be in the instance terminal by now.

If you are connected to oracle network, you should be setting the https proxy first to use the internet for installation purposes.

In the next step, we will be installing Anaconda3 for our machine learning hacks.

Just run the following commands:

#instance$ curl -O https://repo.continuum.io/archive/Anaconda3-2018.12-Linux-x86_64.sh

#instance$ bash Anaconda3-2018.12-Linux-x86_64.sh -b


#instance$ echo -e '\nexport PATH="$HOME/anaconda3/bin:$PATH"' >> $HOME/.bashrc

#instance$ source ~/.bashrc

Congrats! You have installed Anaconda3 in your system. Now we need to install jupyter Notebook to write and test our code. But we will create a python3 virtual environment first for that.

#instance$ conda create -n name_of_env

Now we will go into our newly created virtual environment.

#instance$ source activate name_of_env

We have to install jupyter notebook here in this environment. For that, just run:

(name_of_env) #instance$ conda install jupyter notebook

Now, one important thing to notice is that, our instance does not have the port 8888 opened in which normally the jupyter starts. So, we will have to run one more command for that:

(name_of_env) #instance$ sudo iptables -I INPUT -p tcp -s 0.0.0.0/0 --dport 8888 -j ACCEPT

Thatโ€™s it, run the jupyter notebook from terminal and it normally starts at port number: 8888. If it starts at some other port, you will have to open the port just like the step discussed before.

Note: Copy the port number followed by the public ip of your instance in a browser to open the notebook.๐Ÿ˜Š