3

I have an Nvidia Optimus graphic card installed and have the Nvidia driver installed and working for my Intel card, but I cannot switch to the Nvidia card. This is because bbswitch-dkms will not build during install via apt-get or from source.

My system

  • Ubuntu 14.04.3 LTS
  • NVIDIA Corporation GF119M [GeForce GT 520M]
  • linux-image-3.19.0-42-generic
  • linux-headers-3.19.0-42-generic
  • linux-image-extra-3.19.0-42-generic
  • dkms: 2.2.0.3
  • gcc (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4

Installation command used:

sudo apt-get install bumblebee bumblebee-nvidia primus nvidia-352

Dependency for above packages is, among others, bbswitch-dkms. When trying to install bbswitch the following error occurs:

Unpacking bbswitch-dkms (0.7-2ubuntu1) over (0.7-2ubuntu1) ...
Setting up bbswitch-dkms (0.7-2ubuntu1) ...
Loading new bbswitch-0.7 DKMS files...
Building only for 3.19.0-42-generic
Building initial module for 3.19.0-42-generic
Error! Bad return status for module build on kernel: 3.19.0-42-generic (x86_64)
Consult /var/lib/dkms/bbswitch/0.7/build/make.log for more information.

The content of make.log is:

DKMS make.log for bbswitch-0.7 for kernel 3.19.0-42-generic (x86_64)
lör  9 jan 2016 15:37:02 CET
make -C /lib/modules/3.19.0-42-generic/build M="$(pwd)" modules
make[1]: Entering directory `/usr/src/linux-headers-3.19.0-42-generic'
arch/x86/Makefile:114: stack-protector enabled but compiler support broken
  CC [M]  /var/lib/dkms/bbswitch/0.7/build/bbswitch.o
/var/lib/dkms/bbswitch/0.7/build/bbswitch.c: In function ‘is_card_disabled’:
/var/lib/dkms/bbswitch/0.7/build/bbswitch.c:236:1: internal compiler error: Bus error
 }
 ^

It seems this is the main problem:

make[1]: Entering directory `/usr/src/linux-headers-3.19.0-42-generic'
arch/x86/Makefile:114: stack-protector enabled but compiler support broken

I have installed kernel-header so all building packages should be installed.

Has anyone encountered this before or know of any solutions?

Thank you!

Update 1

The following log entries appear in syslog during installation and building bbswitch-dkms:

kernel: [  235.068506] ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
kernel: [  235.071273] ata1.00: irq_stat 0x40000001
kernel: [  235.074011] ata1.00: failed command: READ DMA
kernel: [  235.076740] ata1.00: cmd c8/00:08:a8:95:07/00:00:00:00:00/e0 tag 27 dma 4096 in
kernel: [  235.076740]          res 51/40:00:a8:95:07/00:00:00:00:00/00 Emask 0x9 (media error)
kernel: [  235.082207] ata1.00: status: { DRDY ERR }
kernel: [  235.084957] ata1.00: error: { UNC }
kernel: [  235.119639] ata1.00: configured for UDMA/133
kernel: [  235.119667] sd 0:0:0:0: [sda] FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
kernel: [  235.119674] sd 0:0:0:0: [sda] Sense Key : Medium Error [current] [descriptor]
kernel: [  235.119680] sd 0:0:0:0: [sda] Add. Sense: Unrecovered read error - auto reallocate failed
kernel: [  235.119684] sd 0:0:0:0: [sda] CDB: 
kernel: [  235.119687] Read(10): 28 00 00 07 95 a8 00 00 08 00
kernel: [  235.119704] blk_update_request: I/O error, dev sda, sector 497064
kernel: [  235.122090] ata1: EH complete

Update 2

Launchpad question:

https://answers.launchpad.net/ubuntu/+source/bbswitch/+question/280808

Launchpad bug report:

https://bugs.launchpad.net/ubuntu/+source/bbswitch/+bug/1532538

Solved

This is solved. See launchpad question for solution.

fgordon
  • 31
  • hmm you may try adding ppa:bumblebee/stable to your repositories, that has a more recent version of bbswitch/bumblebee: sudo add-apt-repository ppa:bumblebee/stable that may solve your problem, also make sure you have kernel headers installed! – philsegeler Jan 09 '16 at 20:58
  • Sorry, still get the same build error; in make.log: "stack-protector enabled but compiler support broken". – fgordon Jan 09 '16 at 21:25
  • new kernel came out 3.19-0-43, you may try that one, also report that to launchpad, it is a critical bug. – philsegeler Jan 10 '16 at 16:21
  • Thank you. I tried the new kernel, same problem. Have reported to launchpad.

    https://bugs.launchpad.net/ubuntu/+source/bbswitch/+bug/1532538 https://answers.launchpad.net/ubuntu/+source/bbswitch/+question/280808

    – fgordon Jan 10 '16 at 16:23
  • i see this happen to you with other kernel modules (such as nvidia-358), right? Did bbswitch work before on older kernels? At least i can confirm it works for me on 3.19.0-30. – philsegeler Jan 10 '16 at 16:42
  • According to this link, make sure you have build-essentials installed http://ubuntuforums.org/showthread.php?t=1793162 – philsegeler Jan 10 '16 at 16:48
  • I have not tried older kernels yet. Did a fresh install of 14.04 and did all the upgrading. It dose not matter which nvidia driver I use, bbswitch won't build correctly. I ran Debian until recently and it worked fine, don't remember which kernel version thou. – fgordon Jan 10 '16 at 16:49
  • build-essentials are installed: build-essential 11.6ubuntu6 – fgordon Jan 10 '16 at 16:51
  • i suggest you install 3.19.0-30 use the link for instructions http://askubuntu.com/questions/668274/downgrade-kernel-3-19-0-26-generic-to-3-13-0-62-generic if this doesnt work for you, then sth is seriously messed up – philsegeler Jan 15 '16 at 14:55

1 Answers1

0

Use nvidia-prime instead of bumblebee to switch between integrated and dedicated graphics.

Uninstall all NVIDIA software and bumblebee.

Open a terminal and execute :

sudo apt-get purge nvidia* bumblebee  
sudo reboot  

Reinstall the NVIDIA drivers and nvidia-prime.

Open a terminal and execute :

sudo apt-get update
sudo apt-get install nvidia-352 nvidia-prime
sudo reboot  

Open NVIDIA X Server Settings - PRIME Profiles to switch between the two graphics adapters.

Update 1 :

Alternatively install the latest official NVIDIA drivers 358 from the Proprietary GPU Drivers PPA.

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
sudo apt-get install nvidia-358 nvidia-prime
sudo reboot  

Update 2 :

Maybe there is a compatibility issue or some interference with the open source nouveau drivers.
Perform the NVIDIA drivers installation from a virtual console with deactivated nouveau drivers.

Highlight the Ubuntu entry in the GRUB boot menu and press the E key.
Add nouveau.modeset=0 to the end of the linux line - press F10 to boot.
On login screen press Ctrl+Alt+F1 - enter user name and password ...
Execute the commands ...

cl-netbox
  • 31,163
  • 7
  • 94
  • 131