Bumblebee-Project / Bumblebee

Bumblebee daemon and client rewritten in C
http://www.bumblebee-project.org/
GNU General Public License v3.0
1.29k stars 142 forks source link

Ubuntu 16.04 Nvidia GeForce GT 540M: Cannot access secondary GPU - error: Could not load GPU driver #834

Closed jpeacock29 closed 7 years ago

jpeacock29 commented 7 years ago

OS: Ubuntu 16.04 Kernel: 4.4.0-59-generic Graphics card: Nvidia GeForce GT 540M Laptop: Toshiba Satellite P755-S5269

Since I've been messing with this extensively, I started with a clean slate by running

$ sudo apt-get purge bumblebee bumblebee-nvidia primus linux-headers-generic nvidia-*
$ sudo apt-get install bumblebee bumblebee-nvidia primus linux-headers-generic

At this point,

$ optirun steam
[  440.517159] [ERROR]Cannot access secondary GPU - error: Could not load GPU driver

[  440.517283] [ERROR]Aborting because fallback start is disabled.

Per internet wisdom, I reconfiguring /etc/bumblebee/bumblebee.conf to use the installed driver nvidia-304 and restarting, but to no avail (below). The above error persists.

$ cat /etc/bumblebee/bumblebee.conf
# Configuration file for Bumblebee. Values should **not** be put between quotes

## Server options. Any change made in this section will need a server restart
# to take effect.
[bumblebeed]
# The secondary Xorg server DISPLAY number
VirtualDisplay=:8
# Should the unused Xorg server be kept running? Set this to true if waiting
# for X to be ready is too long and don't need power management at all.
KeepUnusedXServer=false
# The name of the Bumbleblee server group name (GID name)
ServerGroup=bumblebee
# Card power state at exit. Set to false if the card shoud be ON when Bumblebee
# server exits.
TurnCardOffAtExit=false
# The default behavior of '-f' option on optirun. If set to "true", '-f' will
# be ignored.
NoEcoModeOverride=false
# The Driver used by Bumblebee server. If this value is not set (or empty),
# auto-detection is performed. The available drivers are nvidia and nouveau
# (See also the driver-specific sections below)
Driver=nvidia
# Directory with a dummy config file to pass as a -configdir to secondary X
XorgConfDir=/etc/bumblebee/xorg.conf.d

## Client options. Will take effect on the next optirun executed.
[optirun]
# Acceleration/ rendering bridge, possible values are auto, virtualgl and
# primus.
Bridge=auto
# The method used for VirtualGL to transport frames between X servers.
# Possible values are proxy, jpeg, rgb, xv and yuv.
VGLTransport=proxy
# List of paths which are searched for the primus libGL.so.1 when using
# the primus bridge
PrimusLibraryPath=/usr/lib/x86_64-linux-gnu/primus:/usr/lib/i386-linux-gnu/primus
# Should the program run under optirun even if Bumblebee server or nvidia card
# is not available?
AllowFallbackToIGC=false

# Driver-specific settings are grouped under [driver-NAME]. The sections are
# parsed if the Driver setting in [bumblebeed] is set to NAME (or if auto-
# detection resolves to NAME).
# PMMethod: method to use for saving power by disabling the nvidia card, valid
# values are: auto - automatically detect which PM method to use
#         bbswitch - new in BB 3, recommended if available
#       switcheroo - vga_switcheroo method, use at your own risk
#             none - disable PM completely
# https://github.com/Bumblebee-Project/Bumblebee/wiki/Comparison-of-PM-methods

## Section with nvidia driver specific options, only parsed if Driver=nvidia
[driver-nvidia]
# Module name to load, defaults to Driver if empty or unset
KernelDriver=nvidia
PMMethod=auto
# colon-separated path to the nvidia libraries
LibraryPath=/usr/lib/nvidia-304:/usr/lib32/nvidia-304
# comma-separated path of the directory containing nvidia_drv.so and the
# default Xorg modules path
XorgModulePath=/usr/lib/nvidia-304/xorg,/usr/lib/xorg/modules
XorgConfFile=/etc/bumblebee/xorg.conf.nvidia

## Section with nouveau driver specific options, only parsed if Driver=nouveau
[driver-nouveau]
KernelDriver=nouveau
PMMethod=auto
XorgConfFile=/etc/bumblebee/xorg.conf.nouveau

bumblebee-bugreport-20170118_182139.tar.gz

Lekensteyn commented 7 years ago

This part from your bumblebee-bugreport looks worrying:

=== Modules information ===
...
modinfo: ERROR: Module nvidia not found.

and from your syslog:

Jan 18 18:20:13 jacob-Satellite-P755 bumblebeed[2908]: [  438.109506] [INFO]/usr/sbin/bumblebeed 3.2.1 started
...
Jan 18 18:20:16 jacob-Satellite-P755 bumblebeed[2908]: modprobe: ERROR: ../libkmod/libkmod-module.c:832 kmod_module_insert_module() could not find module by name='nvidia'
Jan 18 18:20:16 jacob-Satellite-P755 bumblebeed[2908]: modprobe: ERROR: could not insert 'nvidia': Unknown symbol in module, or unknown parameter (see dmesg)
Jan 18 18:20:16 jacob-Satellite-P755 bumblebeed[2908]: [  440.516997] [ERROR]Module nvidia could not be loaded (timeout?)
Jan 18 18:20:16 jacob-Satellite-P755 bumblebeed[2908]: [  440.517042] [ERROR]Could not load GPU driver

Can you try changing KernelDriver=nvidia-304 under [driver-nvidia]? Some auto-detection probably failed, but this is an easy workaround.

bluca commented 7 years ago

Yes autodetection always fails for me on Ubuntu too, it's due to how the drivers are packaged there. Explicitly setting the version fixes it.

jpeacock29 commented 7 years ago

Made this change, but now get

[  452.348598] [ERROR]Cannot access secondary GPU - error: [XORG] (EE) 

[  452.348695] [ERROR]Aborting because fallback start is disabled.

From syslog,

[ERROR]X did not start properly

Any idea where to go from here, or should this be a new issue?

bumblebee-bugreport-20170124_214511.tar.gz

bluca commented 7 years ago

You have the modprobe problems due to multiple modules according to the log. Given you are on Ubuntu 16.04, please try the testing PPA which has the patches to fix it: https://launchpad.net/~bumblebee/+archive/ubuntu/testing?field.series_filter=xenial

jpeacock29 commented 7 years ago

Added the testing PPA and updated /etc/bumblebee/bumblebee.conf as before and everything is working great. Thanks so much for your help @bluca and @Lekensteyn!

For reference:

$ cat /etc/bumblebee/bumblebee.conf
# Configuration file for Bumblebee. Values should **not** be put between quotes

## Server options. Any change made in this section will need a server restart
# to take effect.
[bumblebeed]
# The secondary Xorg server DISPLAY number
VirtualDisplay=:8
# Should the unused Xorg server be kept running? Set this to true if waiting
# for X to be ready is too long and don't need power management at all.
KeepUnusedXServer=false
# The name of the Bumbleblee server group name (GID name)
ServerGroup=bumblebee
# Card power state at exit. Set to false if the card shoud be ON when Bumblebee
# server exits.
TurnCardOffAtExit=false
# The default behavior of '-f' option on optirun. If set to "true", '-f' will
# be ignored.
NoEcoModeOverride=false
# The Driver used by Bumblebee server. If this value is not set (or empty),
# auto-detection is performed. The available drivers are nvidia and nouveau
# (See also the driver-specific sections below)
Driver=nvidia
# Directory with a dummy config file to pass as a -configdir to secondary X
XorgConfDir=/etc/bumblebee/xorg.conf.d
# Xorg binary to run
XorgBinary=/usr/lib/xorg/Xorg

## Client options. Will take effect on the next optirun executed.
[optirun]
# Acceleration/ rendering bridge, possible values are auto, virtualgl and
# primus.
Bridge=auto
# The method used for VirtualGL to transport frames between X servers.
# Possible values are proxy, jpeg, rgb, xv and yuv.
VGLTransport=proxy
# List of paths which are searched for the primus libGL.so.1 when using
# the primus bridge
PrimusLibraryPath=/usr/lib/x86_64-linux-gnu/primus:/usr/lib/i386-linux-gnu/primus
# Should the program run under optirun even if Bumblebee server or nvidia card
# is not available?
AllowFallbackToIGC=false

# Driver-specific settings are grouped under [driver-NAME]. The sections are
# parsed if the Driver setting in [bumblebeed] is set to NAME (or if auto-
# detection resolves to NAME).
# PMMethod: method to use for saving power by disabling the nvidia card, valid
# values are: auto - automatically detect which PM method to use
#         bbswitch - new in BB 3, recommended if available
#       switcheroo - vga_switcheroo method, use at your own risk
#             none - disable PM completely
# https://github.com/Bumblebee-Project/Bumblebee/wiki/Comparison-of-PM-methods

## Section with nvidia driver specific options, only parsed if Driver=nvidia
[driver-nvidia]
# Module name to load, defaults to Driver if empty or unset
KernelDriver=nvidia-304
PMMethod=auto
# colon-separated path to the nvidia libraries
LibraryPath=/usr/lib/nvidia-304:/usr/lib32/nvidia-304
# comma-separated path of the directory containing nvidia_drv.so and the
# default Xorg modules path
XorgModulePath=/usr/lib/nvidia-304/xorg,/usr/lib/xorg/modules
XorgConfFile=/etc/bumblebee/xorg.conf.nvidia

## Section with nouveau driver specific options, only parsed if Driver=nouveau
[driver-nouveau]
KernelDriver=nouveau
PMMethod=auto
XorgConfFile=/etc/bumblebee/xorg.conf.nouveau
bluca commented 7 years ago

No problem!