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.

9
  • 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! Jan 9, 2016 at 20:58
  • Sorry, still get the same build error; in make.log: "stack-protector enabled but compiler support broken".
    – fgordon
    Jan 9, 2016 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. Jan 10, 2016 at 16:21
  • Thank you. I tried the new kernel, same problem. Have reported to launchpad. bugs.launchpad.net/ubuntu/+source/bbswitch/+bug/1532538 answers.launchpad.net/ubuntu/+source/bbswitch/+question/280808
    – fgordon
    Jan 10, 2016 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. Jan 10, 2016 at 16:42

1 Answer 1

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 ...

10
  • Thank you for your respone! I have tried nvidia-primus but I get a similar error where a kernel module cannot build. I don't remember exactly which one.
    – fgordon
    Jan 9, 2016 at 17:28
  • @Fredrik : Which NVIDIA card do you have ?
    – cl-netbox
    Jan 9, 2016 at 17:29
  • NVIDIA Corporation GF119M [GeForce GT 520M]
    – fgordon
    Jan 9, 2016 at 17:31
  • @Fredrik : Please try the alternative from the updated answer ... important is that you remove every NVIDIA related software before ! :)
    – cl-netbox
    Jan 9, 2016 at 17:44
  • Sorry it did not work. I get the same build error as before, both for nividia-358 and bbswitch. I think this has something to do with the kernel or compilers, like gcc.
    – fgordon
    Jan 9, 2016 at 18:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .