Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tpimentelms/3475873a41c60645e8265e8a2fa1889d to your computer and use it in GitHub Desktop.
Save tpimentelms/3475873a41c60645e8265e8a2fa1889d to your computer and use it in GitHub Desktop.
Setting up a MSI laptop with GPU (gtx1060), Installing Ubuntu 18.04, CUDA, CDNN, Pytorch and TensorFlow

Setting up a MSI laptop with GPU (gtx1060)

Installing Ubuntu 18.04, CUDA, CDNN, Pytorch and TensorFlow

Installing Ubuntu 18.04

Get Image

https://tutorials.ubuntu.com/tutorial/tutorial-create-a-usb-stick-on-ubuntu#0

Install (solving issues)

  • Security boot disable (change this in BIOS, for MSI computers reboot system and press delete a couple of times before the OS is loaded)
  • Possible problem: Screen freezing while installing
    • Reboot system
    • Go to the Install Ubuntu option (BUT DONT PRESS ENTER)
    • Press e
    • Find the line that starts with linux then add modprobe.blacklist=nouveau after quiet splash.
  • Choose a Wifi Network and install third party software and updates
  • Once the installation is done, remove the pendrive and reboot system

Installing Nvidia Drivers

  • Select Ubuntu at GRUB (you may need to repeat the modprobe.blacklist=nouveau step if the screen freezes again).
  • Make sure security boot is disable
  • Access command line (ctrl+alt+ F1,F2,F3...F??)
    sudo add-apt-repository ppa:graphics-drivers/ppa
    sudo apt update
    sudo apt install nvidia-driver-396
    sudo reboot
    

Installing Conda

https://docs.anaconda.com/anaconda/install/linux

Installing CUDA 9.0 and CUDNN 7.0

Pre install dependencies:

sudo apt-get install freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev libglfw3-dev libgles2-mesa-dev

And install CUDA with the runfile (local):

https://medium.com/@taylordenouden/installing-tensorflow-gpu-on-ubuntu-18-04-89a142325138

Installing Pytorch 0.4

create conda env

conda create -n torch python=3.6

install torch (cuda 9)

conda install -y pytorch=0.4 torchvision cuda90 -c pytorch

if cuda 9 fails, install this way using cuda 8

conda install -y pytorch=0.4 torchvision -c pytorch conda install cuda80 -c soumith

test gpu install

python -c 'import torch; print(torch.rand(2,3).cuda())'

Installing TensorFlow (1.8)

https://www.tensorflow.org/install/install_linux#installing_with_anaconda

REMEMBER

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64

test gpu install

python -c 'from tensorflow.python.client import device_lib; device_lib.list_local_devices()'

output:

2018-06-11 11:32:18.954198: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1053] Created TensorFlow device (/device:GPU:0 with ...)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment