I recently got a good deal for a Dell G7 gaming laptop (Intel i7 8th gen, RTX 2070 8GB). It was a solid laptop to run some deep learning practice with Ubuntu 18.04 LTS. To get to this step, I had to fight for
- Nvme and ACHI
- Secure boot
- Nvidia driver, nouveau and CUDA
And this document of my best practice contains most of the troubleshooting tips.
Prerequisites and Install Ubuntu
Dell has an official tutorial to install Ubuntu on Dell laptops which works very nice. Please follow it at https://www.dell.com/support/article/nz/en/nzdhs1/sln301754/how-to-install-ubuntu-and-windows-8-or-10-as-a-dual-boot-on-your-dell-pc?lang=en#step13 . A few things need some additional work:
- Ubuntu 18.04 LTS has the best support for now. Having the full ISO version on a flash drive of at least 4GB is a good idea, where the minimal ISO doesn’t have the right network driver for this laptop (WiFi or cable).
- To have the nvme disk be recognized by the Ubuntu installer, please press F12 when boot and go to the SATA configuration to switch to ‘ACHI’ mode instead of “Raid On”. However, the laptop might feel panic if return to Windows where it doesn’t recognize the boot disk. There is currently no good solution because of Intel SATA driver and Microsoft driver issue. Just switch it back when boot for Windows.
- Some changes on BIOS might trigger the BitLocker blue screen if the laptop runs Win10 Pro. Please make sure to have another device to check the super long unlock code online at aka.ms/myrecoverykey if this blue screen shows up.
Turn off `nouveau` and install nVidia driver
Driver first and CUDA later!
The nVidia driver for deep learning doesn’t work with `nouveau` mode which comes with Ubuntu by default. There are a few methods to disable it, and I have found this tutorial for the best: https://linuxconfig.org/how-to-disable-nouveau-nvidia-driver-on-ubuntu-18-04-bionic-beaver-linux . We simply do:
sudo bash -c “echo blacklist nouveau > /etc/modprobe.d/blacklist-nvidia-nouveau.conf”
sudo bash -c “echo options nouveau modeset=0 >> /etc/modprobe.d/blacklist-nvidia-nouveau.conf”
sudo update-initramfs -u
And reboot the system. After successful rebooting the system, we can install the right nVidia driver. Among many suggested methods like the `autoinstall`, I found the ‘software & update’ application was the best solution. In this way, we don’t have to worry about the `xserver` status. One can simply go to this system application, check the ‘additional drivers’ tab, and install the suggest nVidia driver (with no `nouveau` in the name’). In my case, it was nVidia driver version 430.
Secure boot issue
During the driver installation, one can see a pop-up screen (or a dialog box if use command line mode) to ask for a secure boot password. Please create one and remember it. For the first time reboot after installing the driver, the laptop should show a blue screen to enroll in this password. We simply enter the first option to view the `extended key usage`, press enter, and type in the password that we just created when installing the driver.
Please do it, otherwise, this driver would not be recognized by the system. After this reboot, one can type in `nvidia-smi` and see if it shows the card status. If any error, the most possible reason can be the secure boot setup, which can be fixed by getting back to the bios and enrolling the password.
Install CUDA 10.1
Ubuntu 18.04 has CUDA 9.1 in its `apt` repo. If we want to use CUDA 10.1, the best practice is by following the CUDA toolkit download page https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1804 and choose `deb (network)’ option to get the list of commands to install. After that, we can validation CUDA installation by typing
nvcc — version
which should give 10.1. The `libcudnn` can be easily installed by following the nVidia developer page too.
Install `MXNet` and try deep learning
With any python environment, for example, my favorite Anaconda https://www.anaconda.com/distribution/, we can install `MXNet` with CUDA 10.1 simply by
pip install mxnet-cu101
After that, we can validate if the GPU version is installed. With the official guideline at https://mxnet.apache.org/get_started/validate_mxnet.html, we can try this in python:
import mxnet as mx
a = mx.nd.ones((2, 3), mx.gpu())
b = a * 2 + 1
b.asnumpy()
Congratulations, this Dell G7 gaming laptop is fully ready for deep learning!
