I recently (July 2018) installed Ubuntu 16.04 on my XPS 15 9560.
my main usecase is to be able to run and test cuda programs localy when developing image processing software.
I chose Ubuntu 16.04 mostly because of compatibility with software like cuda, pytorch, tensorflow, and matlab.
My previous Fedora 28 worked well, but had too much incompatiblity with software that was stuck on an older GCC.
Fedora is leading the pack with GCC 8 and it is simply too aggressive for larger peices of software.
They also renamed lib
to lib64
which I think was a mistake.
The dd
command for me is still the only one that works reliably.
dd if=ubuntu-16.04.4-desktop-amd64.iso of=/dev/sdx bs=8M
Bios version. I probably have something like 1.6. Whatever was before all those big hacks with Intel. The new bioses wer really buggy and I just don't feel like testing them for Intel.
Make sure you have
- Disabled RAID. To do this:
- Set windows to boot in safe mode.
- Open your bios. Set the drive to whatever non-raid is.
- Boot into safe mode
- Reboot into normal mode.
- Yes this is necessary. Windows would otherwise complain that it can't find the boot disk.
- Disable safe mode. It will probably interfere with nvidia-drivers anyway.
- Backup your hard drive. The best way to do this is probably on the cloud somewhere.
16.04.4 actually went smoothly. Earlier versions had a hard time with the highdpi display settings.
Currently, it just scales everything by 2. And seems to work OK. I haven't used multiple monitors yet, but I'm sure I'll have some DPI issues.
Nouveau apparently hangs your computer, so hopefully the install goes smoothly.
Reboot into your new ubuntu install. But before you do that, change the kernel boot parameter. In the grub screen:
- High light the Ubuntu line.
- Press
e
. - Go to the last line (be patient, grub lags on a 4k screen)
- After
quiet splash
addnouveau.modeset=0
- Boot up.
- Edit the file
/etc/defaults/grub
and addnouveau.modeset=0
to theGRUB_CMDLINE_LINUX_DEFAULT
inside the quotes.
- While you are there, you can just add all the parameters:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nouveau.modeset=0 acpi_rev_override=1 nvidia-drm.modeset=0"
- After you are finished modifying
/etc/defaults/grub
, run the command
sudo update-grub2
- Update everything
sudo apt update
sudo apt upgrade
This is the scary part. I have to admit, there is a step that gave me a system that wouldn't boot into graphics mode.
You will want to add the bumblebee testing ppa. Yes testing is what you need, at least for 16.04.
You will also need to add the nvidia cuda 9.0 repository. To find it, search for nvidia cuda
and go to legacy releases. Find the 9.0 release, and download it.
Install cuda-9-0
, this will pull in nvidia-396
. Pay attention to the driver that it pull in case.
sudo apt update
sudo apt install cuda-9-0
Install bumblebee as a seperate step.
sudo apt install bumblebee
Add the rest of the kernel boot parameters: acpi_rev_override=1 nvidia-drm.modeset=0
and update grub.
Edit the bumblebee configuration file /etc/bumblebee/bumblebee.conf
.
- Specify the nvidia driver on line 22:
Driver=nvidia
- Line 55 should specify the version of the nvidia driver you have installed:
KernelDriver=nvidia-396
- Line 58 should replace
current
with396
:LibraryPath=/usr/lib/nvidia-396:/usr/lib32/nvidia-396
- Line 61 should do the same:
XorgModulePath=/usr/lib/nvidia-396/xorg,/usr/lib/xorg/modules
Reboot. Pray that your system boots back up.
If your system fails to boot to the graphic mode, add 3
, just the number 3
at the end of the kernel boot string. That will allow you to boot into a tty.
Open a terminal. Try typing:
nvidia-smi
It should give an error with:
NVIDIA-SMI couldn't find libnvidia-ml.so library in your system. Please make sure that the NVIDIA Display Driver is properly installed and present in your system.
Please also try adding directory that contains libnvidia-ml.so to your system PATH.
Now try:
optirun nvidia-smi
You should get
Fri Jul 6 14:04:04 2018
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 396.26 Driver Version: 396.26 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 1050 Off | 00000000:01:00.0 Off | N/A |
| N/A 35C P3 N/A / N/A | 5MiB / 4042MiB | 2% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 16451 G /usr/lib/xorg/Xorg 5MiB |
+-----------------------------------------------------------------------------+
Now profit!
This makes your boot process prettiers
This makes the TTY usable.
This makes grub lag less.
I followed this guide (mostly) and got nvidia-418 with cuda9 instead. Things seem to work until I close my screen, at which point it seems as if the nvidia driver crashes. Any advice? I can usually get to tty after but anything X is dead