Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
[XPS 15 Early 2017 9560 kabylake] Making Nvidia Drivers + (CUDA 8 / CUDA 9 / CUDA 9.1) + Bumblebee work together on linux ( Ubuntu / KDE Neon / Linux Mint / debian )
# Instructions for 4.14 and cuda 9.1
# If upgrading from 4.13 and cuda 9.0
$ sudo apt-get purge --auto-remove libcud*
$ sudo apt-get purge --auto-remove cuda*
$ sudo apt-get purge --auto-remove nvidia*
# also remove the container directory direcotory at /usr/local/cuda-9.0/
# Important libs required with 4.14.x with Cuda 9.X
$ sudo apt install libelf1 libelf-dev
# Install Intel Graphics Patch Firmwares (This should reboot your system):
bash -c "$(curl -fsSL http://bit.ly/IGFWL-install)"
# Update to 4.14 kernel. nvidia-384 compiles fine with this.
cd /tmp
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.14.13/linux-headers-4.14.13-041413_4.14.13-041413.201801101001_all.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.14.13/linux-headers-4.14.13-041413-generic_4.14.13-041413.201801101001_amd64.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.14.13/linux-image-4.14.13-041413-generic_4.14.13-041413.201801101001_amd64.deb
sudo dpkg -i *.deb
# Add Nvidia repository
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update
# Install via ubuntu drivers
sudo ubuntu-drivers autoinstall
# <optional for ML Folks> Install CUDA 8 (if you're interested in using gpu for ML) ~> requires nvidia stable drivers
# This acts as repo so install it somewhere safe and do not delete
# cuda is now available with membership only, download from https://developer.nvidia.com/cuda-release-candidate-download
sudo dpkg -i cuda-repo-ubuntu1604-9-0-local-rc_9.0.103-1_amd64.deb
sudo apt-key add /var/cuda-repo-<version>/7fa2af80.pub
sudo apt-get update
sudo apt-get install cuda
# Update Path to have /usr/local/cuda/bin incase using dotfiles.
# <optional for ML Folks> Install CuDNN for running things like tensorflow
# Download cudnn7 for cuda9 from nvidia https://developer.nvidia.com/cudnn
sudo dpkg -i libcudnn7_7.0.2.43-1+cuda9.0_amd64.deb
# Testing cuda.
$ sudo prime-select intel
$ nvidia-smi
# This should give an error, no drivers found
# Try this
$ sudo prime-select nvidia
# displays CUDA info.
# At this point the nvidia drivers work well enough. Search for "nvidia x server settings"
# in your applications menu and you can switch between intel and nvidia PRIME profiles.
# But the nvidia card is still ON (bbswitch will report it off, but the battery consumption is (20 +- 5) Watts
# You can leave it here if you're not worried about battery but if you are then continue with this.
# Install powertop
sudo apt install powertop
# TLP interferes with bluetooth, better not install it, or remove it completely.
sudo apt remove --purge tlp
# Run powertop:
sudo powertop
# You should see battery discharge around 20w +/- 5W, this eats up my battery 4 times faster.
# Add command line params:
sudo nano /etc/default/grub
# Make the following look like this, do not ask why.
GRUB_CMDLINE_LINUX_DEFAULT='pcie_port_pm=off acpi_backlight=none acpi_osi=Linux acpi_osi=! acpi_osi="Windows 2009"'
sudo update-grub2
# Install bumblebee - now this is the danger zone, this software has not been updated in a while and I am not sure when will this available.
# Avoid updating your system if you're fine with this.
sudo add-apt-repository ppa:bumblebee/testing
sudo apt update
sudo apt install bumblebee bumblebee-nvidia
# at the time of writing this, the latest is nvidia-381 but cuda 8 requires the stable, which is nvidia-375
# add them to bumblebee config file.
sudo nano /etc/bumblebee/bumblebee.conf
# Change 'Driver=' to 'Driver=nvidia'
# Change all occurences of 'nvidia-current' to 'nvidia-xxx'
# Change KernelDriver=nvidia-384
# save and run
sudo service bumblebeed restart
# this should give you daemon already running
sudo bumblebeed
# Since the driver load will now be handled by bumblebee, we need to stop the OS from loading it.
sudo nano /etc/modprobe.d/bumblebee.conf
# Make the following section look like this (the drm line will be added):
#387
blacklist nvidia-387
blacklist nvidia-387-drm
blacklist nvidia-387-updates
blacklist nvidia-experimental-387
# once that is done, you'll need bbswitch dkms module
sudo apt-get install bbswitch-dkms
# Load this with the kernel.
sudo nano /etc/modules-load.d/modules.conf
# add following
i915
bbswitch
# now make sure nvidia-settings has nvidia prime profile selected.
# So what actually happened:
# The control for switching between graphics has been moved from nvidia's driver to bumblebee. This helps
# maximize battery life because now you can selectively switch between which graphics card to use. In case
# you want to provide access to nvidia gpu for the current application run it using optirun.
# e.g. if you want to run steam with nvidia gpu, run something like: $ optirun steam
# or if you're using gpu to run ml tasks, just run them with optirun and they would work just fine.
# Additional
# TLP is known to interfere with bumblebee, make it avoid using this https://wiki.archlinux.org/index.php/Talk:Bumblebee#Bumblebee_and_TLP_interferening
# Run powertop to see if battery consumption is in check: 10w +/- 5W
# Testing bumblebee
cat /proc/acpi/bbswitch # Ouput:0000:01:00.0 OFF
optirun glxgears -info # Runs the Gears demo
optirun nvidia-smi # Should give an error
sudo prime-select nvidia # Should select nvidia hardware for cuda
optirun nvidia-smi # Outputs:
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 387.34 Driver Version: 387.34 |
|-------------------------------+----------------------+----------------------+
| 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 29C P0 N/A / N/A | 5MiB / 4041MiB | 2% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 23052 G /usr/lib/xorg/Xorg 5MiB |
+-----------------------------------------------------------------------------+
cat /proc/acpi/bbswitch # Still Outputs:0000:01:00.0 OFF which means, we're using nvida hardware only when we run applications using optirun
# Getting mouse freezes, random misses?
dmesg -w | grep psmouse #check if your trackpad is out of sync frequently
# Add this boot flag:
"psmouse.resetafter=0"
# The system loads a blank screen with just a cursor on reboot?
# I found that selecting nvidia and restarting the system would need nvidia to run again,
# but unfortunately we disable nvidia on startup. A simple fix could be adding an alias in your ~/.(bash|zsh)rc
# I always restart my system from the terminal so this makes sure I move back to intel always before restart.
alias reboot="sudo prime-select intel; sudo reboot now"
alias shutdown="sudo prime-select intel; sudo shutdown -h now"
# Other Helpful links:
http://en.community.dell.com/techcenter/os-applications/f/4613/t/19629103
https://karlgrz.com/dell-xps-15-ubuntu-tweaks/
https://hemenkapadia.github.io/blog/2016/05/07/Ubuntu-with-Nvidia-Bumblebee.html
https://askubuntu.com/questions/879856/nvidia-prime-cant-switch-to-intel/885487
http://www.webupd8.org/2016/08/how-to-install-and-configure-bumblebee.html
#Benchmarks
==================================
GpuTest 0.7.0
http://www.geeks3d.com
Module: TessMark X64
Score: 5243 points (FPS: 87)
Settings:
- 1920x1080 windowed
- antialiasing: Off
- duration: 60000 ms
Renderer:
- GeForce GTX 1050/PCIe/SSE2
- OpenGL: 4.5.0 NVIDIA 384.98
==================================
==================================
GpuTest 0.7.0
http://www.geeks3d.com
Module: Plot3D
Score: 11340 points (FPS: 189)
Settings:
- 1920x1080 windowed
- antialiasing: Off
- duration: 60000 ms
Renderer:
- GeForce GTX 1050/PCIe/SSE2
- OpenGL: 4.5.0 NVIDIA 384.98
==================================
=================================
GpuTest 0.7.0
http://www.geeks3d.com
Module: FurMark
Score: 2670 points (FPS: 44)
Settings:
- 1920x1080 windowed
- antialiasing: Off
- duration: 60000 ms
Renderer:
- GeForce GTX 1050/PCIe/SSE2
- OpenGL: 4.5.0 NVIDIA 384.98
==================================
@jwaring

This comment has been minimized.

Show comment Hide comment
@jwaring

jwaring Mar 29, 2017

Hi whizzzkid,

Thank you, your gist was invaluable.

I am not particularly needing CUDA so I only installed nvidia-375. Also, I couldn't get suspend to work reliably until I installed 4.9.17 and then I had to set to the boot cmdline to GRUB_CMDLINE_LINUX_DEFAULT='acpi_osi=! acpi_osi="Windows 2009"'.

Cheers, J

jwaring commented Mar 29, 2017

Hi whizzzkid,

Thank you, your gist was invaluable.

I am not particularly needing CUDA so I only installed nvidia-375. Also, I couldn't get suspend to work reliably until I installed 4.9.17 and then I had to set to the boot cmdline to GRUB_CMDLINE_LINUX_DEFAULT='acpi_osi=! acpi_osi="Windows 2009"'.

Cheers, J

@nwh

This comment has been minimized.

Show comment Hide comment
@nwh

nwh Apr 7, 2017

Thanks for this! It was very helpful. I was not able to get the system going with nvidia-378, but things worked when I downgraded to nvidia-375. I am mainly interested in CUDA development and not concerned with battery life and have modified instructions here.

nwh commented Apr 7, 2017

Thanks for this! It was very helpful. I was not able to get the system going with nvidia-378, but things worked when I downgraded to nvidia-375. I am mainly interested in CUDA development and not concerned with battery life and have modified instructions here.

@rajeeja

This comment has been minimized.

Show comment Hide comment
@rajeeja

rajeeja Apr 25, 2017

Do you have instruction for installing Ubuntu on XPS 15 9560? I want to dual boot, have a lot of stuff already installed on my windows.

rajeeja commented Apr 25, 2017

Do you have instruction for installing Ubuntu on XPS 15 9560? I want to dual boot, have a lot of stuff already installed on my windows.

@whizzzkid

This comment has been minimized.

Show comment Hide comment
@whizzzkid

whizzzkid Apr 27, 2017

@rajeeja there are a lot of instructions on how to dual boot, you basically turn the secure boot off and install as you would normally do. This is after you have done dual booting.

Owner

whizzzkid commented Apr 27, 2017

@rajeeja there are a lot of instructions on how to dual boot, you basically turn the secure boot off and install as you would normally do. This is after you have done dual booting.

@dhfromkorea

This comment has been minimized.

Show comment Hide comment
@dhfromkorea

dhfromkorea May 10, 2017

Hi, I am running a KDE Neon Ubuntu LTS which currently appears bound to the kernel version of 4.8. Would you recommend updating my kernel to 4.9 before rolling out the instructions above?

[update] Okay, I just went ahead going through the instruction right before installing bumblebee. Everything seems working as intended so far. I am a bit hesitant to install bumblebee as you labeled it "danger zone". Would you share any advice on just how risky that move is? I am willing to manually prime-select/reboot for a while until bumblebee gets settled fine. @

dhfromkorea commented May 10, 2017

Hi, I am running a KDE Neon Ubuntu LTS which currently appears bound to the kernel version of 4.8. Would you recommend updating my kernel to 4.9 before rolling out the instructions above?

[update] Okay, I just went ahead going through the instruction right before installing bumblebee. Everything seems working as intended so far. I am a bit hesitant to install bumblebee as you labeled it "danger zone". Would you share any advice on just how risky that move is? I am willing to manually prime-select/reboot for a while until bumblebee gets settled fine. @

@SvenMeyer

This comment has been minimized.

Show comment Hide comment
@SvenMeyer

SvenMeyer May 10, 2017

Great work! I managed to install Ubuntu MINT, but the XPS15 is still eating too much power.

  1. If I'm happy with the internal Intel grafic for my display and only want the GPU for tensorflow, etc , do I need Bumblebee? Would I even need to install the NVIDIA (display) driver?
  2. Would PRIME (https://wiki.ubuntuusers.de/Hybrid-Grafikkarten/PRIME/) be a (better) alternative?
  3. I thought I have to keep the original 16.04 / 4.4 kernel to use CUDA8 and cudnn 5.x or is this not true?

SvenMeyer commented May 10, 2017

Great work! I managed to install Ubuntu MINT, but the XPS15 is still eating too much power.

  1. If I'm happy with the internal Intel grafic for my display and only want the GPU for tensorflow, etc , do I need Bumblebee? Would I even need to install the NVIDIA (display) driver?
  2. Would PRIME (https://wiki.ubuntuusers.de/Hybrid-Grafikkarten/PRIME/) be a (better) alternative?
  3. I thought I have to keep the original 16.04 / 4.4 kernel to use CUDA8 and cudnn 5.x or is this not true?
@sergeevii123

This comment has been minimized.

Show comment Hide comment
@sergeevii123

sergeevii123 May 14, 2017

@whizzzkid
When running on Intel gpu cursor freezes complitly after waking up from suspend.
I added psmouse.resetafter=0 to GRUB_CMDLINE_LINUX_DEFAULT but cursor still freezes.

sergeevii123 commented May 14, 2017

@whizzzkid
When running on Intel gpu cursor freezes complitly after waking up from suspend.
I added psmouse.resetafter=0 to GRUB_CMDLINE_LINUX_DEFAULT but cursor still freezes.

@idoshamun

This comment has been minimized.

Show comment Hide comment
@idoshamun

idoshamun May 15, 2017

@whizzzkid @sergeevii123 I am having the cursor issue as well...

@whizzzkid @sergeevii123 I am having the cursor issue as well...

@whizzzkid

This comment has been minimized.

Show comment Hide comment
@whizzzkid

whizzzkid May 17, 2017

@sergeevii123 @idoshamun did you update your bios? I had this issue 3 days after my first install, turns out bios was problematic. Next day dell released an update for the bios which fixed the annoying freezing issue. Since then there have been 2 more updates to the bios. Update and see if it fixes that for you.

Owner

whizzzkid commented May 17, 2017

@sergeevii123 @idoshamun did you update your bios? I had this issue 3 days after my first install, turns out bios was problematic. Next day dell released an update for the bios which fixed the annoying freezing issue. Since then there have been 2 more updates to the bios. Update and see if it fixes that for you.

@whizzzkid

This comment has been minimized.

Show comment Hide comment
@whizzzkid

whizzzkid May 17, 2017

@dhfromkorea @SvenMeyer bumblebee is the real deal. In my case I can selectively allow access to the apps that need nvidia gpu. e.g if I am training a keras mnist example. I can simply run:

$ python mnist_cnn.py
This takes up ~58s/epoch and 100% cpu utilization.

To run this on gpu, I just need to do (provided tensorflow was built with gpu support):

$ optirun python mnist_cnn.py
This is done in ~12s/epoch and 10% cpu utilization

Similarly I am guessing if you're using steam, you can allow steam to access your GPU using the same method. Also I use this bumblebee indicator which makes it obvious if the gpu is on or off.

Owner

whizzzkid commented May 17, 2017

@dhfromkorea @SvenMeyer bumblebee is the real deal. In my case I can selectively allow access to the apps that need nvidia gpu. e.g if I am training a keras mnist example. I can simply run:

$ python mnist_cnn.py
This takes up ~58s/epoch and 100% cpu utilization.

To run this on gpu, I just need to do (provided tensorflow was built with gpu support):

$ optirun python mnist_cnn.py
This is done in ~12s/epoch and 10% cpu utilization

Similarly I am guessing if you're using steam, you can allow steam to access your GPU using the same method. Also I use this bumblebee indicator which makes it obvious if the gpu is on or off.

@sergeevii123

This comment has been minimized.

Show comment Hide comment
@sergeevii123

sergeevii123 May 17, 2017

@whizzzkid
You updated bios with UEFI Capsule updates?
It says here that system will auto update bios

@whizzzkid
You updated bios with UEFI Capsule updates?
It says here that system will auto update bios

@sergeevii123

This comment has been minimized.

Show comment Hide comment
@sergeevii123

sergeevii123 May 20, 2017

After bios update to 1.3 no more troubles with cursor. Thanks @whizzzkid

sergeevii123 commented May 20, 2017

After bios update to 1.3 no more troubles with cursor. Thanks @whizzzkid

@Sijoma

This comment has been minimized.

Show comment Hide comment
@Sijoma

Sijoma May 21, 2017

After doing these steps, my internal graphics card is not found anymore and i can only use the nvidia

Sijoma commented May 21, 2017

After doing these steps, my internal graphics card is not found anymore and i can only use the nvidia

@SvenMeyer

This comment has been minimized.

Show comment Hide comment
@SvenMeyer

SvenMeyer May 23, 2017

Do I have to keep the original 16.04 / 4.4 kernel to use CUDA8 and cudnn 5.x or is this not true?
Anybody tries / was successful with 4.11 kernel, as this should save additional power with NVMe SSD?

Do I have to keep the original 16.04 / 4.4 kernel to use CUDA8 and cudnn 5.x or is this not true?
Anybody tries / was successful with 4.11 kernel, as this should save additional power with NVMe SSD?

@kjp4life

This comment has been minimized.

Show comment Hide comment
@kjp4life

kjp4life May 24, 2017

I've tried this on a Dell Inspiron 15 7559. Followed the basic recommendations, up to installing powertop. It worked fine for a few hours until I ran into the frozen mouse bug right after I woke my laptop up from suspend. Checked for a bios update on Dell's website but I am already on the latest version.
Any thoughts on what I can do?

I've tried this on a Dell Inspiron 15 7559. Followed the basic recommendations, up to installing powertop. It worked fine for a few hours until I ran into the frozen mouse bug right after I woke my laptop up from suspend. Checked for a bios update on Dell's website but I am already on the latest version.
Any thoughts on what I can do?

@whizzzkid

This comment has been minimized.

Show comment Hide comment
@whizzzkid

whizzzkid May 24, 2017

@dhfromkorea yes, install the 4.11.2 kernel, it seems to work great. I added the instructions to install that kernel from ubuntu mainline. If you want more of a gui experience check this out: https://github.com/teejee2008/ukuu

Owner

whizzzkid commented May 24, 2017

@dhfromkorea yes, install the 4.11.2 kernel, it seems to work great. I added the instructions to install that kernel from ubuntu mainline. If you want more of a gui experience check this out: https://github.com/teejee2008/ukuu

@whizzzkid

This comment has been minimized.

Show comment Hide comment
@whizzzkid

whizzzkid May 24, 2017

@sergeevii123 good to know, however, since I got a copy of "free" windows, I just dual booted my system with less than 100gigs to windows. might as well try some games (I am not a gamer btw)

Owner

whizzzkid commented May 24, 2017

@sergeevii123 good to know, however, since I got a copy of "free" windows, I just dual booted my system with less than 100gigs to windows. might as well try some games (I am not a gamer btw)

@whizzzkid

This comment has been minimized.

Show comment Hide comment
@whizzzkid

whizzzkid May 24, 2017

@Sijoma this is weird, try booting the older kernel to see if issue persists.

Owner

whizzzkid commented May 24, 2017

@Sijoma this is weird, try booting the older kernel to see if issue persists.

@whizzzkid

This comment has been minimized.

Show comment Hide comment
@whizzzkid

whizzzkid May 24, 2017

@SvenMeyer no, kernels after 4.10 broke nvidia drivers, it was only fixed in 4.11.1. So either use <= 4.10 or >=4.11.1

I am on 4.11.2 and it seems to be working fine.

Owner

whizzzkid commented May 24, 2017

@SvenMeyer no, kernels after 4.10 broke nvidia drivers, it was only fixed in 4.11.1. So either use <= 4.10 or >=4.11.1

I am on 4.11.2 and it seems to be working fine.

@whizzzkid

This comment has been minimized.

Show comment Hide comment
@whizzzkid

whizzzkid May 24, 2017

@kjp4life probably a touchpad driver issue, I am clueless in this case.

Owner

whizzzkid commented May 24, 2017

@kjp4life probably a touchpad driver issue, I am clueless in this case.

@ihendley

This comment has been minimized.

Show comment Hide comment
@ihendley

ihendley May 24, 2017

When I followed this guide my screen was set to minimum brightness, and now I seem to be stuck on minimum brightness. My brightness buttons bring up and adjust the brightness bar in the top right as if they are working, but the brightness does not adjust. When I boot the screen is bright, but at some point during the boot sequence it dims and stays that way. Changing "acpi_backlight=none" to "acpi_backlight=vendor" in /etc/default/grub and running update-grub does not help. Any ideas?

When I followed this guide my screen was set to minimum brightness, and now I seem to be stuck on minimum brightness. My brightness buttons bring up and adjust the brightness bar in the top right as if they are working, but the brightness does not adjust. When I boot the screen is bright, but at some point during the boot sequence it dims and stays that way. Changing "acpi_backlight=none" to "acpi_backlight=vendor" in /etc/default/grub and running update-grub does not help. Any ideas?

@whizzzkid

This comment has been minimized.

Show comment Hide comment
@whizzzkid

whizzzkid May 24, 2017

@ihendley in the latest kernel update the backlight control is messed up again. change it back to acpi_backlight=none see this https://gist.github.com/whizzzkid/37c0d365f1c7aa555885d102ec61c048#file-xps-15-9560-getting-nvidia-to-work-on-kde-neon-L68

Owner

whizzzkid commented May 24, 2017

@ihendley in the latest kernel update the backlight control is messed up again. change it back to acpi_backlight=none see this https://gist.github.com/whizzzkid/37c0d365f1c7aa555885d102ec61c048#file-xps-15-9560-getting-nvidia-to-work-on-kde-neon-L68

@ihendley

This comment has been minimized.

Show comment Hide comment
@ihendley

ihendley May 24, 2017

Thanks for the reply. I have tried both acpi_backlight=none and acpi_backlight=vendor, making sure to update-grub and reboot each time, but neither fix the issue.

Thanks for the reply. I have tried both acpi_backlight=none and acpi_backlight=vendor, making sure to update-grub and reboot each time, but neither fix the issue.

@ihendley

This comment has been minimized.

Show comment Hide comment
@ihendley

ihendley May 24, 2017

For now I am able to adjust the brightness from the command line as described here

For now I am able to adjust the brightness from the command line as described here

@ihendley

This comment has been minimized.

Show comment Hide comment
@ihendley

ihendley May 24, 2017

I tried adding acpi_backlight=none to the GRUB_CMDLINE_LINUX_DEFAULT string in /etc/default/grub, running sudo update-grub2 and rebooting one more time and this solved my problem. The brightness keys now correctly control my screen brightness. I don't know why this didn't work on the first try.

I tried adding acpi_backlight=none to the GRUB_CMDLINE_LINUX_DEFAULT string in /etc/default/grub, running sudo update-grub2 and rebooting one more time and this solved my problem. The brightness keys now correctly control my screen brightness. I don't know why this didn't work on the first try.

@napgab

This comment has been minimized.

Show comment Hide comment
@napgab

napgab May 24, 2017

i followed the guide and it seems that all is working good, but hardware acceleration is not supported with chrome and when i open a video in full screen (for example from youtube), the video freeze and lags. instead, fullscreen mode works good with firefox. am i the only one with this problem?

napgab commented May 24, 2017

i followed the guide and it seems that all is working good, but hardware acceleration is not supported with chrome and when i open a video in full screen (for example from youtube), the video freeze and lags. instead, fullscreen mode works good with firefox. am i the only one with this problem?

@whizzzkid

This comment has been minimized.

Show comment Hide comment
@whizzzkid

whizzzkid May 25, 2017

@ihendley you needed sudo update-grub2

@napgab try running chrome from command line: $ optirun google-chrome considering $ optirun nvidia-smi already shows the gpu info else select the nvidia card first.

Owner

whizzzkid commented May 25, 2017

@ihendley you needed sudo update-grub2

@napgab try running chrome from command line: $ optirun google-chrome considering $ optirun nvidia-smi already shows the gpu info else select the nvidia card first.

@napgab

This comment has been minimized.

Show comment Hide comment
@napgab

napgab May 26, 2017

@whizzzkid i can see gpu info from optirun nvidia-smi, but if i run optirun google-chrome, it opens an empty transparent window and i have this log:

optirun google-chrome
Using PPAPI flash.
--ppapi-flash-path=/usr/lib/adobe-flashplugin/libpepflashplayer.so --ppapi-flash-version=
primus: warning: reusing initial X connection for display thread
libGL error: MESA-LOADER: failed to retrieve device information
libGL error: unable to load driver: i915_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: i915
libGL error: MESA-LOADER: failed to retrieve device information
libGL error: unable to load driver: i915_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: i915
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
[14815:14968:0526/115557.594092:ERROR:x11_util.cc(76)] X error received: serial 39, error_code 169, request_code 155, minor_code 6
primus: fatal: failed to acquire direct rendering context for display thread

it seems to fail during the loading of i915 driver, but i followed all the steps in the guide. i don't know what is it.

napgab commented May 26, 2017

@whizzzkid i can see gpu info from optirun nvidia-smi, but if i run optirun google-chrome, it opens an empty transparent window and i have this log:

optirun google-chrome
Using PPAPI flash.
--ppapi-flash-path=/usr/lib/adobe-flashplugin/libpepflashplayer.so --ppapi-flash-version=
primus: warning: reusing initial X connection for display thread
libGL error: MESA-LOADER: failed to retrieve device information
libGL error: unable to load driver: i915_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: i915
libGL error: MESA-LOADER: failed to retrieve device information
libGL error: unable to load driver: i915_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: i915
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
[14815:14968:0526/115557.594092:ERROR:x11_util.cc(76)] X error received: serial 39, error_code 169, request_code 155, minor_code 6
primus: fatal: failed to acquire direct rendering context for display thread

it seems to fail during the loading of i915 driver, but i followed all the steps in the guide. i don't know what is it.

@pavan71198

This comment has been minimized.

Show comment Hide comment
@pavan71198

pavan71198 May 27, 2017

@whizzkid I'm getting unknown as return value for sudo prime-select query.
sudo prime-select nvidia is returning :
Info: selecting nvidia-375 for the nvidia profile
update-alternatives: using /usr/lib/nvidia-375/ld.so.conf to provide /etc/ld.so.conf.d/x86_64-linux-gnu_GL.conf (x86_64-linux-gnu_gl_conf) in manual mode
update-alternatives: using /usr/lib/nvidia-375/ld.so.conf to provide /etc/ld.so.conf.d/x86_64-linux-gnu_EGL.conf (x86_64-linux-gnu_egl_conf) in manual mode
update-alternatives: using /usr/lib/nvidia-375/alt_ld.so.conf to provide /etc/ld.so.conf.d/i386-linux-gnu_GL.conf (i386-linux-gnu_gl_conf) in manual mode
update-alternatives: using /usr/lib/nvidia-375/alt_ld.so.conf to provide /etc/ld.so.conf.d/i386-linux-gnu_EGL.conf (i386-linux-gnu_egl_conf) in manual mode

sudo prime-select intel is returning :
Info: selecting nvidia-375-prime for the intel profile
update-alternatives: using /usr/lib/nvidia-375-prime/ld.so.conf to provide /etc/ld.so.conf.d/x86_64-linux-gnu_GL.conf (x86_64-linux-gnu_gl_conf) in manual mode
update-alternatives: using /usr/lib/nvidia-375-prime/ld.so.conf to provide /etc/ld.so.conf.d/x86_64-linux-gnu_EGL.conf (x86_64-linux-gnu_egl_conf) in manual mode
update-alternatives: using /usr/lib/nvidia-375-prime/alt_ld.so.conf to provide /etc/ld.so.conf.d/i386-linux-gnu_GL.conf (i386-linux-gnu_gl_conf) in manual mode
update-alternatives: using /usr/lib/nvidia-375-prime/alt_ld.so.conf to provide /etc/ld.so.conf.d/i386-linux-gnu_EGL.conf (i386-linux-gnu_egl_conf) in manual mode

Why is it selecting nvidia-prime-375 for intel and nvidia-375 for nvidia.

pavan71198 commented May 27, 2017

@whizzkid I'm getting unknown as return value for sudo prime-select query.
sudo prime-select nvidia is returning :
Info: selecting nvidia-375 for the nvidia profile
update-alternatives: using /usr/lib/nvidia-375/ld.so.conf to provide /etc/ld.so.conf.d/x86_64-linux-gnu_GL.conf (x86_64-linux-gnu_gl_conf) in manual mode
update-alternatives: using /usr/lib/nvidia-375/ld.so.conf to provide /etc/ld.so.conf.d/x86_64-linux-gnu_EGL.conf (x86_64-linux-gnu_egl_conf) in manual mode
update-alternatives: using /usr/lib/nvidia-375/alt_ld.so.conf to provide /etc/ld.so.conf.d/i386-linux-gnu_GL.conf (i386-linux-gnu_gl_conf) in manual mode
update-alternatives: using /usr/lib/nvidia-375/alt_ld.so.conf to provide /etc/ld.so.conf.d/i386-linux-gnu_EGL.conf (i386-linux-gnu_egl_conf) in manual mode

sudo prime-select intel is returning :
Info: selecting nvidia-375-prime for the intel profile
update-alternatives: using /usr/lib/nvidia-375-prime/ld.so.conf to provide /etc/ld.so.conf.d/x86_64-linux-gnu_GL.conf (x86_64-linux-gnu_gl_conf) in manual mode
update-alternatives: using /usr/lib/nvidia-375-prime/ld.so.conf to provide /etc/ld.so.conf.d/x86_64-linux-gnu_EGL.conf (x86_64-linux-gnu_egl_conf) in manual mode
update-alternatives: using /usr/lib/nvidia-375-prime/alt_ld.so.conf to provide /etc/ld.so.conf.d/i386-linux-gnu_GL.conf (i386-linux-gnu_gl_conf) in manual mode
update-alternatives: using /usr/lib/nvidia-375-prime/alt_ld.so.conf to provide /etc/ld.so.conf.d/i386-linux-gnu_EGL.conf (i386-linux-gnu_egl_conf) in manual mode

Why is it selecting nvidia-prime-375 for intel and nvidia-375 for nvidia.

@kjp4life

This comment has been minimized.

Show comment Hide comment
@kjp4life

kjp4life May 27, 2017

@whizzkid I doubt it's the touchpad, because the whole system freezes over. I did some reading and it seems it was a bug from the previous nvidia drivers. version 381 was supposed to fix it, but to no avail. I deleted every nvidia driver and reinstalled 381, reinstalled xorg, updated my kernel to 4.11, but it seems that whatever I do, my system will wake up from suspend, work fine for a couple minutes until something triggers it to freeze. I have contemplated reinstalling from scratch but it's difficult to throw away the time I spent customizing it to my liking. Hope this adds some clarity.

@whizzkid I doubt it's the touchpad, because the whole system freezes over. I did some reading and it seems it was a bug from the previous nvidia drivers. version 381 was supposed to fix it, but to no avail. I deleted every nvidia driver and reinstalled 381, reinstalled xorg, updated my kernel to 4.11, but it seems that whatever I do, my system will wake up from suspend, work fine for a couple minutes until something triggers it to freeze. I have contemplated reinstalling from scratch but it's difficult to throw away the time I spent customizing it to my liking. Hope this adds some clarity.

@whizzzkid

This comment has been minimized.

Show comment Hide comment
@whizzzkid

whizzzkid May 30, 2017

@napgab you're probably missing the intel graphics drivers. Run this to install them:
$ curl -fsSL http://bit.ly/igfwl-installer | bash

@pavan71198 that's fine, it's just a copy making use of the non-nvidia drivers.

@kjp4life I am on 375, it's not a problem. Did you update the bios?

Owner

whizzzkid commented May 30, 2017

@napgab you're probably missing the intel graphics drivers. Run this to install them:
$ curl -fsSL http://bit.ly/igfwl-installer | bash

@pavan71198 that's fine, it's just a copy making use of the non-nvidia drivers.

@kjp4life I am on 375, it's not a problem. Did you update the bios?

@napgab

This comment has been minimized.

Show comment Hide comment
@napgab

napgab May 31, 2017

@whizzzkid i have already installed the drivers. Also, re-installing it, the problem persist.

napgab commented May 31, 2017

@whizzzkid i have already installed the drivers. Also, re-installing it, the problem persist.

@whizzzkid

This comment has been minimized.

Show comment Hide comment
@paines

This comment has been minimized.

Show comment Hide comment
@paines

paines Jun 6, 2017

Unfortunatley the situation on Ubuntu 17.04 seems to be the same. Bubmlebee won't work, independend of notebook vendor, as e.g. nvidia-prime/prime-select cannot switch to intel, it freezes on firing up X. While the prime-select version from https://raw.githubusercontent.com/C11235/nvidia-prime-bugfix/master/prime-select offers to switch between mesa-gl and nvidia (the system default one does not even manage that) , but it still freezes too on firing up X.

paines commented Jun 6, 2017

Unfortunatley the situation on Ubuntu 17.04 seems to be the same. Bubmlebee won't work, independend of notebook vendor, as e.g. nvidia-prime/prime-select cannot switch to intel, it freezes on firing up X. While the prime-select version from https://raw.githubusercontent.com/C11235/nvidia-prime-bugfix/master/prime-select offers to switch between mesa-gl and nvidia (the system default one does not even manage that) , but it still freezes too on firing up X.

@e-nikolov

This comment has been minimized.

Show comment Hide comment
@e-nikolov

e-nikolov Jun 7, 2017

# Install Intel Graphics Patch Firmwares (This should reboot your system):
bash -c "$(curl -fsSL http://bit.ly/IGFWL-install)"

How necessary is this part? What is wrong with the default intel graphics drivers?

e-nikolov commented Jun 7, 2017

# Install Intel Graphics Patch Firmwares (This should reboot your system):
bash -c "$(curl -fsSL http://bit.ly/IGFWL-install)"

How necessary is this part? What is wrong with the default intel graphics drivers?

@SvenMeyer

This comment has been minimized.

Show comment Hide comment
@SvenMeyer

SvenMeyer Jun 7, 2017

  1. I got an error message while installing kernel 4.11.2 (see below)
  2. Anybody tried 4.11.3 or 4.11.4 ?
  3. Can I just install 4.11.3 / 4.11.4 later or do I have to redo some of the steps following the initial kernel update again?

Error! Bad return status for module build on kernel: 4.11.2-041102-generic (x86_64)
Consult /var/lib/dkms/ndiswrapper/1.60/build/make.log for more information.

DKMS make.log for ndiswrapper-1.60 for kernel 4.11.2-041102-generic (x86_64)
Wed Jun 7 14:37:36 CEST 2017
make: Entering directory '/usr/src/linux-headers-4.11.2-041102-generic'
LD /var/lib/dkms/ndiswrapper/1.60/build/built-in.o
MKEXPORT /var/lib/dkms/ndiswrapper/1.60/build/crt_exports.h
MKEXPORT /var/lib/dkms/ndiswrapper/1.60/build/hal_exports.h
MKEXPORT /var/lib/dkms/ndiswrapper/1.60/build/ndis_exports.h
MKEXPORT /var/lib/dkms/ndiswrapper/1.60/build/ntoskernel_exports.h
MKEXPORT /var/lib/dkms/ndiswrapper/1.60/build/ntoskernel_io_exports.h
MKEXPORT /var/lib/dkms/ndiswrapper/1.60/build/rtl_exports.h
MKEXPORT /var/lib/dkms/ndiswrapper/1.60/build/usb_exports.h
MKSTUBS /var/lib/dkms/ndiswrapper/1.60/build/win2lin_stubs.h
CC [M] /var/lib/dkms/ndiswrapper/1.60/build/crt.o
CC [M] /var/lib/dkms/ndiswrapper/1.60/build/hal.o
CC [M] /var/lib/dkms/ndiswrapper/1.60/build/iw_ndis.o
CC [M] /var/lib/dkms/ndiswrapper/1.60/build/loader.o
CC [M] /var/lib/dkms/ndiswrapper/1.60/build/ndis.o
/var/lib/dkms/ndiswrapper/1.60/build/ndis.c: In function ‘NdisMIndicateReceivePacket’:
/var/lib/dkms/ndiswrapper/1.60/build/ndis.c:2261:15: error: ‘struct net_device’ has no member named ‘last_rx’
wnd->net_dev->last_rx = jiffies;
^
/var/lib/dkms/ndiswrapper/1.60/build/ndis.c: In function ‘EthRxIndicateHandler’:
/var/lib/dkms/ndiswrapper/1.60/build/ndis.c:2349:14: error: ‘struct net_device’ has no member named ‘last_rx’
wnd->net_dev->last_rx = jiffies;
^
/var/lib/dkms/ndiswrapper/1.60/build/ndis.c: In function ‘NdisMTransferDataComplete’:
/var/lib/dkms/ndiswrapper/1.60/build/ndis.c:2464:14: error: ‘struct net_device’ has no member named ‘last_rx’
wnd->net_dev->last_rx = jiffies;
^
scripts/Makefile.build:294: recipe for target '/var/lib/dkms/ndiswrapper/1.60/build/ndis.o' failed
make[1]: *** [/var/lib/dkms/ndiswrapper/1.60/build/ndis.o] Error 1
Makefile:1492: recipe for target 'module/var/lib/dkms/ndiswrapper/1.60/build' failed
make: *** [module/var/lib/dkms/ndiswrapper/1.60/build] Error 2
make: Leaving directory '/usr/src/linux-headers-4.11.2-041102-generic

SvenMeyer commented Jun 7, 2017

  1. I got an error message while installing kernel 4.11.2 (see below)
  2. Anybody tried 4.11.3 or 4.11.4 ?
  3. Can I just install 4.11.3 / 4.11.4 later or do I have to redo some of the steps following the initial kernel update again?

Error! Bad return status for module build on kernel: 4.11.2-041102-generic (x86_64)
Consult /var/lib/dkms/ndiswrapper/1.60/build/make.log for more information.

DKMS make.log for ndiswrapper-1.60 for kernel 4.11.2-041102-generic (x86_64)
Wed Jun 7 14:37:36 CEST 2017
make: Entering directory '/usr/src/linux-headers-4.11.2-041102-generic'
LD /var/lib/dkms/ndiswrapper/1.60/build/built-in.o
MKEXPORT /var/lib/dkms/ndiswrapper/1.60/build/crt_exports.h
MKEXPORT /var/lib/dkms/ndiswrapper/1.60/build/hal_exports.h
MKEXPORT /var/lib/dkms/ndiswrapper/1.60/build/ndis_exports.h
MKEXPORT /var/lib/dkms/ndiswrapper/1.60/build/ntoskernel_exports.h
MKEXPORT /var/lib/dkms/ndiswrapper/1.60/build/ntoskernel_io_exports.h
MKEXPORT /var/lib/dkms/ndiswrapper/1.60/build/rtl_exports.h
MKEXPORT /var/lib/dkms/ndiswrapper/1.60/build/usb_exports.h
MKSTUBS /var/lib/dkms/ndiswrapper/1.60/build/win2lin_stubs.h
CC [M] /var/lib/dkms/ndiswrapper/1.60/build/crt.o
CC [M] /var/lib/dkms/ndiswrapper/1.60/build/hal.o
CC [M] /var/lib/dkms/ndiswrapper/1.60/build/iw_ndis.o
CC [M] /var/lib/dkms/ndiswrapper/1.60/build/loader.o
CC [M] /var/lib/dkms/ndiswrapper/1.60/build/ndis.o
/var/lib/dkms/ndiswrapper/1.60/build/ndis.c: In function ‘NdisMIndicateReceivePacket’:
/var/lib/dkms/ndiswrapper/1.60/build/ndis.c:2261:15: error: ‘struct net_device’ has no member named ‘last_rx’
wnd->net_dev->last_rx = jiffies;
^
/var/lib/dkms/ndiswrapper/1.60/build/ndis.c: In function ‘EthRxIndicateHandler’:
/var/lib/dkms/ndiswrapper/1.60/build/ndis.c:2349:14: error: ‘struct net_device’ has no member named ‘last_rx’
wnd->net_dev->last_rx = jiffies;
^
/var/lib/dkms/ndiswrapper/1.60/build/ndis.c: In function ‘NdisMTransferDataComplete’:
/var/lib/dkms/ndiswrapper/1.60/build/ndis.c:2464:14: error: ‘struct net_device’ has no member named ‘last_rx’
wnd->net_dev->last_rx = jiffies;
^
scripts/Makefile.build:294: recipe for target '/var/lib/dkms/ndiswrapper/1.60/build/ndis.o' failed
make[1]: *** [/var/lib/dkms/ndiswrapper/1.60/build/ndis.o] Error 1
Makefile:1492: recipe for target 'module/var/lib/dkms/ndiswrapper/1.60/build' failed
make: *** [module/var/lib/dkms/ndiswrapper/1.60/build] Error 2
make: Leaving directory '/usr/src/linux-headers-4.11.2-041102-generic

@fractal

This comment has been minimized.

Show comment Hide comment
@fractal

fractal Jun 10, 2017

This list looks great, at least it seems to touch on most issues. However, i'm a bit sceptical to try it just yet given the amount of possible problems.

My main concern is around GPU / Battery usage. I only need GPU on rare occasions if I want to game or use something like Tensorflow (i'm not an ML guy, just trying to get into it). But the GPU shouldn't trash the battery.

I have a VirtualBox in windows where i'm trying an Ubuntu 17.04 to validate the config before I take the plunge. I'd rather have a working Windows 10 for the time been instead a molten battery because of the GPU always on.

Does anyone have a concise, up to date recipe to follow?

fractal commented Jun 10, 2017

This list looks great, at least it seems to touch on most issues. However, i'm a bit sceptical to try it just yet given the amount of possible problems.

My main concern is around GPU / Battery usage. I only need GPU on rare occasions if I want to game or use something like Tensorflow (i'm not an ML guy, just trying to get into it). But the GPU shouldn't trash the battery.

I have a VirtualBox in windows where i'm trying an Ubuntu 17.04 to validate the config before I take the plunge. I'd rather have a working Windows 10 for the time been instead a molten battery because of the GPU always on.

Does anyone have a concise, up to date recipe to follow?

@MeirBon

This comment has been minimized.

Show comment Hide comment
@MeirBon

MeirBon Jun 14, 2017

@fractal This guide is about the best you can get. You could also install Manjaro where everything stated in this guide will be done for you, but that is Arch-based. Using Bumblebee your GPU won't drain your battery unless you use it, so everything should be fine. The only issue I have with Bumblebee is that I can't get rid of a little bit of screen tearing sometimes, but that could also be just me alone. Haven't heard anyone else about this issue.

MeirBon commented Jun 14, 2017

@fractal This guide is about the best you can get. You could also install Manjaro where everything stated in this guide will be done for you, but that is Arch-based. Using Bumblebee your GPU won't drain your battery unless you use it, so everything should be fine. The only issue I have with Bumblebee is that I can't get rid of a little bit of screen tearing sometimes, but that could also be just me alone. Haven't heard anyone else about this issue.

@whizzzkid

This comment has been minimized.

Show comment Hide comment
@whizzzkid

whizzzkid Jun 15, 2017

@paines that should not happen :-/
@e-nikolov it'll keep bugging you always, also bumblebee would complain it couldn't get intel to switch to.
@SvenMeyer Nvidia driver builds for the current kernel only, most likely you'll need to redo everytime you update the kernel.
@fractal exactly, this resolves that. in case you want to run anything with gpu support just do $ optirun <command> else nvidia will always remain off.
@MeirBon Thanks :) I am more comfortable with debian based distros. Ubuntu sucks plain and simple, mint was good for a while but then it got weirder, kde neon is the best looking linux OS, IMO.

Owner

whizzzkid commented Jun 15, 2017

@paines that should not happen :-/
@e-nikolov it'll keep bugging you always, also bumblebee would complain it couldn't get intel to switch to.
@SvenMeyer Nvidia driver builds for the current kernel only, most likely you'll need to redo everytime you update the kernel.
@fractal exactly, this resolves that. in case you want to run anything with gpu support just do $ optirun <command> else nvidia will always remain off.
@MeirBon Thanks :) I am more comfortable with debian based distros. Ubuntu sucks plain and simple, mint was good for a while but then it got weirder, kde neon is the best looking linux OS, IMO.

@MajorTotem

This comment has been minimized.

Show comment Hide comment
@MajorTotem

MajorTotem Jun 15, 2017

@whizzkid thanks for writing this up, previous version of this worked for me, although the newest one causes issues (i think because of the 4.11.2 kernel) with boot (x doesn't start and just freezes up) and causes some random system hangs.

I do have a question though, anybody has some experience with PRIME offloading [0] on Ubuntu / KDE Neon? I want to get rid of the tearing issues as well as use the intel card for output, because currently the nvidia proprietary drivers make XRANDR unable to scale the output display (and I'm using xrandr --scale to properly display stuff on a 1080p monitor plugged in to my 4K XPS 9560)

Anywho, thank you again for the time spent writing this up :)

[0] - http://us.download.nvidia.com/XFree86/Linux-x86_64/375.66/README/randr14.html

MajorTotem commented Jun 15, 2017

@whizzkid thanks for writing this up, previous version of this worked for me, although the newest one causes issues (i think because of the 4.11.2 kernel) with boot (x doesn't start and just freezes up) and causes some random system hangs.

I do have a question though, anybody has some experience with PRIME offloading [0] on Ubuntu / KDE Neon? I want to get rid of the tearing issues as well as use the intel card for output, because currently the nvidia proprietary drivers make XRANDR unable to scale the output display (and I'm using xrandr --scale to properly display stuff on a 1080p monitor plugged in to my 4K XPS 9560)

Anywho, thank you again for the time spent writing this up :)

[0] - http://us.download.nvidia.com/XFree86/Linux-x86_64/375.66/README/randr14.html

@kjp4life

This comment has been minimized.

Show comment Hide comment
@kjp4life

kjp4life Jun 20, 2017

@whizzkid my bios is up to date. At this point I've taken a break from the issue, hoping that some new kernel update or nvidia driver update will address it. Sucks having to reboot after every session but at this point I'm out of ideas.

@whizzkid my bios is up to date. At this point I've taken a break from the issue, hoping that some new kernel update or nvidia driver update will address it. Sucks having to reboot after every session but at this point I'm out of ideas.

@whizzzkid

This comment has been minimized.

Show comment Hide comment
@whizzzkid

whizzzkid Jun 21, 2017

@MajorTotem you're welcome, I am on 4.11.2-041102-generic and everything seems to work. Not sure about your other issue either.

@kjp4life that's surprisingly awful. I am not sure what's the problem with reformatting the system? It's pretty simple to retain your configs and packages. I use dotfiles for most of my stuff. But kde specific configs (like ui stuff can be backed up from ~/.config and ~/.kde).

Owner

whizzzkid commented Jun 21, 2017

@MajorTotem you're welcome, I am on 4.11.2-041102-generic and everything seems to work. Not sure about your other issue either.

@kjp4life that's surprisingly awful. I am not sure what's the problem with reformatting the system? It's pretty simple to retain your configs and packages. I use dotfiles for most of my stuff. But kde specific configs (like ui stuff can be backed up from ~/.config and ~/.kde).

@kjp4life

This comment has been minimized.

Show comment Hide comment
@kjp4life

kjp4life Jun 23, 2017

@whizzkid When I installed Ubuntu I chose to have the home partition encrypted. If I reformat it, will this cause any problems? All my important files are backed up on Google Drive, but the way I have my computer set up and the packages I have installed is what I am worried about.

@whizzkid When I installed Ubuntu I chose to have the home partition encrypted. If I reformat it, will this cause any problems? All my important files are backed up on Google Drive, but the way I have my computer set up and the packages I have installed is what I am worried about.

@e-nikolov

This comment has been minimized.

Show comment Hide comment
@e-nikolov

e-nikolov Jun 23, 2017

@MeirBon Have you managed to install Manjaro on an XPS 15 9560? For me it gets stuck on the boot screen before getting into the live cd. It says "Started TLP system startup/shutdown" and just stays there forever.

e-nikolov commented Jun 23, 2017

@MeirBon Have you managed to install Manjaro on an XPS 15 9560? For me it gets stuck on the boot screen before getting into the live cd. It says "Started TLP system startup/shutdown" and just stays there forever.

@whizzzkid

This comment has been minimized.

Show comment Hide comment
@whizzzkid

whizzzkid Jun 26, 2017

@kjp4life use this approach to backup a list of installed packages and restoring them later: https://askubuntu.com/a/99151

Owner

whizzzkid commented Jun 26, 2017

@kjp4life use this approach to backup a list of installed packages and restoring them later: https://askubuntu.com/a/99151

@shingalated

This comment has been minimized.

Show comment Hide comment
@shingalated

shingalated Jul 10, 2017

For anyone who might be having suspend issues on kernel 4.12, I had to edit the follow line:

Make the following look like this, do not ask why.

--
  | GRUB_CMDLINE_LINUX_DEFAULT='pcie_port_pm=off acpi_backlight=none acpi_osi=Linux acpi_osi=! acpi_osi="Windows 2009"'

removing the "acpi_osi=Linux" portion.

For anyone who might be having suspend issues on kernel 4.12, I had to edit the follow line:

Make the following look like this, do not ask why.

--
  | GRUB_CMDLINE_LINUX_DEFAULT='pcie_port_pm=off acpi_backlight=none acpi_osi=Linux acpi_osi=! acpi_osi="Windows 2009"'

removing the "acpi_osi=Linux" portion.

@SvenMeyer

This comment has been minimized.

Show comment Hide comment
@SvenMeyer

SvenMeyer Jul 13, 2017

I'm currently using kernel 4.11.8 which works fine and gives me ~ 8.5 W before installing Nvidia driver.
I had problems with lspci freezing and timeout when shutting down, but GRUB_CMDLINE_... option solved that.
I noticed that kernel 4.12.0 did not need GRUB_CMDLINE_... options to fix that, but idle power rose to ~ 15.5 W with that kernel.
So, no reason to try kernel 4.12 ?

I'm currently using kernel 4.11.8 which works fine and gives me ~ 8.5 W before installing Nvidia driver.
I had problems with lspci freezing and timeout when shutting down, but GRUB_CMDLINE_... option solved that.
I noticed that kernel 4.12.0 did not need GRUB_CMDLINE_... options to fix that, but idle power rose to ~ 15.5 W with that kernel.
So, no reason to try kernel 4.12 ?

@SvenMeyer

This comment has been minimized.

Show comment Hide comment
@SvenMeyer

SvenMeyer Jul 13, 2017

is this the right code?
acpi_osi=! acpi_osi="Windows 2009"
elsewhere I always saw
acpi_osi="!Windows 2009"
which supposes to remove the 'Windows 2009' key

SvenMeyer commented Jul 13, 2017

is this the right code?
acpi_osi=! acpi_osi="Windows 2009"
elsewhere I always saw
acpi_osi="!Windows 2009"
which supposes to remove the 'Windows 2009' key

@lukedarlow

This comment has been minimized.

Show comment Hide comment
@lukedarlow

lukedarlow Aug 20, 2017

Hey, thanks for the guide @whizzzkid. It's been well helpful. I followed it almost to a tee and got really great results. I'm having a rather strange problem though and would like your insight.

From time to time I get a black screen just before the Ubuntu login screen. I even hear that nice little double drum sound, but the screen stays blank.

It seems to me that there is some sort of mislead of the drivers. I have spent hours trying to figure this out. It's super weird because it'll not happen for a few restarts and then suddenly give me grief trying to log in and I have to force reset several times. Sometimes if I'm having no luck I have to add "nouveau.modeset=0" to the grub load file.

Anybody got any clues?

Hey, thanks for the guide @whizzzkid. It's been well helpful. I followed it almost to a tee and got really great results. I'm having a rather strange problem though and would like your insight.

From time to time I get a black screen just before the Ubuntu login screen. I even hear that nice little double drum sound, but the screen stays blank.

It seems to me that there is some sort of mislead of the drivers. I have spent hours trying to figure this out. It's super weird because it'll not happen for a few restarts and then suddenly give me grief trying to log in and I have to force reset several times. Sometimes if I'm having no luck I have to add "nouveau.modeset=0" to the grub load file.

Anybody got any clues?

@sevko

This comment has been minimized.

Show comment Hide comment
@sevko

sevko Sep 1, 2017

FYI, the Intel firmware installation script at http://bit.ly/IGFWL-install seems broken. It creates an fw directory in your current directory, and then cds into /tmp/ and expects to find the fw directory there, which causes all of the tar commands to fail. If run as is, the installation steps will fail and you probably won't notice because the script immediately reboots your machine.

sevko commented Sep 1, 2017

FYI, the Intel firmware installation script at http://bit.ly/IGFWL-install seems broken. It creates an fw directory in your current directory, and then cds into /tmp/ and expects to find the fw directory there, which causes all of the tar commands to fail. If run as is, the installation steps will fail and you probably won't notice because the script immediately reboots your machine.

@Donwey

This comment has been minimized.

Show comment Hide comment
@Donwey

Donwey Sep 8, 2017

sevko, Any solution on this please?

Donwey commented Sep 8, 2017

sevko, Any solution on this please?

@whizzzkid

This comment has been minimized.

Show comment Hide comment
@whizzzkid

whizzzkid Sep 8, 2017

@sevko and @Donwey for some reason short links do not point at the right version of the gist. Here try this

bash -c "$(curl -fsSL https://gist.githubusercontent.com/whizzzkid/d5f9491cd60f09be51920e973a60e401/raw/fe038b61617fe91ac276d8b3c4041e7e0df962a0/IGFWL.sh)"

Or this

curl -o- http://bit.ly/igfwl-installer | bash

Owner

whizzzkid commented Sep 8, 2017

@sevko and @Donwey for some reason short links do not point at the right version of the gist. Here try this

bash -c "$(curl -fsSL https://gist.githubusercontent.com/whizzzkid/d5f9491cd60f09be51920e973a60e401/raw/fe038b61617fe91ac276d8b3c4041e7e0df962a0/IGFWL.sh)"

Or this

curl -o- http://bit.ly/igfwl-installer | bash

@hlavki

This comment has been minimized.

Show comment Hide comment
@hlavki

hlavki Sep 15, 2017

Hi, thanks for this. I am running openSUSE tumbleweed and it looks like it works, but if I run optirun glxspheres on HiDPi and change to resize to fullscreen, than FPS is 44. Its slower than intel.

Polygons in scene: 62464 (61 spheres * 1024 polys/spheres)
Visual ID of window: 0x21
Context is Direct
OpenGL Renderer: GeForce GTX 1050/PCIe/SSE2
208.091512 frames/sec - 298.622997 Mpixels/sec
46.062645 frames/sec - 357.829368 Mpixels/sec
44.692185 frames/sec - 347.183198 Mpixels/sec
44.929472 frames/sec - 349.026516 Mpixels/sec
44.540262 frames/sec - 346.003007 Mpixels/sec

optirun nvidia-smi

Fri Sep 15 11:49:00 2017       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 384.69                 Driver Version: 384.69                    |
|-------------------------------+----------------------+----------------------+
| 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   34C    P0    N/A /  N/A |      6MiB /  4041MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID  Type  Process name                               Usage      |
|=============================================================================|
|    0     18941    G   Xorg                                             6MiB |
+-----------------------------------------------------------------------------+

Do you also have this problem? Thank you

hlavki commented Sep 15, 2017

Hi, thanks for this. I am running openSUSE tumbleweed and it looks like it works, but if I run optirun glxspheres on HiDPi and change to resize to fullscreen, than FPS is 44. Its slower than intel.

Polygons in scene: 62464 (61 spheres * 1024 polys/spheres)
Visual ID of window: 0x21
Context is Direct
OpenGL Renderer: GeForce GTX 1050/PCIe/SSE2
208.091512 frames/sec - 298.622997 Mpixels/sec
46.062645 frames/sec - 357.829368 Mpixels/sec
44.692185 frames/sec - 347.183198 Mpixels/sec
44.929472 frames/sec - 349.026516 Mpixels/sec
44.540262 frames/sec - 346.003007 Mpixels/sec

optirun nvidia-smi

Fri Sep 15 11:49:00 2017       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 384.69                 Driver Version: 384.69                    |
|-------------------------------+----------------------+----------------------+
| 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   34C    P0    N/A /  N/A |      6MiB /  4041MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID  Type  Process name                               Usage      |
|=============================================================================|
|    0     18941    G   Xorg                                             6MiB |
+-----------------------------------------------------------------------------+

Do you also have this problem? Thank you

@hlavki

This comment has been minimized.

Show comment Hide comment
@hlavki

hlavki Sep 15, 2017

And also you can use boot options:

acpi_rev_override=5 acpi_backlight=none

instead of

pcie_port_pm=off acpi_backlight=none acpi_osi=Linux acpi_osi=! acpi_osi="Windows 2009"

hlavki commented Sep 15, 2017

And also you can use boot options:

acpi_rev_override=5 acpi_backlight=none

instead of

pcie_port_pm=off acpi_backlight=none acpi_osi=Linux acpi_osi=! acpi_osi="Windows 2009"

@whizzzkid

This comment has been minimized.

Show comment Hide comment
@whizzzkid

whizzzkid Sep 16, 2017

@hlavki Here is the output for:

$ optirun glxgears
14096 frames in 5.0 seconds = 2819.109 FPS
11460 frames in 5.0 seconds = 2290.427 FPS
$ optirun ./glxspheres64
Polygons in scene: 62464 (61 spheres * 1024 polys/spheres)
Visual ID of window: 0x21
Context is Direct
OpenGL Renderer: GeForce GTX 1050/PCIe/SSE2
347.675228 frames/sec - 388.005555 Mpixels/sec
358.998031 frames/sec - 400.641803 Mpixels/sec
351.300209 frames/sec - 392.051033 Mpixels/sec
356.592040 frames/sec - 397.956717 Mpixels/sec
359.251480 frames/sec - 400.924652 Mpixels/sec
350.943396 frames/sec - 391.652830 Mpixels/sec
356.542326 frames/sec - 397.901236 Mpixels/sec
357.434807 frames/sec - 398.897245 Mpixels/sec
347.815407 frames/sec - 388.161995 Mpixels/sec
$ optirun nvidia-smi
Fri Sep 15 18:38:17 2017
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 384.69                 Driver Version: 384.69                    |
|-------------------------------+----------------------+----------------------+
| 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    P0    N/A /  N/A |      6MiB /  4041MiB |      2%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID  Type  Process name                               Usage      |
|=============================================================================|
|    0     30920    G   /usr/lib/xorg/Xorg                               6MiB |
+-----------------------------------------------------------------------------+
Owner

whizzzkid commented Sep 16, 2017

@hlavki Here is the output for:

$ optirun glxgears
14096 frames in 5.0 seconds = 2819.109 FPS
11460 frames in 5.0 seconds = 2290.427 FPS
$ optirun ./glxspheres64
Polygons in scene: 62464 (61 spheres * 1024 polys/spheres)
Visual ID of window: 0x21
Context is Direct
OpenGL Renderer: GeForce GTX 1050/PCIe/SSE2
347.675228 frames/sec - 388.005555 Mpixels/sec
358.998031 frames/sec - 400.641803 Mpixels/sec
351.300209 frames/sec - 392.051033 Mpixels/sec
356.592040 frames/sec - 397.956717 Mpixels/sec
359.251480 frames/sec - 400.924652 Mpixels/sec
350.943396 frames/sec - 391.652830 Mpixels/sec
356.542326 frames/sec - 397.901236 Mpixels/sec
357.434807 frames/sec - 398.897245 Mpixels/sec
347.815407 frames/sec - 388.161995 Mpixels/sec
$ optirun nvidia-smi
Fri Sep 15 18:38:17 2017
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 384.69                 Driver Version: 384.69                    |
|-------------------------------+----------------------+----------------------+
| 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    P0    N/A /  N/A |      6MiB /  4041MiB |      2%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID  Type  Process name                               Usage      |
|=============================================================================|
|    0     30920    G   /usr/lib/xorg/Xorg                               6MiB |
+-----------------------------------------------------------------------------+
@hlavki

This comment has been minimized.

Show comment Hide comment
@hlavki

hlavki Sep 19, 2017

@whizzzkid thanks for reply. Can you please try to run:

optirun glxgears -fullscreen

I am getting low FPS:

227 frames in 5.0 seconds = 45.246 FPS
238 frames in 5.0 seconds = 47.571 FPS
235 frames in 5.0 seconds = 46.935 FPS
237 frames in 5.0 seconds = 47.285 FPS

hlavki commented Sep 19, 2017

@whizzzkid thanks for reply. Can you please try to run:

optirun glxgears -fullscreen

I am getting low FPS:

227 frames in 5.0 seconds = 45.246 FPS
238 frames in 5.0 seconds = 47.571 FPS
235 frames in 5.0 seconds = 46.935 FPS
237 frames in 5.0 seconds = 47.285 FPS
@rjcrystal

This comment has been minimized.

Show comment Hide comment
@rjcrystal

rjcrystal Sep 21, 2017

When i run optirun it says
[ 200.660549] [ERROR]No bridge found. Try installing primus or virtualgl.
I am using linux mint 18 with nvidia 940MX kernel 4.13.

When i run optirun it says
[ 200.660549] [ERROR]No bridge found. Try installing primus or virtualgl.
I am using linux mint 18 with nvidia 940MX kernel 4.13.

@Moulick

This comment has been minimized.

Show comment Hide comment
@Moulick

Moulick Sep 26, 2017

@whizzzkid Thank You. After Trying dozens of tutorials all over the internet, your's is the only one that worked reliably. I am so thankful to you for finally getting my GPU properly running selectively. I had very nearly given up on Linux and moved back to windows before your Gist solved everything.

Moulick commented Sep 26, 2017

@whizzzkid Thank You. After Trying dozens of tutorials all over the internet, your's is the only one that worked reliably. I am so thankful to you for finally getting my GPU properly running selectively. I had very nearly given up on Linux and moved back to windows before your Gist solved everything.

@mark-bucknell

This comment has been minimized.

Show comment Hide comment
@mark-bucknell

mark-bucknell Sep 29, 2017

I found that after I did this with 4.11 it worked fine but once I rebooted I got AHCI errors and cant use anything but my onboard graphics. Any suggestions?
I am temped to give 4.13 a go.

Further Details:
Ubuntu 16.04
Kernel: 4.11.2-041102-generic

Error on boot (doesn't stop booting)
ACPI Error: Namespace lookup failure, AE_NOT_FOUND.

Then when I attempt to shut down I get:
NMI watchdog: BUG: soft lockup - CPU#1 stuck....

I am keen to know what BIOS version everyone has.. I am running on v1.2.4 and im not sure if I need to upgrade or if that will cause me more headaches.

@whizzzkid

mark-bucknell commented Sep 29, 2017

I found that after I did this with 4.11 it worked fine but once I rebooted I got AHCI errors and cant use anything but my onboard graphics. Any suggestions?
I am temped to give 4.13 a go.

Further Details:
Ubuntu 16.04
Kernel: 4.11.2-041102-generic

Error on boot (doesn't stop booting)
ACPI Error: Namespace lookup failure, AE_NOT_FOUND.

Then when I attempt to shut down I get:
NMI watchdog: BUG: soft lockup - CPU#1 stuck....

I am keen to know what BIOS version everyone has.. I am running on v1.2.4 and im not sure if I need to upgrade or if that will cause me more headaches.

@whizzzkid

@bajubullet

This comment has been minimized.

Show comment Hide comment
@bajubullet

bajubullet Oct 15, 2017

@mark-bucknell I am getting the same errors, pls let me know if you find a solution. Also I have tried Manjaro, solus, Ubuntu 17:10, Elementary as well getting same errors on everyone.

@mark-bucknell I am getting the same errors, pls let me know if you find a solution. Also I have tried Manjaro, solus, Ubuntu 17:10, Elementary as well getting same errors on everyone.

@mark-bucknell

This comment has been minimized.

Show comment Hide comment
@mark-bucknell

mark-bucknell Oct 20, 2017

@bajubullet no such luck but I am keeping an eye on this thread

@bajubullet no such luck but I am keeping an eye on this thread

@whizzzkid

This comment has been minimized.

Show comment Hide comment
@whizzzkid

whizzzkid Nov 2, 2017

Sorry guys, I was away. Also I noticed, there was an update for nvidia-384 yesterday, I am not sure what it's supposed to do but it did not mess up anything.

Let me respond to you one by one:

@hlavki
Here is the output:

$ optirun glxgears -fullscreen
1035 frames in 5.0 seconds = 206.857 FPS
953 frames in 5.0 seconds = 190.546 FPS
1017 frames in 5.0 seconds = 203.210 FPS
1010 frames in 5.0 seconds = 201.939 FPS
1012 frames in 5.0 seconds = 202.285 FPS

@rjcrystal
During my initial setup I started by installing mint, and it had too much stuff missing, ubuntu sucked too. KDE Neon looked like the best contender as it had most of the stuff working out of the box. I am not sure what the error here is but do post if you find a solution, btw primux should have been installed when installing bumblebee.

@Moulick
thanks :)

@mark-bucknell
As far as I remember I was having problems with 4.11, I moved to 4.13 already. I am on 4.13.0-041300-generic also I am on bios 1.4 planning to go to 1.5 soon

Owner

whizzzkid commented Nov 2, 2017

Sorry guys, I was away. Also I noticed, there was an update for nvidia-384 yesterday, I am not sure what it's supposed to do but it did not mess up anything.

Let me respond to you one by one:

@hlavki
Here is the output:

$ optirun glxgears -fullscreen
1035 frames in 5.0 seconds = 206.857 FPS
953 frames in 5.0 seconds = 190.546 FPS
1017 frames in 5.0 seconds = 203.210 FPS
1010 frames in 5.0 seconds = 201.939 FPS
1012 frames in 5.0 seconds = 202.285 FPS

@rjcrystal
During my initial setup I started by installing mint, and it had too much stuff missing, ubuntu sucked too. KDE Neon looked like the best contender as it had most of the stuff working out of the box. I am not sure what the error here is but do post if you find a solution, btw primux should have been installed when installing bumblebee.

@Moulick
thanks :)

@mark-bucknell
As far as I remember I was having problems with 4.11, I moved to 4.13 already. I am on 4.13.0-041300-generic also I am on bios 1.4 planning to go to 1.5 soon

@mark-bucknell

This comment has been minimized.

Show comment Hide comment
@mark-bucknell

mark-bucknell Nov 7, 2017

So I just did the dell bios upgrade from v1.2.4 to 1.4.0 and I followed everything down to line 23. All looks good. I am now able to support 3 monitors (just) and the error message on shut down has gone. I still have an error message showing on startup but I know that is something to do with the linux kernel and ACPI so I'll wait for updates that will fix that.
@whizzzkid thankyou for maintaining this gist

So I just did the dell bios upgrade from v1.2.4 to 1.4.0 and I followed everything down to line 23. All looks good. I am now able to support 3 monitors (just) and the error message on shut down has gone. I still have an error message showing on startup but I know that is something to do with the linux kernel and ACPI so I'll wait for updates that will fix that.
@whizzzkid thankyou for maintaining this gist

@romainreignier

This comment has been minimized.

Show comment Hide comment
@romainreignier

romainreignier Nov 8, 2017

Hi,
Just to let you know, I have followed this tutorial a month ago when I have received my laptop.

I am using it daily with Kubuntu 16.04 + backports to get Plasma 5.08, Bios 1.5, Linux 4.13.8, Nvidia 387, Bumblebee...

I have about 7W in powertop on IDLE.

Options in GRUB:

acpi_rev_override=1 pcie_port_pm=off

Everything is fine, so thank you so much!

Hi,
Just to let you know, I have followed this tutorial a month ago when I have received my laptop.

I am using it daily with Kubuntu 16.04 + backports to get Plasma 5.08, Bios 1.5, Linux 4.13.8, Nvidia 387, Bumblebee...

I have about 7W in powertop on IDLE.

Options in GRUB:

acpi_rev_override=1 pcie_port_pm=off

Everything is fine, so thank you so much!

@whizzzkid

This comment has been minimized.

Show comment Hide comment
@whizzzkid

whizzzkid Nov 12, 2017

@mark-bucknell: good for you!

@romainreignier: cheers :) I am still on Driver Version: 384.98 because CUDA9.

Owner

whizzzkid commented Nov 12, 2017

@mark-bucknell: good for you!

@romainreignier: cheers :) I am still on Driver Version: 384.98 because CUDA9.

@dhfromkorea

This comment has been minimized.

Show comment Hide comment
@dhfromkorea

dhfromkorea Nov 13, 2017

I seek advice from you wise folks. I am having a hard time making this installation work with nvidia 384 (with cuda 8.0 ga_2 and libcudnn 6.0 on KDE Neon LTS 16.04) It seems kde neon does not like it atm because of this bug[1]

I tried rolling back to nvidia 375, but apt-get won't let me because 375 is a transitional version and automatically force-enable nvidia 384.

I tried installing nvidia 381, instead of 384, but cuda 8.0 deb installation forces -> nvidia 384.

Do you have any advice for a workaround I may try?

Also a dumb question--Is updating the kernel to 4.13 required for getting nvidia.384 to work?
[1] https://blog.martin-graesslin.com/blog/2017/08/warning-nvidia-driver-384-69-seems-to-be-broken-with-qtquick/

dhfromkorea commented Nov 13, 2017

I seek advice from you wise folks. I am having a hard time making this installation work with nvidia 384 (with cuda 8.0 ga_2 and libcudnn 6.0 on KDE Neon LTS 16.04) It seems kde neon does not like it atm because of this bug[1]

I tried rolling back to nvidia 375, but apt-get won't let me because 375 is a transitional version and automatically force-enable nvidia 384.

I tried installing nvidia 381, instead of 384, but cuda 8.0 deb installation forces -> nvidia 384.

Do you have any advice for a workaround I may try?

Also a dumb question--Is updating the kernel to 4.13 required for getting nvidia.384 to work?
[1] https://blog.martin-graesslin.com/blog/2017/08/warning-nvidia-driver-384-69-seems-to-be-broken-with-qtquick/

@whizzzkid

This comment has been minimized.

Show comment Hide comment
@whizzzkid

whizzzkid Nov 16, 2017

@dhfromkorea with this setup you will not be loading nvidia drivers when normally using the system. That bug is a problem when you're explicitly loading nvidia drivers at boot. Since this setup does not do that and instead loads them only when running a program with optirun it shouldn't be a problem.

Owner

whizzzkid commented Nov 16, 2017

@dhfromkorea with this setup you will not be loading nvidia drivers when normally using the system. That bug is a problem when you're explicitly loading nvidia drivers at boot. Since this setup does not do that and instead loads them only when running a program with optirun it shouldn't be a problem.

@jasonbeach

This comment has been minimized.

Show comment Hide comment
@jasonbeach

jasonbeach Nov 25, 2017

This is probably a dumb question, but what does bumblebee do? It sounds like it allows optionally use the nvidia card--ie take the output of the nvidia card and route it to the intel graphics unit. Why would you want to do this? Just for power savings or it there something else?

Thanks

This is probably a dumb question, but what does bumblebee do? It sounds like it allows optionally use the nvidia card--ie take the output of the nvidia card and route it to the intel graphics unit. Why would you want to do this? Just for power savings or it there something else?

Thanks

@littlewine

This comment has been minimized.

Show comment Hide comment
@littlewine

littlewine Nov 30, 2017

great gist @whizzzkid ! Many thanks.
After a lot of effort, black screens with no proper display adapter and reinstalls, I finally managed to get it properly working. For me, what was missing from the whole gist and caused trouble was sudo apt-get install primus. It gave me an errors something like "proper bridge missing".

Also, very useful for ML folks: Since you can run only what you need in your GPU, tensorflow and other ML and DL libraries are now faster than ever 👍
Just type optirun jupyter notebook and you are ready to go!

great gist @whizzzkid ! Many thanks.
After a lot of effort, black screens with no proper display adapter and reinstalls, I finally managed to get it properly working. For me, what was missing from the whole gist and caused trouble was sudo apt-get install primus. It gave me an errors something like "proper bridge missing".

Also, very useful for ML folks: Since you can run only what you need in your GPU, tensorflow and other ML and DL libraries are now faster than ever 👍
Just type optirun jupyter notebook and you are ready to go!

@saroele

This comment has been minimized.

Show comment Hide comment
@saroele

saroele Jan 8, 2018

Thanks for this excellent tutorial and for keeping it up to date! I had to do a complete reinstall of my laptop today but I had problems with the first step:

# Install Intel Graphics Patch Firmwares (This should reboot your system):
bash -c "$(curl -fsSL http://bit.ly/IGFWL-install)"

I solved it by making a local copy of that script and add cd /tmp in the beginning of the script.

saroele commented Jan 8, 2018

Thanks for this excellent tutorial and for keeping it up to date! I had to do a complete reinstall of my laptop today but I had problems with the first step:

# Install Intel Graphics Patch Firmwares (This should reboot your system):
bash -c "$(curl -fsSL http://bit.ly/IGFWL-install)"

I solved it by making a local copy of that script and add cd /tmp in the beginning of the script.

@geertw

This comment has been minimized.

Show comment Hide comment
@geertw

geertw Jan 11, 2018

For nvidia-387 and kernel 3.14 I had to install libelf-dev before dkms would build a kernel module.

geertw commented Jan 11, 2018

For nvidia-387 and kernel 3.14 I had to install libelf-dev before dkms would build a kernel module.

@scrat98

This comment has been minimized.

Show comment Hide comment
@scrat98

scrat98 Jan 13, 2018

@whizzzkid

This comment has been minimized.

Show comment Hide comment
@whizzzkid

whizzzkid Jan 18, 2018

@jasonbeach bumblebee keeps nvidia off for most of the time. If you need to run some application which would require access to cuda, you can simply run it using $ optirun [any app]

@littlewine You're welcome :)

@saroele did you have curl installed?

@geertw updated the gist with kernel 4.14.13 and Cuda 9.1

Owner

whizzzkid commented Jan 18, 2018

@jasonbeach bumblebee keeps nvidia off for most of the time. If you need to run some application which would require access to cuda, you can simply run it using $ optirun [any app]

@littlewine You're welcome :)

@saroele did you have curl installed?

@geertw updated the gist with kernel 4.14.13 and Cuda 9.1

@theo-m

This comment has been minimized.

Show comment Hide comment
@theo-m

theo-m Jan 29, 2018

Hi @whizzzkid,

I managed to do a working install a few months ago following your gist, but I've reinstalled my system and can't get anything working now, it seems I've fell multiple times in kernel # and drivers # that don't work together. Do you have a definite list of such couples that actually work? I've observed bad performances with X with kernels >= 4.13 and I'm therefore running with 4.10 (which doesn't work with nvidia-384).

Thanks for your work, it's been a real help.

theo-m commented Jan 29, 2018

Hi @whizzzkid,

I managed to do a working install a few months ago following your gist, but I've reinstalled my system and can't get anything working now, it seems I've fell multiple times in kernel # and drivers # that don't work together. Do you have a definite list of such couples that actually work? I've observed bad performances with X with kernels >= 4.13 and I'm therefore running with 4.10 (which doesn't work with nvidia-384).

Thanks for your work, it's been a real help.

@wolny

This comment has been minimized.

Show comment Hide comment
@wolny

wolny Jan 31, 2018

great stuff! Especially the boot config (GRUB_CMDLINE_LINUX_DEFAULT)

wolny commented Jan 31, 2018

great stuff! Especially the boot config (GRUB_CMDLINE_LINUX_DEFAULT)

@MatthiasSiewert

This comment has been minimized.

Show comment Hide comment
@MatthiasSiewert

MatthiasSiewert Feb 11, 2018

@paines For those stuck with a failed Xorg-server. I managed to recover by uninstalling all packages mentioned above and do

ubuntu-drivers autoinstall

from the recovery mode.
Its a nice guide. I got as far as having cuda running. Then gave up after three attempts to fix the rest. Could be that it doesn't work with gnome?!?

MatthiasSiewert commented Feb 11, 2018

@paines For those stuck with a failed Xorg-server. I managed to recover by uninstalling all packages mentioned above and do

ubuntu-drivers autoinstall

from the recovery mode.
Its a nice guide. I got as far as having cuda running. Then gave up after three attempts to fix the rest. Could be that it doesn't work with gnome?!?

@fayazkhan

This comment has been minimized.

Show comment Hide comment
@fayazkhan

fayazkhan Feb 27, 2018

Thanks for this!
I did this because my laptop had heating issues because of nvidia always being on. Now it's staying really cool!
Also, in my case, using primusrun instead of optirun gave me better performance for steam.

Thanks for this!
I did this because my laptop had heating issues because of nvidia always being on. Now it's staying really cool!
Also, in my case, using primusrun instead of optirun gave me better performance for steam.

@fayazkhan

This comment has been minimized.

Show comment Hide comment
@fayazkhan

fayazkhan Apr 7, 2018

@whizzzkid, my setup has stopped working suddenly. I had an abrupt shutdown while steam with primusrun was live.

Then, when I try to start steam again, it just runs the updater and quits.

$ primusrun steam
/usr/bin/primusrun: line 41: warning: command substitution: ignored null byte in input                                                                        
Running Steam on ubuntu 17.10 64-bit                                                                                                                          
STEAM_RUNTIME is enabled automatically
Pins up-to-date!
[2018-04-07 21:44:12] Startup - updater built Apr  2 2018 15:23:43
Looks like steam didn't shutdown cleanly, scheduling immediate update check
[2018-04-07 21:44:13] Checking for update on startup
[2018-04-07 21:44:13] Checking for available updates...
[2018-04-07 21:44:14] Download skipped: /client/steam_client_ubuntu12 version 1522709999, installed version 1522709999
[2018-04-07 21:44:14] Nothing to do
[2018-04-07 21:44:14] Verifying installation...
[2018-04-07 21:44:14] Performing checksum verification of executable files
[2018-04-07 21:44:15] Verification complete
$

This doesn't happen when running steam in intel or with optirun, but the performance is just not there.

Also I am seeing some weird dmesg output too.

[ 4265.046654] ldconfig.real[17704]: segfault at 338 ip 000000000049c5a7 sp 00007ffd43442710 error 4 in ldconfig.real[400000+e2000]
[ 4265.193360] bbswitch: enabling discrete graphics
[ 4265.407318] nvidia-nvlink: Nvlink Core is being initialized, major device number 239
[ 4265.407797] NVRM: loading NVIDIA UNIX x86_64 Kernel Module  390.48  Thu Mar 22 00:42:57 PDT 2018 (using threaded interrupts)
[ 4266.463078] nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms  390.48  Wed Mar 21 23:48:34 PDT 2018
[ 4266.479341] nvidia-uvm: Loaded the UVM driver in 8 mode, major device number 238
[ 4266.509646] nvidia-modeset: Allocated GPU:0 (GPU-e67ebdca-1dc6-cc63-e15c-c63297995ddf) @ PCI:0000:01:00.0
[ 4266.509799] nvidia-modeset: Freed GPU:0 (GPU-e67ebdca-1dc6-cc63-e15c-c63297995ddf) @ PCI:0000:01:00.0
[ 4266.568571] nvidia-modeset: Allocated GPU:0 (GPU-e67ebdca-1dc6-cc63-e15c-c63297995ddf) @ PCI:0000:01:00.0
[ 4266.568720] nvidia-modeset: Freed GPU:0 (GPU-e67ebdca-1dc6-cc63-e15c-c63297995ddf) @ PCI:0000:01:00.0
[ 4268.457375] steam[17728]: segfault at a8 ip 00000000f75c8f83 sp 00000000ffd95e10 error 4 in libGL.so.390.48[f7547000+c5000]
[ 4268.582475] nvidia-modeset: Unloading
[ 4268.611549] nvidia-uvm: Unloaded the UVM driver in 8 mode
[ 4268.639389] nvidia-nvlink: Unregistered the Nvlink Core, major device number 239
[ 4268.697497] bbswitch: disabling discrete graphics
[ 4268.714983] pci 0000:01:00.0: Refused to change power state, currently in D0
[ 4273.194150] bbswitch: enabling discrete graphics
[ 4273.417666] nvidia-nvlink: Nvlink Core is being initialized, major device number 239
[ 4273.418106] NVRM: loading NVIDIA UNIX x86_64 Kernel Module  390.48  Thu Mar 22 00:42:57 PDT 2018 (using threaded interrupts)
[ 4274.474290] nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms  390.48  Wed Mar 21 23:48:34 PDT 2018
[ 4274.491723] nvidia-uvm: Loaded the UVM driver in 8 mode, major device number 238
[ 4274.523783] nvidia-modeset: Allocated GPU:0 (GPU-e67ebdca-1dc6-cc63-e15c-c63297995ddf) @ PCI:0000:01:00.0
[ 4274.523930] nvidia-modeset: Freed GPU:0 (GPU-e67ebdca-1dc6-cc63-e15c-c63297995ddf) @ PCI:0000:01:00.0
[ 4274.575560] nvidia-modeset: Unloading
[ 4274.640395] nvidia-uvm: Unloaded the UVM driver in 8 mode
[ 4274.659580] nvidia-nvlink: Unregistered the Nvlink Core, major device number 239
[ 4274.693555] bbswitch: disabling discrete graphics
[ 4274.711057] pci 0000:01:00.0: Refused to change power state, currently in D0

@whizzzkid, my setup has stopped working suddenly. I had an abrupt shutdown while steam with primusrun was live.

Then, when I try to start steam again, it just runs the updater and quits.

$ primusrun steam
/usr/bin/primusrun: line 41: warning: command substitution: ignored null byte in input                                                                        
Running Steam on ubuntu 17.10 64-bit                                                                                                                          
STEAM_RUNTIME is enabled automatically
Pins up-to-date!
[2018-04-07 21:44:12] Startup - updater built Apr  2 2018 15:23:43
Looks like steam didn't shutdown cleanly, scheduling immediate update check
[2018-04-07 21:44:13] Checking for update on startup
[2018-04-07 21:44:13] Checking for available updates...
[2018-04-07 21:44:14] Download skipped: /client/steam_client_ubuntu12 version 1522709999, installed version 1522709999
[2018-04-07 21:44:14] Nothing to do
[2018-04-07 21:44:14] Verifying installation...
[2018-04-07 21:44:14] Performing checksum verification of executable files
[2018-04-07 21:44:15] Verification complete
$

This doesn't happen when running steam in intel or with optirun, but the performance is just not there.

Also I am seeing some weird dmesg output too.

[ 4265.046654] ldconfig.real[17704]: segfault at 338 ip 000000000049c5a7 sp 00007ffd43442710 error 4 in ldconfig.real[400000+e2000]
[ 4265.193360] bbswitch: enabling discrete graphics
[ 4265.407318] nvidia-nvlink: Nvlink Core is being initialized, major device number 239
[ 4265.407797] NVRM: loading NVIDIA UNIX x86_64 Kernel Module  390.48  Thu Mar 22 00:42:57 PDT 2018 (using threaded interrupts)
[ 4266.463078] nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms  390.48  Wed Mar 21 23:48:34 PDT 2018
[ 4266.479341] nvidia-uvm: Loaded the UVM driver in 8 mode, major device number 238
[ 4266.509646] nvidia-modeset: Allocated GPU:0 (GPU-e67ebdca-1dc6-cc63-e15c-c63297995ddf) @ PCI:0000:01:00.0
[ 4266.509799] nvidia-modeset: Freed GPU:0 (GPU-e67ebdca-1dc6-cc63-e15c-c63297995ddf) @ PCI:0000:01:00.0
[ 4266.568571] nvidia-modeset: Allocated GPU:0 (GPU-e67ebdca-1dc6-cc63-e15c-c63297995ddf) @ PCI:0000:01:00.0
[ 4266.568720] nvidia-modeset: Freed GPU:0 (GPU-e67ebdca-1dc6-cc63-e15c-c63297995ddf) @ PCI:0000:01:00.0
[ 4268.457375] steam[17728]: segfault at a8 ip 00000000f75c8f83 sp 00000000ffd95e10 error 4 in libGL.so.390.48[f7547000+c5000]
[ 4268.582475] nvidia-modeset: Unloading
[ 4268.611549] nvidia-uvm: Unloaded the UVM driver in 8 mode
[ 4268.639389] nvidia-nvlink: Unregistered the Nvlink Core, major device number 239
[ 4268.697497] bbswitch: disabling discrete graphics
[ 4268.714983] pci 0000:01:00.0: Refused to change power state, currently in D0
[ 4273.194150] bbswitch: enabling discrete graphics
[ 4273.417666] nvidia-nvlink: Nvlink Core is being initialized, major device number 239
[ 4273.418106] NVRM: loading NVIDIA UNIX x86_64 Kernel Module  390.48  Thu Mar 22 00:42:57 PDT 2018 (using threaded interrupts)
[ 4274.474290] nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms  390.48  Wed Mar 21 23:48:34 PDT 2018
[ 4274.491723] nvidia-uvm: Loaded the UVM driver in 8 mode, major device number 238
[ 4274.523783] nvidia-modeset: Allocated GPU:0 (GPU-e67ebdca-1dc6-cc63-e15c-c63297995ddf) @ PCI:0000:01:00.0
[ 4274.523930] nvidia-modeset: Freed GPU:0 (GPU-e67ebdca-1dc6-cc63-e15c-c63297995ddf) @ PCI:0000:01:00.0
[ 4274.575560] nvidia-modeset: Unloading
[ 4274.640395] nvidia-uvm: Unloaded the UVM driver in 8 mode
[ 4274.659580] nvidia-nvlink: Unregistered the Nvlink Core, major device number 239
[ 4274.693555] bbswitch: disabling discrete graphics
[ 4274.711057] pci 0000:01:00.0: Refused to change power state, currently in D0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment