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

[ERROR]Cannot access secondary GPU - error: [XORG] (EE) [drm] KMS not enabled #467

Closed alisianoi closed 10 years ago

alisianoi commented 11 years ago

Hello developers and maintainers, here is my story.

Distro

all3fox@tardis ~ % cat /etc/issue 
Arch Linux \r (\l)

Kernel

all3fox@tardis ~ % uname -a
Linux tardis 3.10.9-1-ARCH #1 SMP PREEMPT Wed Aug 21 13:49:35 CEST 2013 x86_64 GNU/Linux

Manufacturer and model

all3fox@tardis ~ % ./devs_script   
baseboard-manufacturer: Acer
baseboard-product-name: MA50_HX
baseboard-version     : Type2 - Board Version
system-manufacturer   : Acer
system-product-name   : Aspire M3-581TG
system-version        : V1.08
bios-vendor           : Insyde Corp.
bios-version          : V1.08
bios-release-date     : 05/12/2012

Bumblebee version and problem

all3fox@tardis ~ % optirun -vv glxspheres
[ 1642.696485] [DEBUG]Reading file: /etc/bumblebee/bumblebee.conf
[ 1642.696761] [INFO]Configured driver: nouveau
[ 1642.696934] [DEBUG]optirun version 3.2.1 starting...
[ 1642.696977] [DEBUG]Active configuration:
[ 1642.697002] [DEBUG] bumblebeed config file: /etc/bumblebee/bumblebee.conf
[ 1642.697017] [DEBUG] X display: :8
[ 1642.697034] [DEBUG] LD_LIBRARY_PATH: 
[ 1642.697043] [DEBUG] Socket path: /var/run/bumblebee.socket
[ 1642.697053] [DEBUG] Accel/display bridge: auto
[ 1642.697067] [DEBUG] VGL Compression: proxy
[ 1642.697077] [DEBUG] VGLrun extra options: 
[ 1642.697088] [DEBUG] Primus LD Path: /usr/lib/primus:/usr/lib32/primus
[ 1642.697154] [DEBUG]Using auto-detected bridge virtualgl
[ 1643.562345] [INFO]Response: No - error: [XORG] (EE) [drm] KMS not enabled

[ 1643.562366] [ERROR]Cannot access secondary GPU - error: [XORG] (EE) [drm] KMS not enabled

[ 1643.562373] [DEBUG]Socket closed.
[ 1643.562410] [ERROR]Aborting because fallback start is disabled.
[ 1643.562417] [DEBUG]Killing all remaining processes.

An accurate problem description

Alright, my problem in short: I can't render with my discrete Nvidia GT640M video card (the Kepler one) and I barely can enable powersaving for it with bbswitch. Here is my step-by-step story:

  1. On a freshly installed Arch Linux system I carefully follow The Arch Wiki.
  2. My first problem is the infamous:
[ERROR]Cannot access secondary GPU - error: [XORG] (EE) Failed to load module "mouse" (module does not exist, 0)

which is easily googled and solved by installing xf86-input-mouse. Additional logreading of /var/log/Xorg.8.log suggests installing xf86-input-keyboard but bumblebee wiki claims it's unnecessary. Agreed but installed anyway.

  1. After that I hit my aforementioned KMS not enabled problem. Simultaneously I notice that powersaving doesn't work and my GPU is turned on even after a reboot.
  2. I start looking for solutions to KMS not enabled. The ones I find do not work for me. One of the suggestions is to enable KMS early by including nouveau into the MODULES array of /etc/mkinitcpio.conf and rebuilding the kernel with sudo mkinitcpio -p linux. It doesn't solve the KMS not enabled problem but brings back powersaving: the GPU is now turned off when the laptop boots.
  3. I delete the nouveau entry from the MODULES array, rebuild the kernel and reboot. The GPU is on again.
  4. I notice that your wiki says bumblebee daemon initially powers off the GPU. I check that the daemon is running:
all3fox@tardis ~ % systemctl status bumblebeed.service                  
bumblebeed.service - Bumblebee C Daemon
   Loaded: loaded (/usr/lib/systemd/system/bumblebeed.service; enabled)
   Active: active (running) since Thu 2013-08-29 14:30:46 MSK; 2min ago
 Main PID: 1393 (bumblebeed)
   CGroup: name=systemd:/system/bumblebeed.service
           └─1393 /usr/bin/bumblebeed

Then I issue a restart: sudo systemctl restart bumblebeed.service, bumblebee daemon restarts and powers off the GPU. That is nice. This is currently the way I do powersaving: by restarting bumblebee after laptop boots.

  1. I write this lengthy issue (after reading a few other issues present here, of course). Sorry for the amount of text, I hope it's readable. Sorry for my english, I believe it is understandable.

    My current objective

I would love to setup bumblebee so that it works out of the box (both rendering with nouveau drivers and powersaving with bbswitch). I know it worked in a perfect way a few kernels ago. My suspicion is that switching to closed source nvidia drivers might do the trick (afaik they ignore KMS entirely) but I am really not eager to do that. I will try switching drivers if strongly requested and I am eager to post more logs and config files but this issue is already a long one.

alisianoi commented 11 years ago

Sorry, I am not familiar with gihub UI and closed the issue accidentally while editing the post. So as not to waste anyone's time, here are a few config files then:

Please don't get confused, the issue is Opened, I keep hitting the wrong button.

Lekensteyn commented 11 years ago

kernel logs would be very useful here. Have you tried blacklisting the nouveau module? Create /etc/modprobe/blacklist-nouveau.conf containing blacklist nouveau. Then run mkinitcpio -p linux to make the blacklist propagate to the initrd.

alisianoi commented 11 years ago

my actions after your post:

  1. generated kernel logs with dmesg > kernellog and posted them as an update to my previous post (for consistency).
  2. blacklisted nouveau, rebuilt the kernel as suggested. Please note that Arch Linux uses systemd rather than initrd (but it does not seem important).
  3. took the liberty to go to /etc/bumblebee/bumblebee.conf and change line Driver=nouveau to Driver=
  4. rebooted. Noticed that bbswitch switched the GPU off --- I did not have to restart bumblebee to get powersaving. Issued lsmod --- nouveau was loaded. It did not seem to get blacklisted, what did I do wrong?
all3fox@tardis ~ % lsmod | grep nouveau
nouveau               962981  0 
mxm_wmi                 1467  1 nouveau
ttm                    65388  1 nouveau
drm_kms_helper         35438  2 i915,nouveau
drm                   231168  6 ttm,i915,drm_kms_helper,nouveau
wmi                     8283  3 acer_wmi,mxm_wmi,nouveau
i2c_algo_bit            5391  2 i915,nouveau
i2c_core               23720  7 drm,i915,i2c_i801,drm_kms_helper,i2c_algo_bit,nouveau,videodev
button                  4669  2 i915,nouveau
video                  11328  3 i915,acer_wmi,nouveau

after that I issued

all3fox@tardis ~ % optirun -vv glxspheres           
[  704.915121] [DEBUG]Reading file: /etc/bumblebee/bumblebee.conf
[  704.915426] [DEBUG]optirun version 3.2.1 starting...
[  704.915436] [DEBUG]Active configuration:
[  704.915439] [DEBUG] bumblebeed config file: /etc/bumblebee/bumblebee.conf
[  704.915443] [DEBUG] X display: :8
[  704.915446] [DEBUG] LD_LIBRARY_PATH: 
[  704.915449] [DEBUG] Socket path: /var/run/bumblebee.socket
[  704.915452] [DEBUG] Accel/display bridge: auto
[  704.915455] [DEBUG] VGL Compression: proxy
[  704.915458] [DEBUG] VGLrun extra options: 
[  704.915461] [DEBUG] Primus LD Path: /usr/lib/primus:/usr/lib32/primus
[  704.915481] [DEBUG]Using auto-detected bridge virtualgl
[  704.921776] [INFO]Response: No - error: [XORG] (EE) [drm] KMS not enabled

[  704.921793] [ERROR]Cannot access secondary GPU - error: [XORG] (EE) [drm] KMS not enabled

[  704.921798] [DEBUG]Socket closed.
[  704.921813] [ERROR]Aborting because fallback start is disabled.
[  704.921820] [DEBUG]Killing all remaining processes.

the line [INFO]Configured driver: nouveau is gone which is expected due to my 3rd step

Please note that this is a clean Arch Linux install and I haven't yet tried nvidia drivers of any kind. In other words, why do you suggest blacklisting nouveau? (out of curiosity is a perfectly valid answer)

Lekensteyn commented 11 years ago

systemd is irrelevant. If you want to be pendantic nit-picking, initrd (initial ramdisk) is the wrong term too, it should be "initramfs". What command did you exactly issue to rebuild the initramfs (not kernel!)?

alisianoi commented 11 years ago

sorry, I am not trying to be pedantic, I am trying to be verbose since my knowledge of GNU/Linux is limited. Here is a relevant exerpt from my shell history:

ls /etc/modprobe.d/
sudo nano /etc/modprobe.d/blacklist-nouveau.conf
sudo nano /etc/bumblebee/bumblebee.conf
mkinitcpio -p linux
sudo mkinitcpio -p linux
sudo reboot

as I understand, I rebuilt initramfs with sudo mkinitcpio -p linux

Lekensteyn commented 11 years ago

That should work. lsinitcpio /boot/initramfs-linux-custom.img | grep nouveau should not show a nouveau.ko but your blacklist file. Can you confirm that?

alisianoi commented 11 years ago

confirmed

all3fox@tardis ~ % lsinitcpio /boot/initramfs-linux.img| grep nouveau
./etc/modprobe.d/blacklist-nouveau.conf
alisianoi commented 11 years ago

Here are my observations: sometimes I issue lsmod | grep nouveau and see no output. If I then issue optirun glxspheres it will fail with KMS not enabled but a subsequent lsmod | grep nouveau will show several entries figuring nouveau.

Lekensteyn commented 11 years ago

Oh that is expected. The blacklist prevents the module from automatically loading on boot. When you run optirun, but the X server fails to start, then the module is not unloaded.

What does your kernel logs say when you run optirun and get that "KMS not enabled" error in xorg.8.log?

alisianoi commented 11 years ago

these two lines appear at the end of the ring buffer

[ 4647.099035] bbswitch: enabling discrete graphics
[ 4647.509091] pci 0000:01:00.0: power state changed by ACPI to D0

so there is nothing about KMS which is why I tried grep'ing for it with no luck. Here is the complete kernel log just in case.

Update: Meanwhile I went to the ArchWiki KMS article and using the sysctl tool from procfs-ng package made sure I do not have any vga= or video= kernel parameters which would have switched off KMS. However, I failed to make sure that I am not "using any other framebuffer drivers (like uvesafb)" because I do not quite understand that wiki instruction.

Update2: Just noticed I am not running the latest BIOS version.

Ram-Z commented 11 years ago

Same issue here running Chakra Linux (forked from Arch a while ago).

[19:21 ramsi@chronos]% uname -a 
Linux chronos 3.10.10-1-CHAKRA #1 SMP PREEMPT Thu Aug 29 21:57:49 UTC 2013 x86_64 GNU/Linux
[19:38 ramsi@chronos]% pacman -Qs nouveau
local/bumblebee 3.2.1-1
local/linux 3.10.10-1 (base)
local/mesa 9.1.5-2
local/xf86-video-nouveau 1.0.8-1
[19:24 ramsi@chronos]% optirun --status
Bumblebee status: Ready (3.2.1). X inactive. Discrete video card is off.
[19:24 ramsi@chronos]% optirun -vv glxgears
[ 1243.629305] [DEBUG]Reading file: /etc/bumblebee/bumblebee.conf
[ 1243.629934] [INFO]Configured driver: nouveau
[ 1243.630247] [DEBUG]optirun version 3.2.1 starting...
[ 1243.630278] [DEBUG]Active configuration:
[ 1243.630289] [DEBUG] bumblebeed config file: /etc/bumblebee/bumblebee.conf
[ 1243.630299] [DEBUG] X display: :9
[ 1243.630308] [DEBUG] LD_LIBRARY_PATH: 
[ 1243.630317] [DEBUG] Socket path: /var/run/bumblebee.socket
[ 1243.630326] [DEBUG] Accel/display bridge: auto
[ 1243.630335] [DEBUG] VGL Compression: proxy
[ 1243.630344] [DEBUG] VGLrun extra options: 
[ 1243.630352] [DEBUG] Primus LD Path: /usr/lib/primus:/usr/lib32/primus
[ 1243.630427] [DEBUG]Using auto-detected bridge virtualgl
[ 1245.266701] [INFO]Response: No - error: [XORG] (EE) [drm] KMS not enabled

[ 1245.266720] [ERROR]Cannot access secondary GPU - error: [XORG] (EE) [drm] KMS not enabled

[ 1245.266739] [DEBUG]Socket closed.
[ 1245.266769] [ERROR]Aborting because fallback start is disabled.
[ 1245.266779] [DEBUG]Killing all remaining processes.
[1][19:25 ramsi@chronos]% lsmod | grep nouveau
nouveau               963077  0 
ttm                    65324  1 nouveau
mxm_wmi                 1467  1 nouveau
wmi                     8315  3 mxm_wmi,nouveau,asus_wmi
video                  11328  3 i915,nouveau,asus_wmi
button                  4669  2 i915,nouveau
i2c_algo_bit            5391  2 i915,nouveau
drm_kms_helper         35438  2 i915,nouveau
drm                   231104  6 ttm,i915,drm_kms_helper,nouveau
i2c_core               23720  7 drm,i915,i2c_i801,drm_kms_helper,i2c_algo_bit,nouveau,videodev
[19:25 ramsi@chronos]% optirun --status
Bumblebee status: Error (3.2.1): [XORG] (EE) [drm] KMS not enabled
[19:27 ramsi@chronos]% journalctl --no-pager -n8 -u bumblebeed                                                    ~
-- Logs begin at Tue 2013-08-20 00:08:02 CEST, end at Mon 2013-09-09 19:27:49 CEST. --
Sep 09 19:24:30 chronos systemd[1]: Starting Bumblebee C Daemon...
Sep 09 19:24:30 chronos systemd[1]: Started Bumblebee C Daemon.
Sep 09 19:24:30 chronos bumblebeed[6274]: [ 1204.959616] [INFO]/usr/sbin/bumblebeed 3.2.1 started
Sep 09 19:25:11 chronos bumblebeed[6274]: [ 1245.266622] [WARN][XORG] (WW) `fonts.dir' not found (or not valid)...pi/".
Sep 09 19:25:11 chronos bumblebeed[6274]: [ 1245.266656] [WARN][XORG] (WW) `fonts.dir' not found (or not valid)...pi/".
Sep 09 19:25:11 chronos bumblebeed[6274]: [ 1245.266677] [ERROR][XORG] (EE) [drm] KMS not enabled
Sep 09 19:25:11 chronos bumblebeed[6274]: [ 1245.266680] [ERROR][XORG] (EE) No devices detected.
Sep 09 19:25:11 chronos bumblebeed[6274]: [ 1245.266684] [ERROR]X did not start properly
alisianoi commented 10 years ago

Ok, a recent # pacman -Syu brought bumblebee back to its' full glory on my machine. Apart from irrelevant things, the kernel got updated (and bbswitch recompiled for it). If somebody could explain what was wrong with the previous kernels or at least point at where to look for it, I would be grateful.

all3fox@tardis ~ % uname -a
Linux tardis 3.11.1-1-ARCH #1 SMP PREEMPT Sat Sep 14 19:30:21 CEST 2013 x86_64 GNU/Linux
all3fox@tardis ~ % optirun --version
optirun (Bumblebee) 3.2.1

current logs just in case