My failed attempt to set up an old MacbookPro as a deep learning workstation
Tags: beginners, linux, osx, gpu
Published: 2020-03-21 05:36:42

---
title: My failed attempt to set up an old MacbookPro as a deep learning workstation
published: true
description:
tags: #beginners #linux #osx #gpu
---

I recently got a new laptop but didn't want to say goodbye to my [2014 MacBookPro (10,1)](https://everymac.com/systems/apple/macbook_pro/specs/macbook-pro-core-i7-2.6-15-dual-graphics-late-2013-retina-display-specs.html) yet. Then I remembered it has an NVIDIA graphics card, so I thought maybe I'll use it for training toy deep learning models. I never train a deep learning model before.

My goal was to training a [tacotron2](https://github.com/NVIDIA/tacotron2) model. Tacotron is Google's deep learning-based speech synthesis system. I was not able to set up my old laptop to train a tacotron2 model but found a different way to achieve my goal, i.e., using [Google Colab](https://colab.research.google.com/). Still, I'm sharing my journey in case someone could learn from the mistakes I made.

1. I installed Ubuntu 18.04. I searched for related documentation from [help.ubuntu.com](https://help.ubuntu.com/community/MacBookPro) or [wiki.ubuntu.com](https://wiki.ubuntu.com/MactelSupportTeam/CommunityHelpPages) but they seem outdated so I just googled "install ubuntu 18.04 MacBookPro and found a [medium post](https://medium.com/@vincentedwardcastro/installing-ubuntu-18-04-01-lts-on-late-2013-mac-book-pro-61d20e5e6230). Following the instructions on the post just worked. I also installed an NVIDIA driver via [Software Settings](https://itsfoss.com/install-additional-drivers-ubuntu/).

2. [Training tacotron2 requires Pytorch 1.0](https://github.com/NVIDIA/tacotron2#setup). Although [it seemed like I could install Pytorch via pip](https://pytorch.org/get-started/locally/), I wanted to try installing it from source to gain better control of it. So I decided to install cuda & cudnn myself. It seemed like cuda 10.1 and cudnn 7.6.x are the latest pytorch compatible version of cuda and cudnn in March 2020.

3. NVIDIA's instructions for installing [cuda](https://developer.nvidia.com/cuda-10.1-download-archive-base?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1804&target_type=debnetwork) and [cudnn](https://docs.nvidia.com/deeplearning/sdk/cudnn-install/index.html#installlinux-deb) weren't as straightforward as I hoped them to be. After running the main cuda install command `sudo apt-get install cuda-10-1` (not `sudo apt-get install cuda-10` because I want to control the cuda version) I was seeing errors like
    ```
    ...
      found 'diversion of /usr/lib/x86_64-linux-gnu/libGL.so.1 to /usr/lib/x86_64-linux-gnu/libGL.so.1.distrib by nvidia-340'
    ...
    ```
    I found [a solution at stackoverflow](https://askubuntu.com/questions/1035409/installing-nvidia-drivers-on-18-04) and shamelessly applied it without understanding the commands fixed the problem. I suspected the error was due to installing an NVIDIA driver at 1. but never confirmed it. I also did not understand why the solution worked, but in the interest of time, I marched forward. cudnn installation was smooth.

4. Now it was time to build Pytorch from source. Although I should be using conda, I just used `pip3` in the interest of time and started following [the instructions](https://github.com/pytorch/pytorch#from-source). After running the grand `python setup.py install`, I got stuck:
    ```
    ...
        /home/mjyc/.local/lib/python3.6/site-packages/torch/cuda/__init__.py:134: UserWarning:
            Found GPU0 GeForce GT 750M which is of cuda capability 3.0.
            PyTorch no longer supports this GPU because it is too old.
            The minimum cuda capability that we support is 3.5.
    ...
    ```
    It turns out MacBookPro 10,1's GPU GeForce GT 750M was [too old for PyTorch 1.4](https://discuss.pytorch.org/t/pytorch-no-longer-supports-this-gpu-because-it-is-too-old/13803) ([the latest compatible PyTorch version seems to be 0.3.1](https://discuss.pytorch.org/t/pytorch-no-longer-supports-this-gpu-because-it-is-too-old/13803/11)). My first reaction to this error message was just buying an external GPU (eGPU). However, [quick google search results](https://egpu.io/best-egpu-buyers-guide/) showed that the eGPU case alone costs \~$300.00! and learned that just choosing which GPU to buy [requires some research work](https://towardsdatascience.com/maximize-your-gpu-dollars-a9133f4e546a).

5. At this point, I realized I spent much more time and efforts and I originally budgeted so I gave up turning my old MacBookPro to a workstation and started looking for an alternative solution. I read [a Reddit thread suggesting a cloud solution](https://www.reddit.com/r/deeplearning/comments/96pftg/is_nvidia_gtx_1050_good_enough_for_deep_learning/) and [looked into which service is a good starting point](https://towardsdatascience.com/maximize-your-gpu-dollars-a9133f4e546a). Seems like Google Colab is a good place to start. So I stopped my exploration here.

To me, the lessons learned from this journey was _always focus on the end-goal instead of the mean_. Given my goal was to train a deep learning model, the mean to achieve the goal--using a laptop workstation or cloud--should not have mattered.