New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues when using bumblebee with nvidia-driver-390 in Ubuntu 18.04 #951

Open
rockorequin opened this Issue Mar 23, 2018 · 54 comments

Comments

Projects
None yet
@rockorequin

rockorequin commented Mar 23, 2018

bumblebee doesn't work out of the box with Ubuntu's nvidia-driver-390, which I guess is using libglvnd0:

a) I needed to blacklist more drivers via /etc/modprobe.d/ to stop the nvidia driver loading, specifically nvidia_drm and nvidia_modeset. i think "prime-select intel" will also do this if you have nvidia-prime installed.

b) Some paths needed changing in /etc/bumblebee/bumblebee.conf in the [driver-nvidia] section:

LibraryPath=/usr/lib/x86_64-linux-gnu:/usr/lib/i386-linux-gnu
XorgModulePath=/usr/lib/x86_64-linux-gnu/nvidia/xorg,/usr/lib/xorg/modules,/usr/lib/xorg/modules/input

With these changes, I can run both 32 bit and 64 bit apps using optirun (but not primusrun) in a X11 gnome-shell session.

There are two other issues I ran into:

  1. If I boot with nvidia-drm.modeset=1 in the grub command line, running optirun makes the entire laptop hang (I think this is a bug in the nvidia driver, which is crashing with a divide-by-zero error, and this takes down X and I can't switch to a tty console). It runs OK if I don't boot with nvidia-drm.modeset=1 or if I boot with nvidia-drm.modeset=0.

  2. bumblebee can turn the nvidia card off when it starts, but as soon as the nvidia module is loaded, it loads nvidia_drm, which links to drm_kms_helper and then bumblebee can't remove the nvidia modules. This means that bumblebee can't turn off the nvidia card when optirun terminates. To fix this, I added "alias nvidia_drm off" and "alias nvidia_modeset off" to my conf file in /etc/modprobe.d. So I have this file:

$ cat /etc/modprobe.d/nvidia.conf 
blacklist nvidia
blacklist nvidia_drm
blacklist nvidia_modeset
alias nvidia_drm off
alias nvidia_modeset off

@DRosky

This comment has been minimized.

DRosky commented Mar 23, 2018

I just began having a similar problem.

I am using OpenSuse Tumbleweed, and after a few recent updates (to kernel 4.15.10, and to nvidia driver 390.42 from 390.25), I noticed that bumblebee has recently stopped being able to turn off the GPU once it is turned on.

I had also narrowed the problem down to the nvidia_drm module as the one which becomes "locked" in use despite the fact that lsmod does not show any other module to be dependent on it. On my system at least, lsmod does not show that nvidia_drm is being used by drm_kms_helper, it shows nothing, although the use count is still 1. Something has changed either in recent kernels or in the nvidia driver that causes the module to always be in use once loaded and this is disrupting the operation of bumblebee.

I tried the workaround suggested by @rockorequin and it does work, but I'm wondering if there is any downside to it? Optirun seems to work, and the GPU does now turn off, but will there be any missing functionality by completely disabling the nvidia_drm and nvidia_modeset modules?

@rockorequin

This comment has been minimized.

rockorequin commented Mar 23, 2018

If you're just using bumblebee/optirun/primus and not PRIME, I don't think you'll lose anything important at this stage. See https://us.download.nvidia.com/XFree86/Linux-x86/390.42/README/kms.html for a description of the modules: they are still considered experimental and aren't fully implemented. I believe modeset lets you change the screen resolution using the kernel, which results in flicker-free resolution changes, but my guess is that the intel module is doing that with optirun/primus (so you actually want i915.modeset=1 in your boot line).

@bluca

This comment has been minimized.

Member

bluca commented Mar 23, 2018

On Debian I forced non-glvnd with bumblebee as they caused too much problems. I'm not a maintainer of the Nvidia drivers in Ubuntu so can't do much there I'm afraid - if possible I suggest to switch to non-glvnd.

@DRosky

This comment has been minimized.

DRosky commented Mar 23, 2018

I believe modeset lets you change the screen resolution using the kernel, which results in flicker-free resolution changes, but my guess is that the intel module is doing that with optirun/primus (so you actually want i915.modeset=1 in your boot line).

That sounds reasonable. One possible thing of concern from the page you linked is that the drm module is apparently needed for atomic mode setting required by Wayland, but if, as you point out, the actual mode setting in an virtualgl or primus environment is being done by the intel driver, then it may not be an issue. I'm not running Wayland so can't immediately test out whether disabling Nvidia drm causes a problem there.

Ultimately, it's probably good to figure out the root cause and see if there is a solution for it, but with the work-around, it's not that urgent.

@powderluv

This comment has been minimized.

powderluv commented Mar 28, 2018

I am running into the same issue with bumblebee and nvidia 390. How are you able to track which kernel module is causing the problem ? I get a hard freeze of the system and I have to go to recovery and uninstall bumblebee to recover

@rockorequin

This comment has been minimized.

rockorequin commented Mar 29, 2018

@powderluv: do you mean the hard freeze that I mentioned if I have nvidia.modeset=1 in the kernel boot parameters? This one is caused by a bug in the nvidia module. Do you still get a hard freeze if you put nvidia.modeset=0 in your kernel boot parameters? (If you're using Ubuntu, https://askubuntu.com/questions/19486/how-do-i-add-a-kernel-boot-parameter shows how to do this.)

@powderluv

This comment has been minimized.

powderluv commented Apr 6, 2018

@rockorequin I see it with nvidia.modeset=0

@klebed

This comment has been minimized.

klebed commented Apr 8, 2018

Hi!
Managed primusrun to work with nvidia-driver-390 in Ubuntu 18.04

It initially looks for it at unexistent path, for unknown reason: /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 but there is no such package, that holds library here nowadays.
You had to provide right path to libGL.so.1

So, since primusrun don't have any config file, you may do it either:

  1. by setting env var in your commandline like that: PRIMUS_libGL=/usr/lib/x86_64-linux-gnu/libGL.so.1 primusrun glxgears
  2. by editing /usr/bin/primusrun directly, and putting PRIMUS_libGL=/usr/lib/x86_64-linux-gnu/libGL.so.1 inside that file
@fgblomqvist

This comment has been minimized.

fgblomqvist commented Apr 10, 2018

primusrun should work oob now since a few days back (they updated it). It disables all the necessary modules that was listed in the original post. Though, I did change the library paths according to what the original post said.

While I can get bumblebeed to load I cannot successfully use optirun:

$ optirun glxinfo | grep OpenGL
[   36.032385] [ERROR]Cannot access secondary GPU - error: Could not load GPU driver
[   36.032439] [ERROR]Aborting because fallback start is disabled.

/var/log/syslog:

Apr 10 09:13:51 bumblebeed[726]: libkmod: ERROR ../libkmod/libkmod-module.c:832 kmod_module_insert_module: could not find module by name='off'
Apr 10 09:13:51 bumblebeed[726]: [   36.032345] [ERROR]Could not load GPU driver
$ cat /etc/modprobe.d/nvidia-graphics-drivers.conf 
blacklist nouveau
blacklist lbm-nouveau
alias nouveau off
alias lbm-nouveau off
$ cat /etc/modprobe.d/blacklist-nvidia.conf 
# Do not modify
# This file was generated by nvidia-prime
blacklist nvidia
blacklist nvidia-drm
blacklist nvidia-modeset
alias nvidia off
alias nvidia-drm off
alias nvidia-modeset off
@rockorequin

This comment has been minimized.

rockorequin commented Apr 11, 2018

@fgblomqvist: does "sudo modprobe nvidia" give you any more information?

Are you using the standard 4.15 kernel or the 4.16 one? I'm using the 4.16.1 kernel and I need to patch the nvidia module to get 390.48 to load properly, or I get a load error when I try to modprobe it (and the same error messages from optirun/bumblebeed that you are seeing). In case you're using 4.16, here is what fixes it for me.

I'm using the ubuntu nvidia module, so it's installed with dkms. The patch I'm using for 4.16 is called buildfix_kernel_4.16.patch and it sits in the directory. I have to add this to the dkms.conf file:

PATCH[0]="buildfix_kernel_4.16.patch"

The buildfix file is /usr/src/nvidia-490.48/patches/buildfix_kernel_4.16.patch and contains:

--- a/common/inc/nv-linux.h~     2018-01-25 06:09:41.000000000 +0100
+++ b/common/inc/nv-linux.h      2018-03-05 13:58:17.746725638 +0100
@@ -1209,6 +1209,7 @@ static inline NvU32 nv_alloc_init_flags(
 static inline NvBool nv_dma_maps_swiotlb(struct pci_dev *dev)
 {
     NvBool swiotlb_in_use = NV_FALSE;
+#if 0
 #if defined(CONFIG_SWIOTLB)
   #if defined(NV_DMA_OPS_PRESENT) || defined(NV_GET_DMA_OPS_PRESENT)
     /*
@@ -1251,7 +1252,7 @@ static inline NvBool nv_dma_maps_swiotlb
     swiotlb_in_use = (swiotlb == 1);
   #endif
 #endif
-
+#endif
     return swiotlb_in_use;
 }
 

@rockorequin rockorequin reopened this Apr 11, 2018

@fgblomqvist

This comment has been minimized.

fgblomqvist commented Apr 12, 2018

I uninstalled Bumblebee to be able to use the nvidia driver flawlessly for some gaming the other day, but I'll reinstall it and try again this weekend or so and report back!

@rockorequin

This comment has been minimized.

rockorequin commented Apr 25, 2018

I found out that you also have to disable the nvidia-fallback service, because it ignores aliasing nouveau to off:

systemctl disable nvidia-fallback.service

Otherwise, this loads nouveau when it doesn't detect the nvidia module, and then you can't load the nvidia module and optirun reports that it can't find nvidia.

@QkiZMR

This comment has been minimized.

QkiZMR commented Apr 28, 2018

I fixed LibraryPath but when I'm trying to run something with optirun I seeing black content in program window (glxheads for example) and after few seconds optirun exit with error:

 ~  optirun -vv glxheads
[   66.901444] [DEBUG]Reading file: /etc/bumblebee/bumblebee.conf
[   66.901547] [INFO]Configured driver: nvidia
[   66.901635] [DEBUG]optirun version 3.2.1 starting...
[   66.901640] [DEBUG]Active configuration:
[   66.901643] [DEBUG] bumblebeed config file: /etc/bumblebee/bumblebee.conf
[   66.901646] [DEBUG] X display: :8
[   66.901648] [DEBUG] LD_LIBRARY_PATH: /usr/lib/x86_64-linux-gnu:/usr/lib/i386-linux-gnu
[   66.901651] [DEBUG] Socket path: /var/run/bumblebee.socket
[   66.901654] [DEBUG] Accel/display bridge: auto
[   66.901657] [DEBUG] VGL Compression: proxy
[   66.901660] [DEBUG] VGLrun extra options: 
[   66.901663] [DEBUG] Primus LD Path: /usr/lib/x86_64-linux-gnu/primus:/usr/lib/i386-linux-gnu/primus
[   66.904570] [DEBUG]Using auto-detected bridge primus
[   67.675984] [INFO]Response: Yes. X is active.

[   67.675998] [INFO]Running application using primus.
[   67.676103] [DEBUG]Process glxheads started, PID 15696.
glxheads: exercise multiple GLX connections (any key = exit)
Usage:
  glxheads xdisplayname ...
Example:
  glxheads :0 mars:0 venus:1
Name: :1
  Display:     0x564a2c123560
  Window:      0x4600002
  Context:     0x564a2c276f78
  GL_VERSION:  4.6.0 NVIDIA 390.48
  GL_VENDOR:   NVIDIA Corporation
  GL_RENDERER: GeForce 840M/PCIe/SSE2
X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  155 (GLX)
  Minor opcode of failed request:  11 (X_GLXSwapBuffers)
  Serial number of failed request:  37
  Current serial number in output stream:  38
primus: warning: dropping a frame to avoid deadlock
primus: warning: timeout waiting for display worker
terminate called without an active exception
[   70.498893] [DEBUG]SIGCHILD received, but wait failed with No child processes
[   70.498911] [DEBUG]Socket closed.
[   70.498924] [DEBUG]Killing all remaining processes.

Adding nvidia-drm.modeset=0 to linux parameters doesn't change anything.

@srscott

This comment has been minimized.

srscott commented Apr 29, 2018

I'm also having issues getting bumblebee to work properly in 18.04. Has anyone got a reasonable work around yet or are the devs working to fix this?

@MrDeepPurple

This comment has been minimized.

MrDeepPurple commented Apr 29, 2018

I'm facing the same problem reported by QkiZMR. Moreover if I try to start a program without 3D redering (i.e. optirun gedit) everything works as expected.

Here the output of optirun glxheads:

[  388.586874] [DEBUG]Reading file: /etc/bumblebee/bumblebee.conf
[  388.587679] [DEBUG]optirun version 3.2.1 starting...
[  388.587709] [DEBUG]Active configuration:
[  388.587718] [DEBUG] bumblebeed config file: /etc/bumblebee/bumblebee.conf
[  388.587726] [DEBUG] X display: :8
[  388.587734] [DEBUG] LD_LIBRARY_PATH: /usr/lib/x86_64-linux-gnu:/usr/lib/i386-linux-gnu
[  388.587750] [DEBUG] Socket path: /var/run/bumblebee.socket
[  388.587765] [DEBUG] Accel/display bridge: auto
[  388.587775] [DEBUG] VGL Compression: proxy
[  388.587791] [DEBUG] VGLrun extra options: 
[  388.587803] [DEBUG] Primus LD Path: /usr/lib/x86_64-linux-gnu/primus:/usr/lib/i386-linux-gnu/primus
[  388.587911] [DEBUG]Using auto-detected bridge primus
[  390.086631] [INFO]Response: Yes. X is active.

[  390.086644] [INFO]Running application using primus.
[  390.086786] [DEBUG]Process glxheads started, PID 7328.
glxheads: exercise multiple GLX connections (any key = exit)
Usage:
  glxheads xdisplayname ...
Example:
  glxheads :0 mars:0 venus:1
Name: :0
  Display:     0x55f9c9c55ce0
  Window:      0x2c00002
  Context:     0x55f9c9e23938
  GL_VERSION:  4.6.0 NVIDIA 390.48
  GL_VENDOR:   NVIDIA Corporation
  GL_RENDERER: GeForce GTX 970M/PCIe/SSE2
X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  155 (GLX)
  Minor opcode of failed request:  11 (X_GLXSwapBuffers)
  Serial number of failed request:  37
  Current serial number in output stream:  38
primus: warning: dropping a frame to avoid deadlock
primus: warning: timeout waiting for display worker
terminate called without an active exception
[  394.297932] [DEBUG]SIGCHILD received, but wait failed with No child processes
[  394.297956] [DEBUG]Socket closed.
[  394.297970] [DEBUG]Killing all remaining processes.
@bluca

This comment has been minimized.

Member

bluca commented Apr 29, 2018

That glx error smells like a GLVND problem, check what Ubuntu + mesa + the nvidia driver do with regards to libglvnd

@aaronfranke

This comment has been minimized.

aaronfranke commented May 7, 2018

Can someone please post a guide for getting this working on Ubuntu 18.04 Bionic Beaver? I can't seem to figure it out. I have kernel 4.15 and a GTX 870m. I don't care which driver as long as it's not Nouveau.

@DRosky

This comment has been minimized.

DRosky commented May 8, 2018

It seems like there have been a lot of problems with Ubuntu 18.04. People have also been posting some information in issue #764

@BonaBeavis

This comment has been minimized.

BonaBeavis commented May 8, 2018

Did anyone try a clean install?

@aaronfranke

This comment has been minimized.

aaronfranke commented May 8, 2018

I was on a clean install, but I don't know what to do once installed.

@fenak

This comment has been minimized.

fenak commented May 12, 2018

I have the same problem as well. Fresh install of Ubuntu 18.04, nvidia 390, no good. :(

@jsperezg

This comment has been minimized.

jsperezg commented May 13, 2018

Same issue here, Freshe install of ubuntu 18.04, nvida 390 and optirun is broken.

@DroidFreak32

This comment has been minimized.

DroidFreak32 commented May 14, 2018

I can confirm this on my kubuntu 18.04 too.

@radub7

This comment has been minimized.

radub7 commented May 16, 2018

I have the same problem, too:
(Ubuntu Bionic, nvidia 396 from ppa:/graphics-drivers)
edit: purged the ppa and tried with 390 from default repo - same error

$ optirun -vv glxgears

[  420.650936] [DEBUG]Reading file: /etc/bumblebee/bumblebee.conf
[  420.651298] [INFO]Configured driver: nvidia
[  420.651690] [DEBUG]optirun version 3.2.1 starting...
[  420.651719] [DEBUG]Active configuration:
[  420.651727] [DEBUG] bumblebeed config file: /etc/bumblebee/bumblebee.conf
[  420.651736] [DEBUG] X display: :8
[  420.651744] [DEBUG] LD_LIBRARY_PATH: /usr/lib/x86_64-linux-gnu:/usr/lib32/i386-linux-gnu
[  420.651752] [DEBUG] Socket path: /var/run/bumblebee.socket
[  420.651762] [DEBUG] Accel/display bridge: auto
[  420.651775] [DEBUG] VGL Compression: proxy
[  420.651783] [DEBUG] VGLrun extra options:
[  420.651793] [DEBUG] Primus LD Path: /usr/lib/x86_64-linux-gnu/primus:/usr/lib/i386-linux-gnu/primus
[  420.651909] [DEBUG]Using auto-detected bridge primus
[  421.236033] [INFO]Response: Yes. X is active.

[  421.236046] [INFO]Running application using primus.
[  421.236134] [DEBUG]Process glxgears started, PID 12653.
X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  155 (GLX)
  Minor opcode of failed request:  11 (X_GLXSwapBuffers)
  Serial number of failed request:  37
  Current serial number in output stream:  38
primus: warning: dropping a frame to avoid deadlock
primus: warning: timeout waiting for display worker
terminate called without an active exception
[  423.643067] [DEBUG]SIGCHILD received, but wait failed with No child processes
[  423.643081] [DEBUG]Socket closed.
[  423.643096] [DEBUG]Killing all remayning processes.
# journalctl -u bumblebeed.service

localhost systemd[1]: Started Bumblebee C Daemon.
localhost bumblebeed[920]: [    5.478686] [INFO]/usr/sbin/bumblebeed 3.2.1 started
localhost bumblebeed[920]: [  311.129954] [WARN][XORG] (WW) Warning, couldn't open module mouse
localhost bumblebeed[920]: [  311.129968] [ERROR][XORG] (EE) Failed to load module "mouse" (module does not exist, 0)
localhost bumblebeed[920]: [  311.129977] [WARN][XORG] (WW) NVIDIA(0): Unable to get display device for DPI computation.
localhost bumblebeed[920]: [  311.129981] [WARN][XORG] (WW) NVIDIA(0): Option "NoLogo" is not used
@bluebear94

This comment has been minimized.

bluebear94 commented May 21, 2018

Been getting the same error as radub7, with 396.

@carlicious

This comment has been minimized.

carlicious commented Jun 1, 2018

Hi, the fedora people found a workaround. Set __GLVND_DISALLOW_PATCHING=1 this worked for me, hope this saves you all some headache.

@QkiZMR

This comment has been minimized.

QkiZMR commented Jun 1, 2018

__GLVND_DISALLOW_PATCHING=1 optirun glxheads is working for me.

@rockorequin

This comment has been minimized.

rockorequin commented Jun 4, 2018

Thanks @carlicious, that works for me too (I tried 0ad and glxheads).

@athulpn

This comment has been minimized.

athulpn commented Jun 4, 2018

Any fix to this error?

optirun -vv glxinfo
[ 1116.748907] [DEBUG]Reading file: /etc/bumblebee/bumblebee.conf
[ 1116.749518] [INFO]Configured driver: nvidia
[ 1116.750054] [DEBUG]optirun version 3.2.1 starting...
[ 1116.750097] [DEBUG]Active configuration:
[ 1116.750120] [DEBUG] bumblebeed config file: /etc/bumblebee/bumblebee.conf
[ 1116.750142] [DEBUG] X display: :8
[ 1116.750163] [DEBUG] LD_LIBRARY_PATH: /usr/lib/nvidia-current:/usr/lib32/nvidia-current
[ 1116.750185] [DEBUG] Socket path: /var/run/bumblebee.socket
[ 1116.750206] [DEBUG] Accel/display bridge: auto
[ 1116.750226] [DEBUG] VGL Compression: proxy
[ 1116.750248] [DEBUG] VGLrun extra options: 
[ 1116.750265] [DEBUG] Primus LD Path: /usr/lib/x86_64-linux-gnu/primus:/usr/lib/i386-linux-gnu/primus
[ 1116.750424] [DEBUG]Using auto-detected bridge primus
[ 1116.751038] [INFO]Response: No - error: Could not load GPU driver

[ 1116.751088] [ERROR]Cannot access secondary GPU - error: Could not load GPU driver

[ 1116.751112] [DEBUG]Socket closed.
[ 1116.751168] [ERROR]Aborting because fallback start is disabled.
[ 1116.751187] [DEBUG]Killing all remaining processes.```
@QkiZMR

This comment has been minimized.

QkiZMR commented Jun 4, 2018

@athulpn problem with drivers?

@rockorequin

This comment has been minimized.

rockorequin commented Jun 4, 2018

@athulpn: "systemctl status bumblebeed" and "grep -i nvidia /var/log/syslog" or "journalctl -e" might show some relevant information. See also the thread at https://bugs.launchpad.net/ubuntu/+source/bumblebee/+bug/1758243 and check that you have for instance disabled the nvidia-fallback service.

@athulpn

This comment has been minimized.

athulpn commented Jun 5, 2018

I think the kernel module is not inserted properly. Any workaround from this log

bumblebeed.service - Bumblebee C Daemon
   Loaded: loaded (/lib/systemd/system/bumblebeed.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2018-06-05 21:12:57 IST; 2min 3s ago
 Main PID: 831 (bumblebeed)
    Tasks: 1 (limit: 4915)
   CGroup: /system.slice/bumblebeed.service
           └─831 /usr/sbin/bumblebeed

Jun 05 21:12:57 athul-X542UQ systemd[1]: Started Bumblebee C Daemon.
Jun 05 21:12:59 athul-X542UQ bumblebeed[831]: [   30.344220] [INFO]/usr/sbin/bumblebeed 3.2.1 started
Jun 05 21:14:01 athul-X542UQ bumblebeed[831]: libkmod: ERROR ../libkmod/libkmod-module.c:832 kmod_module_insert_module: could not find module by name='off'
Jun 05 21:14:01 athul-X542UQ bumblebeed[831]: [   92.161438] [ERROR]Could not load GPU driver
@rockorequin

This comment has been minimized.

rockorequin commented Jun 5, 2018

@athulpn: you probably have a file in /etc/modprobe.d with the line "alias nvidia off" in it. eg prime-select sets this in /etc/modprobe.d//blacklist-nvidia.conf. This stops bumblebee from loading the nvidia module. If you comment out the line and restart bumblebee with "sudo systemctl restart bumblebeed", hopefully things will work.

@athulpn

This comment has been minimized.

athulpn commented Jun 6, 2018

@rockorequin Thanks, it worked like 😄 👍

@athulpn

This comment has been minimized.

athulpn commented Jun 6, 2018

Should i disable nvidia-prime-boot.service as it is throwing errors during boot.

Failed to start dGPU off during boot

@niosus

This comment has been minimized.

niosus commented Jun 13, 2018

I have just installed a fresh install of Ubuntu 18.04 on a Dell XPS 15 9570 with nVidia 1050 TI and this is pain. I need to just disable the nvidia GPU on boot completely as I only care about productivity on Linux.

I have installed the proprietary nvidia drivers from the repo and have chosen the intel card with prime-select intel. I can disable nvidia card manually with bbswitch, but installing bumblebee just crashes the boot of ubuntu. Pressing Esc does nothing when booting. Any ideas how I can at least see what is going wrong?

@athulpn

This comment has been minimized.

athulpn commented Jun 13, 2018

You can turn off splash screen by editing /etc/default/grub. You need to remove splash from the line GRUB_CMDLINE_LINUX_DEFAULT

@niosus

This comment has been minimized.

niosus commented Jun 13, 2018

@athulpn yep, tried that before. Leaves me with just the black screen. 😐

@MrDeepPurple

This comment has been minimized.

MrDeepPurple commented Jun 14, 2018

@niosus
I solved the black screen problem on boot by adding acpi_osi=! acpi_osi='Windows 2012' in /etc/default/grub. It seems that some bios deactivate power management functionalities on nVidia card if the operating sistem is not windows (or at leas I understood that) causing the os to freeze when bbwsitch tries to set it off

@niosus

This comment has been minimized.

niosus commented Jun 14, 2018

@MrDeepPurple so just to make sure I understood correctly. The sequence of actions:

  • sudo prime-select intel + Reboot
  • sudo apt install bumblebee bumblebee-nvidia
  • edit /etc/default/grub to contain acpi_osi=! acpi_osi='Windows 2012' in GRUB_CMDLINE_LINUX_DEFAULT

Does this look ok for you? I have tried it before with acpi_osi='Windows 2009' and it did not seem to work. Are you on the same laptop?

@MrDeepPurple

This comment has been minimized.

MrDeepPurple commented Jun 14, 2018

@niosus I'm using a Clevo laptop with nVidia 970M but it seems that this problem is common on most laptop with mid-high end nvidia cards.

I tried with several combinations of acpi_osi parameter but only two of them worked for me:
acpi_osi=! acpi_osi='Windows 2012' and acpi_osi=! acpi_osi='Windows 2005'. If I remove the acpi_osi=! it stops working.

Anyway I suggest you to edit /etc/default/grub before installing bumblebee or after installing but before rebooting. bbswitch should not try to deatcivate nvidia card before this step.
(I'm assuming that you run sudo update-grub after the editing)

@niosus

This comment has been minimized.

niosus commented Jun 14, 2018

@MrDeepPurple adding acpi_osi=! acpi_osi='Windows 2012' does not solve the issue. The boot still fails with the following issue:

Image with boot errors

img_20180614_141432

Maybe this is because my laptop runs new hardware that nothing works. 🤔

UPD: also tried removing TLP in case it interferes with the boot process. Still the same behavior.

UPD2: the same error message pops up when the boot is successful without the installed bumblebee, so the issue that prevents the boot is different than I thought.. 🤔

@adamryczkowski

This comment has been minimized.

adamryczkowski commented Jun 22, 2018

I just managed to run bumblebee on 18.04. So it is possible. The most relevant information is on AskUbuntu: https://askubuntu.com/a/1042950/55241

@fernando-jascovich

This comment has been minimized.

fernando-jascovich commented Jul 1, 2018

@adamryczkowski Thank you so much for the workaround! I'm using 396.24 nvidia driver and it works great.

@rezzafr33

This comment has been minimized.

rezzafr33 commented Jul 4, 2018

fixes for handling DRM devices is backported to systemd bionic (237-3ubuntu10.2), which means we no longer need to alias nvidia_drm to "off"

https://launchpad.net/ubuntu/bionic/+source/systemd/+changelog

@zubozrout

This comment has been minimized.

zubozrout commented Jul 13, 2018

Hello,
I had to install this package "xserver-xorg-input-mouse" to get pass through this error: [ERROR]Cannot access secondary GPU - error: [XORG] (EE) Failed to load module "mouse" (module does not exist, 0)
but unfortunately then I still get this one: [ERROR]Cannot access secondary GPU - error: [XORG] (EE) No devices detected.

It has been mentioned here multiple times but I seem to be unable to find the root cause of this issue.
Debug log seems fine: https://paste.ubuntu.com/p/xNSH7FPY7Z/

Here is my blacklist-nvidia.conf content:

# Do not modify
# This file was generated by nvidia-prime
blacklist nvidia
blacklist nvidia-drm
blacklist nvidia-modeset
#alias nvidia off
#alias nvidia-drm off
#alias nvidia-modeset off

And this is my nvidia card:
3c:00.0 3D controller: NVIDIA Corporation GP108M [GeForce MX150] (rev ff)

Any ideas what may be going on wrong here? :(
Oh, and I did this: #951 (comment) but seems not to help in this instance.

@zubozrout

This comment has been minimized.

@scurrvy2020

This comment has been minimized.

scurrvy2020 commented Jul 17, 2018

I have changed the primusrun library path, but I can't get it to call the nvidia gpu. It's seems to still use the intel gpu. Even primusrun glxinfo shows that it is using intel.

optirun is able to use the nvidia gpu.

@simbd

This comment has been minimized.

simbd commented Jul 27, 2018

Hello,

On Ubuntu 18.04 with 390 Nvidia driver, Bumblebee does not work for me.
When i start with optirun or primusrun i get a error.

optirun glxgears
[ 177.328286] [ERROR]Cannot access secondary GPU - error: [XORG] (EE) Failed to load module "nvidia" (module does not exist, 0)
[ 177.328311] [ERROR]Aborting because fallback start is disabled.

primusrun glxgears
/usr/bin/primusrun: ligne 41: avertissement : command substitution: ignored null byte in input
primus: fatal: Bumblebee daemon reported: error: [XORG] (EE) Failed to load module "nvidia" (module does not exist, 0)

(while it works on Archlinux)

an idea ?

My Nvidia card :
01:00.0 VGA compatible controller: NVIDIA Corporation GP106M [GeForce GTX 1060 Mobile] (rev a1)

my file config of bumblebee (/etc/bumblebee) : http://nux87.free.fr/pb-bumblebee/bumblebee.zip

thx

@amiller27

This comment has been minimized.

amiller27 commented Aug 12, 2018

@scurrvy2020 I'm having the same problem; running primusrun glxgears with no special environment variables gives me an error message

primus: fatal: failed to load any of the libraries: /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1
/usr/lib/x86_64-linux-gnu/mesa/libGL.so.1: cannot open shared object file: No such file or directory

With PRIMUS_libGL set to anything nonempty (doesn't even have to be a filename), primusrun glxgears happily runs on Intel.

Did you ever figure it out?

Are others able to get primusrun to see an NVIDIA GPU?

@rezzafr33

This comment has been minimized.

rezzafr33 commented Aug 12, 2018

edit /usr/bin/primusrun, change it into something like this:

#!/bin/bash

# Readback-display synchronization method
# 0: no sync, 1: D lags behind one frame, 2: fully synced
# export PRIMUS_SYNC=${PRIMUS_SYNC:-0}

# Verbosity level
# 0: only errors, 1: warnings (default), 2: profiling
# export PRIMUS_VERBOSE=${PRIMUS_VERBOSE:-1}

# Secondary display
# export PRIMUS_DISPLAY=${PRIMUS_DISPLAY:-:8}

# "Accelerating" libGL
export PRIMUS_libGLa=${PRIMUS_libGLa:-'/usr/$LIB/libGL.so.1'}

# "Displaying" libGL
export PRIMUS_libGLd=${PRIMUS_libGLd:-'/usr/$LIB/libGL.so.1'}

# Directory containing primus libGL
PRIMUS_libGL=${PRIMUS_libGL:-'/usr/$LIB/primus'}

# On some distributions, e.g. on Gentoo, libnvidia-tls.so is not available
# in default search paths.  Add its path manually after the primus library
bblibs=$(echo -ne 'Q LibraryPath\0' | \
  socat - UNIX-CONNECT:/var/run/bumblebee.socket | sed 's/^Value: \(.*\)/\1/' | tr -d '\0')

PRIMUS_libGL=${PRIMUS_libGL}${bblibs:+:$bblibs}

# Mesa drivers need a few symbols to be visible
# export PRIMUS_LOAD_GLOBAL=${PRIMUS_LOAD_GLOBAL:-'libglapi.so.0'}

# Need functions from primus libGL to take precedence
export LD_LIBRARY_PATH=${PRIMUS_libGL}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}

# And go!
export __GLVND_DISALLOW_PATCHING=1
exec "$@"
@shashanknimje

This comment has been minimized.

shashanknimje commented Sep 9, 2018

@adamryczkowski thanks for the great share! Also I found a one stop shop for all the current issues with Bumblebee on Ubuntu 18.04.

https://bugs.launchpad.net/ubuntu/+source/bumblebee/+bug/1758243

The following are other two very good sources for reference.

https://www.pcsuggest.com/nvidia-optimus-ubuntu/
https://wiki.ubuntu.com/Bumblebee

PS:

I'm currently running Nvidia 390.87 driver with 4.18.7 Kernel on Ubuntu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment