[2019.2] The Pain of setting up a laptop for Deep Learning

Source: Deep Learning on Medium


Go to the profile of MadLad

Choosing the right machine

I recently bought HP Omen laptop with i7–8750h processor and GTX-1070 max-q graphics card. Though it is very good for gaming with G-Sync and 144Hz screen … I am going to use it mostly for running Deep Learning experiments.

Now most you will be already pissed that why I bought a laptop not a custom PC or why not just use some cloud solution like “aws” or “google-cloud” or “azure”. As many blogs and reddit suggest to go for the same … right ???

But over the years my experience has not been good with cloud solution pricing. Lets do some quick math. I want to use gpu and would want to run almost every day and every hour. So, I will be spending almost 1 USD per hour and for 8760 USD per year. Now, people will argue why do you want to take account of all hours … obviously you won’t need gpu all the time. So, make it 1/3rd or 1/4th of it. Still you will be spending around ~2200 USD per year and I spent the same amount to buy this laptop. So, not only I can run it every hour of the year … I will also keep the laptop and spend very little on electricity.

Also, I wanted some portable solution with battery backup as where I live, electricity is an issue (Bangalore, India … I hate this city). Desktops are cheap, I would have got gtx-1080ti or rtx-2070 for this price but I would have to buy keyboard, mouse and monitor as well. Moving with this all and some good battery backup is cumbersome for me. So I chose “the” cheapest laptop available on internet with 8gb of graphics card.

Laptop came with Windows 10 … obviously ! !

I am not used to Windows at all … I am using Ubuntu since the version 8.04 came. For last 2 years I am using Mac [don’t roll your eyes … company given laptops :D … I am not rich & dumb ], which doesn’t feel alien to me but Windows does. But I recently came to know that we can setup Ubuntu App inside windows-10 and I was eager to try that. And … it was very easy. You can follow the steps here.

But, I could not install NVIDIA drivers and got the kernel related errors. And then found this ->

It would have been great if I could use that method, who anyway needs GUI for Linux. Also, I considered using virtualbox to install Ubuntu iso … but decided not to as I wanted to move on faster with the machine setup and dual boot is something I have done many times over the years. It works … almost always !!

Ubuntu 18.04 … not a good choice ??

I downloaded Ubuntu 18.04 iso and created a boot usb drive easily using this method explained here. Pretty straight forward. Once Ubuntu was installed I started installing NVIDIA drivers and Cuda 10. It is latest so everything should work … but NOPE !!!

After multiple attempts … Ubuntu was not able to recognize gtx-1070 hardware and it was a bummer. I spent 2 days to figure out the issue, tried Cuda 9.0 and older versions of drivers … nothing worked.

Then I thought, I am doing complicated things with old style of build from source shit. I should be doing simple things like mentioned here. And I followed the same with fresh install of Ubuntu 18.04 …again nothing worked. And that was it.

Many people have faced the problem of installing drivers over GTX-10** on Laptops … check on stack-overflow. Maybe because of instability of drivers towards Max-Q version or problem with Ubuntu 18.04 … I decided to move ahead with Ubuntu 16.04.

Ubuntu 16.04 .. The Saviour !!!

So, I have successfully setup Ubuntu 16.04 for Deep Learning few times before and I had the steps to follow as well. But I decided to keep looking for some blog or web-note which mentions the problems I stated above and deliberately switched from 18.04 to 16.04. And luckily I found this blog by Renato Miyagusuku.

And it was quite recent as well and he mentioned the “incompatibilities with 18.04” also. So I decided to follow this blog-post as much as possible … and viola everything went buttery smooth. Finally drivers detected the graphics-card. Huuussshhhh !!!

Now I have the system ready to battle AI, Deep Learning, Reinforcement Learning. It took almost 3 days to setup everything. I don’t mind it though. I learned many things during these stressful days. Biggest lesson was … always go with proven things .. at-least with Linux systems and Ubuntu is no exception.

Using Linux is always a bumpy ride … but when you hate Windows and Mac as much … You won’t even care

— Me