Ubuntu 13.04 fails to run - No devices detected #367

Closed
ricey-uk opened this Issue Mar 25, 2013 · 87 comments

Comments

Projects
None yet

Chaps,

I've just done a clean install of Ubuntu 13.04 daily (24 Mar 13) with kernel 3.8.0-14

followed by a clean install on bumblebee + nvidia (304) and it fails to run any app with optirun.

Here are some of the details:

~$ optirun -vv --debug bash
[ 123.114015] [DEBUG]Reading file: /etc/bumblebee/bumblebee.conf
[ 123.114584] [INFO]Configured driver: nvidia
[ 123.114838] [DEBUG]optirun version 3.1 starting...
[ 123.114857] [DEBUG]Active configuration:
[ 123.114866] [DEBUG] bumblebeed config file: /etc/bumblebee/bumblebee.conf
[ 123.114873] [DEBUG] X display: :8
[ 123.114880] [DEBUG] LD_LIBRARY_PATH: /usr/lib/nvidia-304:/usr/lib32/nvidia-304
[ 123.114888] [DEBUG] Socket path: /var/run/bumblebee.socket
[ 123.114895] [DEBUG] Accel/display bridge: auto
[ 123.114903] [DEBUG] VGL Compression: proxy
[ 123.114935] [DEBUG]Using auto-detected bridge virtualgl
[ 124.893051] [INFO]Response: No - error: XORG No devices detected.

[ 124.893072] [ERROR]Cannot access secondary GPU - error: XORG No devices detected.

[ 124.893078] [DEBUG]Socket closed.
[ 124.893098] [ERROR]Aborting because fallback start is disabled.
[ 124.893104] [DEBUG]Killing all remaining processes.

the output from bumblebee -vv --debug is here:

http://pastebin.com/u9s3xWhR

the above is with

kernel 3.9.0-030900rc4-generic #201303232035 SMP Sun Mar 24 00:44:55 UTC 2013 i686 i686 i686 GNU/Linux

but exactly the same happens with the installed 3.8.0-14

details:

$ lspci -v -s 01:00.0
01:00.0 VGA compatible controller: NVIDIA Corporation Device 0fd4 (rev a1) (prog-if 00 [VGA controller])
Subsystem: CLEVO/KAPOK Computer Device 3700
Flags: bus master, fast devsel, latency 0, IRQ 16
Memory at f6000000 (32-bit, non-prefetchable) [size=16M]
Memory at e0000000 (64-bit, prefetchable) [size=256M]
Memory at f0000000 (64-bit, prefetchable) [size=32M]
I/O ports at e000 [size=128]
Expansion ROM at f7000000 [disabled] [size=512K]
Capabilities:
Kernel driver in use: nvidia

bumblebee.conf:

http://pastebin.com/MryhABNu

I've tried both the stable and testing repos on both kernels and the results are identical - kind of suggests it's not Bumblebee but something else, but I can't for the life of me see what it might be!

any help greatly appreciated.

Dave

Owner

ArchangeGabriel commented Mar 26, 2013

This is strange, it starts loading nvidia driver, fails with no device detected, and then load intel and tons of other things it shouldn't load...

It is very odd, it used to work on the previous (pre -14) kernels. I'm at a loss!

Owner

Lekensteyn commented Mar 27, 2013

What does find /usr/share/X11/xorg.conf.d -ls -exec cat {} \; say? Can you put your kernel log somewhere on pastebin?

I have the same problem after updating 13.04.

When restarting bumblebeed, I get this in my syslog:

Mar 27 12:52:43 jacklappyy bumblebeed[3955]: Received Terminated signal.
Mar 27 12:52:43 jacklappyy bumblebeed[7929]: /usr/sbin/bumblebeed 3.1 started
Mar 27 12:52:43 jacklappyy kernel: [ 2759.396573] bbswitch: disabling discrete graphics
Mar 27 12:52:43 jacklappyy kernel: [ 2759.410830] pci 0000:01:00.0: Refused to change power state, currently in D0
Mar 27 12:52:43 jacklappyy kernel: [ 2759.463177] pci 0000:01:00.0: power state changed by ACPI to D3cold

When running "optirun -vv --debug glxspheres", I get this on stdout:

[ 2903.328320] [DEBUG]Reading file: /etc/bumblebee/bumblebee.conf
[ 2903.329002] [INFO]Configured driver: nvidia
[ 2903.329363] [DEBUG]optirun version 3.1 starting...
[ 2903.329394] [DEBUG]Active configuration:
[ 2903.329403] [DEBUG] bumblebeed config file: /etc/bumblebee/bumblebee.conf
[ 2903.329413] [DEBUG] X display: :8
[ 2903.329422] [DEBUG] LD_LIBRARY_PATH: /usr/lib/nvidia-304-updates:/usr/lib32/nvidia-304-updates
[ 2903.329431] [DEBUG] Socket path: /var/run/bumblebee.socket
[ 2903.329440] [DEBUG] Accel/display bridge: auto
[ 2903.329449] [DEBUG] VGL Compression: proxy
[ 2903.329500] [DEBUG]Using auto-detected bridge virtualgl
[ 2903.826866] [INFO]Response: No - error: [XORG] (EE) No devices detected.

[ 2903.826922] [ERROR]Cannot access secondary GPU - error: [XORG] (EE) No devices detected.

[ 2903.826927] [DEBUG]Socket closed.
[ 2903.826943] [ERROR]Aborting because fallback start is disabled.
[ 2903.826949] [DEBUG]Killing all remaining processes.

and this in my syslog:

Mar 27 12:55:02 jacklappyy kernel: [ 2898.552339] bbswitch: enabling discrete graphics
Mar 27 12:55:02 jacklappyy kernel: [ 2898.947725] pci 0000:01:00.0: power state changed by ACPI to D0
Mar 27 12:55:02 jacklappyy kernel: [ 2899.003869] NVRM: loading NVIDIA UNIX x86_64 Kernel Module  304.84  Wed Feb 27 04:58:49 PST 2013
Mar 27 12:55:03 jacklappyy acpid: client 4018[0:1001] has disconnected
Mar 27 12:55:03 jacklappyy acpid: client connected from 7961[0:1001]
Mar 27 12:55:03 jacklappyy acpid: 1 client rule loaded
Mar 27 12:55:03 jacklappyy bumblebeed[7929]: [XORG] (EE) No devices detected.
Mar 27 12:55:03 jacklappyy bumblebeed[7929]: [XORG] (WW) xf86OpenConsole: setpgid failed: Operation not permitted
Mar 27 12:55:03 jacklappyy bumblebeed[7929]: [XORG] (WW) xf86OpenConsole: setsid failed: Operation not permitted
Mar 27 12:55:03 jacklappyy bumblebeed[7929]: [XORG] (WW) Falling back to old probe method for vesa
Mar 27 12:55:03 jacklappyy bumblebeed[7929]: [XORG] (WW) Falling back to old probe method for modesetting
Mar 27 12:55:03 jacklappyy bumblebeed[7929]: [XORG] (WW) Falling back to old probe method for fbdev
Mar 27 12:55:03 jacklappyy bumblebeed[7929]: [XORG] (EE) intel(0): [drm] failed to set drm interface version: Permission denied [13].
Mar 27 12:55:03 jacklappyy bumblebeed[7929]: [XORG] (EE) intel(0): Failed to become DRM master.
Mar 27 12:55:03 jacklappyy bumblebeed[7929]: [XORG] (EE) Screen(s) found, but none have a usable configuration.
Mar 27 12:55:03 jacklappyy bumblebeed[7929]: [XORG] (EE) 
Mar 27 12:55:03 jacklappyy bumblebeed[7929]: [XORG] (EE) Please also check the log file at "/var/log/Xorg.8.log" for additional information.
Mar 27 12:55:03 jacklappyy bumblebeed[7929]: [XORG] (EE) 
Mar 27 12:55:03 jacklappyy bumblebeed[7929]: X did not start properly

Hi,

here's my kern.log from boot to the end!

http://pastebin.com/JSjYkyKD

and find /usr/share/X11/xorg.conf.d -ls -exec cat {} ; says:

http://pastebin.com/7d2NWedw

hope this helps, anything else that would be useful for you to see please ask :)

cheers

Owner

ArchangeGabriel commented Mar 28, 2013

Confirmed, broken on Raring, with either nouveau or any nvidia flavor.

So what did Ubuntu change? as it worked on earlier dailies with the same version of Bumblebee.

does it look like a quick fix? If indeed a fix by Bumblebee is needed. Do we indeed need to report against Ubuntu?

cheers

As far as I can tell it doesn't seem to be a kernel problem, as I still get the same issue when booting earlier kernels.

Owner

ArchangeGabriel commented Mar 28, 2013

Indeed, it looks more to be xorg.

that makes sense as on previous dailies it worked perfectly, after the 24th it stopped on all kernels, including 3.9. That suggests that the xorg update of that daily conflicts somewhere now with this latest xorg bumblebee doesn't work with any kernel!

so, what changed? is there a quick way of telling - version numbers/change logs?

@ArchangeGabriel, you are right. It was an xorg update that broke it. Upgrading xerver-xorg-core 2:1.13.3-0ubuntu2b1 to 2:1.13.3-0ubuntu3 breaks bumblebee. @ricey-uk, if you still have the old package cached, you can fix bumblebee via sudo dpkg -i /var/cache/apt/archives/xserver-xorg-core_2%3a1.13.3-0ubuntu2b1_amd64.deb.

Owner

ArchangeGabriel commented Mar 29, 2013

Reported to the package maintainer, waiting for an answer.

Hi,
have reverted to the version stated above ( downloaded from launch pad) and it's working again!

so, it does indeed seem to be xorg!

let's see what they say.

cheers

Hi,

I seem to be having the exact same issue. How did you download it from launchpad? Sorry, but I'm rather new to Linux so I don't really know what to do here... Exact instructions please, and thank you!

Regards,
Michael

For the benefit of anyone who doesn't have the package in their cache and found this page on Google, you could follow these steps:

  1. Check if you are running 13.04, this only applies to 13.04.
  2. Go to https://launchpad.net/ubuntu/raring/amd64/xserver-xorg-core/2:1.13.3-0ubuntu2b1 and download the *.deb file.
  3. Run dpkg -i /path/to/download to install it.
  4. From Synaptic, search for "xserver-xorg-core", select it and select "lock version" from the package menu to stop it from auto-updating.

and indeed don't forget to change the address from amd64 to i386 if you're using the 32 bit install :-)

I also had to install synaptic, it's not installed by default.

cheers

Confirmed that downgrading to xserver-xorg-core_1.13.3-0ubuntu2b1 fixes the problem in 13.04 for me as well. At the time I had the problem I was running xserver-xorg-core_1.13.3-0ubuntu4.

Owner

Samsagax commented Apr 2, 2013

El 01/04/13 18:35, Andy Holmes escribió:

Confirmed that downgrading to xorg-xserver-core_1.13.3-0ubuntu2b1
fixes the problem in 13.04 for me as well. At the time I had the
problem I was running xorg-xserver-core_1.13.3-0ubuntu4.


Reply to this email directly or view it on GitHub
#367 (comment).

Maybe it is related to AutoAddGPUs option? Is in he server layout
section for xorg 1.14 onward.

Owner

ArchangeGabriel commented Apr 2, 2013

It is since 1.13 in fact, but no, that's not the problem.

Owner

ArchangeGabriel commented Apr 2, 2013

The official explanation is this BTW, but not sure on how to fix that, have to take a look at seats:

If you want to load the nvidia module you need to specify it explicitly in your configuration. Intel failed
to be detected before because of a bug. You were probably already running a xserver with intel.
Before it would just fail entirely because the intel card was already in use, now it still detects the
intel card through udev.

As a workaround I suppose you could append something like -seat bla, in which case the intel
device will not be found through udev, unless you had  the ID_SEAT property for that device set to bla too.

I still think bumblebee is trying to solve the problem at the wrong layer, and all that time would
have been better spent improving nouveau instead.
Owner

ArchangeGabriel commented Apr 2, 2013

I've opened a question on Launchpad, in order to have more feedback on which side the bug is. It's available here: https://answers.launchpad.net/ubuntu/+source/xorg-server/+question/225707

Owner

ArchangeGabriel commented Apr 2, 2013

And finally a bug: https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/1163404.

If someone can attach working logs with 2b1, it might me usefull.

Owner

ArchangeGabriel commented Apr 2, 2013

If all 13.04 Bumblebee users that have a launchpad account can click on affected, this may have much more weight.

fj commented Apr 3, 2013

An earlier commenter posted this:

For the benefit of anyone who doesn't have the package in their cache and found this page on Google, you could follow these steps:

  1. Check if you are running 13.04, this only applies to 13.04.
  2. Go to https://launchpad.net/ubuntu/raring/amd64/xserver-xorg-core/2:1.13.3-0ubuntu2b1 and download the *.deb file.
  3. Run dpkg -i /path/to/download to install it.
  4. From Synaptic, search for "xserver-xorg-core", select it and select "lock version" from the package menu to stop it from auto-updating.

However, this approach will only stop the upgrade from happening via Synaptic. To make it stop via any upgrade channel (e.g. aptitude, apt-get, etc.), use echo "xserver-xorg-core hold" | sudo dpkg --set-selections.

suoko commented Apr 5, 2013

Same on my 13.04. Thanks for your suggested fix

3vi1 commented Apr 6, 2013

What fj meant to say was:

 echo xserver-xorg-core hold | sudo dpkg --set-selections

When a 'fixed' xorg is released, you run the same command with 'install' in the place of 'hold' to release the package.

I'm really glad I found this thread. I was pulling my hair out last night trying to figure out why it wasn't working on my freshly installed 13.04 system until I saw this. I've thrown my 'affected by' vote into launchpad with yours.

fj commented Apr 7, 2013

Whoops, yes; thanks @3vi1. I've updated my original post.

beidl commented Apr 7, 2013

Have you tried to add the right BusID to the Device section of your xorg.conf.nvidia file?
Running raring and no problem here at all.

Owner

ArchangeGabriel commented Apr 8, 2013

@beidl: Ok, that works. However I still think it's an issue in X, since isolateDevice should do the same thing.

So, now we have either two options:

  1. Set BusID to PCI:01:00:0 because it is the most common one from far, and tell people to change it if it's not working.
  2. Detect that thing at installation.

@Lekensteyn, @Thulinma, @amonakov and @Samsagax what are your opinions on this, and should this change be made upstream or only for Ubuntu?

Contributor

amonakov commented Apr 8, 2013

Right now bumblebee protects secondary X pretty well from picking up other devices: it passes -isolateDevice and sets AutoAddDevices and AutoAddGPUs to false in the config for secondary Xorg. We should ask X maintainers why -isolateDevice is apparently not enough now, since BusID apparently cures the problem. Looks like a regression on the first sight. @ArchangeGabriel, since you have a system that is affected, can you volunteer to ask X developers why -isolateDevice and AutoAddGPUs is not enough now (btw the previously quoted response from Maarten looks like he is not aware that Bumblebee sets those options for secondary X — please point it out specifically when asking)?

Contributor

amonakov commented Apr 8, 2013

I.e. my opinion is that we should postpone thinking about possible workaround until we know what exactly happened in Xorg (perhaps this is a regression that will be fixed soon enough).

Owner

ArchangeGabriel commented Apr 8, 2013

Since this is Ubuntu specific, I've opened a bug on launchpad against xorg, I will now add this informations. The bug is here: https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/1163404

vacaloca commented Apr 9, 2013

@beidl
Adding the BusID for my NVIDIA card as identified by lspci | grep NVIDIA in /etc/bumblebee/xorg.conf.nvidia file worked for me also under Raring Beta 2 (13.04) For a while I was going nuts because I had it working in 12.04. Running fine now on an Acer TimelineU M5-481TG with a GT640 Kepler card.

@ArchangeGabriel
I would vote for option 2... auto detect on install... makes the most sense to me and probably makes bumblebee setup more foolproof.

Confirmed, setting the BusID in /etc/bumblebee/xorg.conf.nvidia works after updating xserver-xorg-core.

ricey-uk commented Apr 9, 2013

I too can confirm that adding

BusID "PCI:01:00:0"

/etc/bumblebee/xorg.conf.nvidia

fixes the issue using

xserver-org-core 2:1.13.3-0ubuntu5

cheers

Same here:
Adding : BusID "PCI:01:00:0"
in the DEVICE section in
/etc/bumblebee/xorg.conf.nvidia

resolved the issue for me.


Dell XPS 15 L502X AMD64
Nvidia GT525m
Ubuntu 13.04 updated.

@hanynowsky Thanks! Its resolved the issue for me too!

I can confirm this works

nemchik commented Apr 11, 2013

when i opened
/etc/bumblebee/xorg.conf.nvidia
i saw

BusID "PCI:02:00:0"

i uncommented and switched the 2 to 1

BusID "PCI:01:00:0"
did not work for me

had to run
lspci | grep NVIDIA
which gave me 4 so i used
BusID "PCI:04:00:0"
which works

i also tried
BusID "PCI:02:00:0"
didnt work

btw im using 2:1.13.3-0ubuntu5

Adding the BusID also fixed it for me. Thanks!

Adding the BusID also fixed it for me. Thanks! [2]


Ubuntu 13.04
Geforce GTX 680m

ArchangeGabriel referenced this issue in Bumblebee-Project/bbswitch Apr 15, 2013

Closed

Bumblebee on Lenovo G780 #54

Owner

ArchangeGabriel commented Apr 15, 2013

What do we decide about this?

Owner

Lekensteyn commented Apr 15, 2013

if there is really no other way, we can take advantage of our custom xorg.conf.d directory and generate a configuration on post-installation. That is very ugly and I hope there is a better way to solve this.

Contributor

amonakov commented Apr 15, 2013

Looks like this problem appeared long ago, with this change that probably landed in xorg-1.13.0, but was latent for some reason; either Ubuntu finally uncovers it by trying really hard to open the Intel DRM device, or some logic is broken in one of their patches for dual-gpu systems.

The mention Xorg change does not take into account -isolateDevice option, and thus the server will probe all PCI devices. I've chatted with Dave Airlie and opened this bugreport on fd.o. There's a chance it will be fixed soon.

SavageWolf's method worked for me on newest kubuntu beta

Owner

ArchangeGabriel commented Apr 19, 2013

Given that Ubuntu 13.04 will be out next thursday, should we add a temporary fix in bumblebee-ppa for adding BusID at installation time?

Contributor

amonakov commented Apr 20, 2013

Assuming that on nVidia+nVidia systems the "integrated" GPU comes first, and also assuming that PCI bus:slot:function numbers will be in the range of 00-09 (lspci uses hexadecimal, xorg.conf expects decimal), here's a statement to adjust xorg.conf.nvidia at postinst:

sed -i xorg.conf.nvidia  -e "s/^#   BusID \"PCI:02:00:0\"\$/    BusID \"PCI:$(lspci -d 10de: | grep -E VGA\|3D | tail -1 | sed -e 's/ .*//;s/\./:/')\"/"
Owner

Lekensteyn commented Apr 20, 2013

Using numeric identifiers as shown on https://github.com/Bumblebee-Project/Bumblebee/wiki/Troubleshooting should work too. Instead of running on postinst, what about doing it in the init script? That ensures that Bumblebee does not have to be reinstalled when it was installed with the intel chip selected in BIOS.

Do you know whether it is possible to put this configuration in a separate file?

E.g.:

# xorg.conf.nvidia
Section "Device"
    Identifier "Device1"
    # other options...
EndSection

# xorg.conf.d/busid.conf
# autogenerated - do not edit, edit xorg.conf.nvidia or xorg.conf.nouveau instead
Section "Device"
    Identifier "Device1"
    BusID "PCI:...."
EndSection
Owner

ArchangeGabriel commented Apr 20, 2013

@Lekensteyn: It does work, tested right now.

However, this make me figure out an other bug, I have this in Xorg.8.log:

[ 49579.265] (++) Using config directory: "/etc/bumblebee/xorg.conf.d"
[ 49579.265] (==) Using system config directory "/usr/share/X11/xorg.conf.d"

So, our config directory does not replace the default one... Does anyone confirm?

Contributor

amonakov commented Apr 20, 2013

I've answered the config dir concern in Bumblebee-Project/Bumblebee#222#issuecomment-16702297

Owner

ArchangeGabriel commented Apr 20, 2013

@Lekensteyn: Could you add that temporary fix to the Ubuntu specific init script?

Owner

Lekensteyn commented Apr 21, 2013

In what order are Xorg configs evaluated? First the xorg.conf.d, then the main xorg.conf?

I have changed my mind, if the initscript was used to create the file, we then have an untracked file that is never removed. With the below patch, pciutils still needs to be added to the dependency list. Comments?

diff --git a/raring/bumblebee/debian/bumblebee-nvidia.dirs b/raring/bumblebee/debian/bumblebee-nvidia.dirs
new file mode 100644
index 0000000..e44a289
--- /dev/null
+++ b/raring/bumblebee/debian/bumblebee-nvidia.dirs
@@ -0,0 +1 @@
+etc/bumblebee/xorg.conf.d
diff --git a/raring/bumblebee/debian/bumblebee-nvidia.postinst b/raring/bumblebee/debian/bumblebee-nvidia.postinst
index 993e6fb..7a5695e 100644
--- a/raring/bumblebee/debian/bumblebee-nvidia.postinst
+++ b/raring/bumblebee/debian/bumblebee-nvidia.postinst
@@ -5,6 +5,8 @@

 set -e

+xconffile=/etc/bumblebee/xorg.conf.d/nvidia-busid.conf
+
 case "$1" in
   configure)
   # Ubuntu and Debian's packaging of nvidia's proprietary driver differ greatly
@@ -32,6 +34,27 @@ case "$1" in

     fi

+    if ! grep -q '^[\t ]*BusID' /etc/bumblebee/xorg.conf.nvidia; then
+        # assume first device to be discrete, both in Optimus and nvidia/nvidia
+        busid=$(lspci -d10de: -nn | grep '\[030[02]\]' | cut -d' ' -f1 | tr . : | head -1)
+        if [ -z "$busid" ]; then
+            echo "No Nvidia card found. If you really have an Optimus system,"
+            echo "try selecting the Optimus setup in BIOS and run:"
+            echo "dpkg-reconfigure bumblebee-nvidia"
+        else
+            echo "Selecting $busid as discrete nvidia card. If this is incorrect,"
+            echo "edit the BusID line in /etc/bumblebee/xorg.conf.nvidia"
+            cat > $xconffile <<EOF
+# autogenerated - do not edit, edit xorg.conf.nvidia or xorg.conf.nouveau instead
+# workaround for https://github.com/Bumblebee-Project/Bumblebee/issues/367
+Section "Device"
+    Identifier "Device1"
+    BusID "PCI:$busid"
+EndSection
+EOF
+        fi
+    fi
+
     ldconfig
     # this has a chance of crashing the machine with mainline kernels...
     grep -q '^nouveau ' /proc/modules && rmmod nouveau || true
diff --git a/raring/bumblebee/debian/bumblebee-nvidia.postrm b/raring/bumblebee/debian/bumblebee-nvidia.postrm
index 07fcfde..92e1b62 100644
--- a/raring/bumblebee/debian/bumblebee-nvidia.postrm
+++ b/raring/bumblebee/debian/bumblebee-nvidia.postrm
@@ -5,6 +5,8 @@

 set -e

+xconffile=/etc/bumblebee/xorg.conf.d/nvidia-busid.conf
+
 case "$1" in
   purge|remove|abort-install)
   # Ubuntu and Debian's packaging of nvidia's proprietary driver differ greatly
@@ -32,6 +34,8 @@ case "$1" in
     fi

     ldconfig
+
+    rm -f $xconffile
     ;;
   upgrade|failed-upgrade|abort-upgrade|disappear)
     ;;
Owner

ArchangeGabriel commented Apr 21, 2013

According to Xorg.8.log, the first evaluated is xorg.conf, then xorg.conf.d.

My only comment is about assume first device to be discrete, both in Optimus and nvidia/nvidia, which is not true, we only assume that in nvidia/nvidia, since we filter device with 10de.

So if it's OK for everyone, I propose to merge this patch in bumblebee-ppa/raring and release Bumblebee 3.2.

Contributor

amonakov commented Apr 21, 2013

In what order are Xorg configs evaluated?

Does it matter?

Ah, reading further I suppose that's because you suggest the user to edit one file, but autogenerate another? Then you probably also want to know the precedence rules, i.e. what value is used if BusID is specified in two files. At the moment I don't know the answer.

if the initscript was used to create the file, we then have an untracked file that is never removed

You could create bumblebee-xorg.conf.d in /var/run and remove it on stop initscript action (modifying files in /etc from initscripts is not a good idea anyway).

assume first device to be discrete

is that really the case for nvidia/nvidia? IOW, you probably know this better than me, why choose the first rather than the last?

If you're interested in my opinion, I don't have a preference one way or another regarding initscript-vs-postinst choice. I like the postinst way because it looks more transparent, but I won't expect the Ubuntu users to pay attention to postinst messages.

Owner

Lekensteyn commented Apr 21, 2013

I meant that the first nvidia device is assumed to be the discrete one. Should BusID be removed from the main xorg.conf.nvidia file with a reference to the one in xorg.conf.d?

You could create bumblebee-xorg.conf.d in /var/run and remove it on stop initscript action (modifying files in /etc from initscripts is not a good idea anyway).

I agree, initscript shouldn't touch /etc, that is the job of the system admin. The /var/run idea is an option, but I like the postinst better.

is that really the case for nvidia/nvidia? IOW, you probably know this better than me, why choose the first rather than the last?

The first nvidia device is always picked in src/bumblebeed.c, so I adopted that behavior.

Owner

ArchangeGabriel commented Apr 21, 2013

I meant that the first nvidia device is assumed to be the discrete one. Should BusID be removed from the main xorg.conf.nvidia file with a reference to the one in xorg.conf.d?

Or just let me try setting different values in both to see which one is picked, so that we would know wether this is needed or not.

Contributor

amonakov commented Apr 21, 2013

Should BusID be removed from the main xorg.conf.nvidia file with a reference to the one in xorg.conf.d?

+1 on this.

Btw, what about nouveau? Looks like some people want to run the bumblebee/nouveau combo. Does it need BusID as well, or does it somehow avoid this issue?

Owner

ArchangeGabriel commented Apr 21, 2013

Ok, busid.conf from xorg.conf.d takes precedence over xorg.conf.nvidia, so yes, we need to remove that from xorg.conf.nvidia (but let the comments about nvidia/nvidia) and points to e one in busid.conf (Ubuntu only, so this should be done in bumblebee-nvidia again).

@amonakov: nouveau is affected too, that's why the busid.conf file looks better. About nouveau, we would also need to remove the nvidia-hybrid-whatever file from /etc/modprobe.d as long as they will alias nouveau to off.

Owner

Lekensteyn commented Apr 21, 2013

It is not bumblebee's job to remove the conf file from /etc/modprobe.d/, that is a bug that needs to be fixed by Ubuntu. If nouveau is affected by this too, we should unify the identifiers. What about changing it from Device[01] to DiscreteNvidia?

(edited to add "not")

Contributor

amonakov commented Apr 21, 2013

I'd recommend to avoid diverging the Ubuntu sources by doing the BusID migration in main git, and making only the autoconfiguration script an Ubuntu-specific part.

Owner

ArchangeGabriel commented Apr 21, 2013

@Lekensteyn: I guess it miss a "not" in your first sentence.

Ok for unifying the identifiers, I did not care about that since I did that a long time ago on my setup to try to fix some things. Agree on DiscreteNvidia.

@amonakov: Ok, then we should move this in Bumblebee, and modify Lekensteyn's patch accordingly (since the file and the line will already exists, but not anymore in xorg.conf.nvidia).

Contributor

amonakov commented Apr 21, 2013

Btw, it appears we don't set "AutoAddGPU" "false" in xorg.conf.nvidia? This is bad. We should.

amonakov closed this Apr 21, 2013

amonakov reopened this Apr 21, 2013

Owner

ArchangeGabriel commented Apr 21, 2013

I've pushed one commit for parts of this.

BTW I find that the name of 99-remove-nvidia-dev.conf is confusing since it now also adds the nvidia device (since @amonakov work on --no-xorg). What about 99-manage-nvidia-dev.conf?

Owner

Lekensteyn commented Apr 21, 2013

I see, b3c28d4 added some extra rules. I thought the nvidia module took care of creating these nodes? Mind that if we rename that file, it would break installation scripts of distributions.

Owner

ArchangeGabriel commented Apr 21, 2013

That's why I didn't change it. Not a big thing anyway.

New version of the above patch (not exactly sure, because still don't know how basic tools like sed work...):

diff --git a/raring/bumblebee/debian/bumblebee-nvidia.dirs b/raring/bumblebee/debian/bumblebee-nvidia.dirs
new file mode 100644
index 0000000..e44a289
--- /dev/null
+++ b/raring/bumblebee/debian/bumblebee-nvidia.dirs
@@ -0,0 +1 @@
+etc/bumblebee/xorg.conf.d
diff --git a/raring/bumblebee/debian/bumblebee-nvidia.postinst b/raring/bumblebee/debian/bumblebee-nvidia.postinst
index 993e6fb..7a5695e 100644
--- a/raring/bumblebee/debian/bumblebee-nvidia.postinst
+++ b/raring/bumblebee/debian/bumblebee-nvidia.postinst
@@ -5,6 +5,8 @@

 set -e

+xconffile=/etc/bumblebee/xorg.conf.d/busid.conf
+
 case "$1" in
   configure)
   # Ubuntu and Debian's packaging of nvidia's proprietary driver differ greatly
@@ -32,6 +34,27 @@ case "$1" in

     fi

+    if ! grep -q '^[\t ]*BusID' $xconffile; then
+        # assume first device to be discrete, both in Optimus and nvidia/nvidia
+        busid=$(lspci -d10de: -nn | grep '\[030[02]\]' | cut -d' ' -f1 | tr . : | head -1)
+        if [ -z "$busid" ]; then
+            echo "No Nvidia card found. If you really have an Optimus system,"
+            echo "try selecting the Optimus setup in BIOS and run:"
+            echo "dpkg-reconfigure bumblebee-nvidia"
+        else
+            echo "Selecting $busid as discrete nvidia card. If this is incorrect,"
+            echo "edit the BusID line in /etc/bumblebee/xorg.conf.d/busid.conf"
+            sed -i $xconffile  -e "s/^#   BusID \"PCI:02:00:0\"\$/    BusID \"PCI:$busid\"/"
+        fi
+    fi
+
     ldconfig
     # this has a chance of crashing the machine with mainline kernels...
     grep -q '^nouveau ' /proc/modules && rmmod nouveau || true
diff --git a/raring/bumblebee/debian/bumblebee-nvidia.postrm b/raring/bumblebee/debian/bumblebee-nvidia.postrm
index 07fcfde..92e1b62 100644
--- a/raring/bumblebee/debian/bumblebee-nvidia.postrm
+++ b/raring/bumblebee/debian/bumblebee-nvidia.postrm
@@ -5,6 +5,8 @@

 set -e

+xconffile=/etc/bumblebee/xorg.conf.d/busid.conf
+
 case "$1" in
   purge|remove|abort-install)
   # Ubuntu and Debian's packaging of nvidia's proprietary driver differ greatly
@@ -32,6 +34,8 @@ case "$1" in
     fi

     ldconfig
+
+    rm -f $xconffile
     ;;
   upgrade|failed-upgrade|abort-upgrade|disappear)
     ;;
Contributor

amonakov commented Apr 21, 2013

No, the module cannot create nodes (it's an EXPORT_SYMBOL_GPL interface).

Might be a good idea to rename that file to force distributions to review the changes. They might not like the 0666 permissions, and some distributions (Gentoo) already have similar mechanisms in place, so they don't need this.

Contributor

amonakov commented Apr 21, 2013

@ArchangeGabriel, you need to change on instance of xorg.conf.nvidia in an echo statement.

Re. udev rules, who am I kidding, nobody will pay attention to contents. We probably need to point it out in the release notes or something.

Owner

ArchangeGabriel commented Apr 21, 2013

@amonakov Thanks, fixed, was already wrong in Lekensteyn patch from where I took that.

For udev, ok for changing the name and telling about that in release notes, so that packagers will be aware of the new options (none backend and --no-xorg) and take into account the changes that happened in this file for packagers using their own files for this task.

Owner

Lekensteyn commented Apr 21, 2013

I realised that the udev is installed with make install. Nobody is going to notice the name change unless we point it out in the release notes (I assume packagers do actually read it right?)

As for the sed magic, I suggest:

sed -i $xconffile -r -e "s/^([\t ]*#[\t ]*BusID[\t ]*)\"[^"]*\"$/&\"PCI$busid\"/"

This still works if the whitespace does not exactly match.

What about the ! grep -q '^[\t ]*BusID' $xconffile condition? Do we still need to keep that?

Owner

ArchangeGabriel commented Apr 21, 2013

Ok for sed, about the condition I've hesitated to remove it, I think we can indeed get rid of it.

Owner

ArchangeGabriel commented Apr 21, 2013

Lekensteyn: Is your sed line working? I think there is a missing : between PCI and $busid, plus it does not return on my terminal.

sed -i $xconffile -r -e "s/^([\t ]*#[\t ]*BusID[\t ]*)\"[^"]*\"$/&\"PCI$busid\"/"
> 
Owner

ArchangeGabriel commented Apr 21, 2013

I've changed it to:

sed -i $xconffile -r -e "s/^([\t ]*#[\t ]*BusID[\t ]*)\"[^\"]*\"$/&\"PCI\:$busid\"/"

But then it only adds "PCI:01:00:0" to the end of the line.

Owner

ArchangeGabriel commented Apr 21, 2013

And the patch becomes this since busid.conf became an upstream file:

diff --git a/raring/bumblebee/debian/bumblebee-nvidia.postinst b/raring/bumblebee/debian/bumblebee-nvidia.postinst
index 993e6fb..7a5695e 100644
--- a/raring/bumblebee/debian/bumblebee-nvidia.postinst
+++ b/raring/bumblebee/debian/bumblebee-nvidia.postinst
@@ -5,6 +5,8 @@

 set -e

+xconffile=/etc/bumblebee/xorg.conf.d/busid.conf
+
 case "$1" in
   configure)
   # Ubuntu and Debian's packaging of nvidia's proprietary driver differ greatly
@@ -32,6 +34,27 @@ case "$1" in

     fi

+    # assume first device to be discrete in nvidia/nvidia
+    busid=$(lspci -d10de: -nn | grep '\[030[02]\]' | cut -d' ' -f1 | tr . : | head -1)
+    if [ -z "$busid" ]; then
+        echo "No Nvidia card found. If you really have an Optimus system,"
+        echo "try selecting the Optimus setup in BIOS and run:"
+        echo "dpkg-reconfigure bumblebee-nvidia"
+    else
+        echo "Selecting $busid as discrete nvidia card. If this is incorrect,"
+        echo "edit the BusID line in /etc/bumblebee/xorg.conf.d/busid.conf"
+        sed -i $xconffile -r -e "s/^([\t ]*#[\t ]*BusID[\t ]*)\"[^\"]*\"$/&\"PCI\:$busid\"/"
+    fi
+
     ldconfig
     # this has a chance of crashing the machine with mainline kernels...
     grep -q '^nouveau ' /proc/modules && rmmod nouveau || true
Owner

Lekensteyn commented Apr 21, 2013

Indeed, missing escape and instead of group backreference, I inserted the whole pattern. It also failed to remove the comment mark (#). This new, tested version corrects that:

sed -i $xconffile -r -e "s/^([\t ]*)#([\t ]*BusID[\t ]*)\"[^\"]*\"$/\\1 \\2\"PCI\:$busid\"/"

As for the postinst patch, I suggest to change the /etc/....busid.conf reference to $xconffile.

fj commented Apr 21, 2013

For people who froze their xserver-xorg-core package as a workaround, should we revert and update?

Owner

ArchangeGabriel commented Apr 21, 2013

Yes, if you set the BusID manually, or else wait for Bumblebee 3.2 to be released first.

protist commented Apr 26, 2013

Adding BusID manually in the Devices section of /etc/bumblebee/xorg.conf.nvidia doesn't seem to work for me, but it seems from the sed commands that I should have had a commented version of this line in that file already? I did not. Is there a way to regenerate the default file? If not, could someone please post what should be the correct file?

protist commented Apr 26, 2013

I should mention that I attempted to place it here:

Section "Device"
    Identifier "Device1"
    BusID "PCI:01:00:0"

but when running optirun -vv -debug glxspheres I got

[   58.718820] [DEBUG]Reading file: /etc/bumblebee/bumblebee.conf
[   58.719160] [DEBUG]optirun version 3.1 starting...
[   58.719170] [DEBUG]Active configuration:
[   58.719174] [DEBUG] bumblebeed config file: /etc/bumblebee/bumblebee.conf
[   58.719178] [DEBUG] X display: ebug
[   58.719182] [DEBUG] LD_LIBRARY_PATH: /usr/lib/nvidia-304:/usr/lib32/nvidia-304
[   58.719186] [DEBUG] Socket path: /var/run/bumblebee.socket
[   58.719189] [DEBUG] Accel/display bridge: auto
[   58.719192] [DEBUG] VGL Compression: proxy
[   58.719246] [DEBUG]Using auto-detected bridge virtualgl
[   61.744084] [INFO]Response: Yes. X is active.

[   61.744098] [INFO]Running application using virtualgl.
[   61.744204] [DEBUG]Process vglrun started, PID 2959.
Polygons in scene: 62464
[VGL] ERROR: Could not open display ebug.
[   61.771997] [DEBUG]SIGCHILD received, but wait failed with No child processes
[   61.772029] [DEBUG]Socket closed.
[   61.772056] [DEBUG]Killing all remaining processes.
Contributor

amonakov commented Apr 26, 2013

[VGL] ERROR: Could not open display ebug.

Use --debug (not -debug).

protist commented Apr 26, 2013

Oh. That's silly of me. Sorry about that, and thanks for the quick response.

2xyo commented May 7, 2013

Hi,

I think that I have the same issue:

optirun --debug -vv glxspheres 
[ 1717.517784] [DEBUG]Reading file: /etc/bumblebee/bumblebee.conf
[ 1717.518056] [INFO]Configured driver: nvidia
[ 1717.518188] [DEBUG]optirun version 3.2.1 starting...
[ 1717.518196] [DEBUG]Active configuration:
[ 1717.518200] [DEBUG] bumblebeed config file: /etc/bumblebee/bumblebee.conf
[ 1717.518204] [DEBUG] X display: :8
[ 1717.518217] [DEBUG] LD_LIBRARY_PATH: /usr/lib/nvidia-304:/usr/lib32/nvidia-304
[ 1717.518221] [DEBUG] Socket path: /var/run/bumblebee.socket
[ 1717.518224] [DEBUG] Accel/display bridge: auto
[ 1717.518228] [DEBUG] VGL Compression: proxy
[ 1717.518232] [DEBUG] VGLrun extra options: 
[ 1717.518235] [DEBUG] Primus LD Path: /usr/lib/x86_64-linux-gnu/primus:/usr/lib/i386-linux-gnu/primus
[ 1717.518282] [DEBUG]Using auto-detected bridge virtualgl
[ 1717.957671] [INFO]Response: No - error: Could not load GPU driver

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

[ 1717.957691] [DEBUG]Socket closed.
[ 1717.957705] [ERROR]Aborting because fallback start is disabled.
[ 1717.957710] [DEBUG]Killing all remaining processes.

/etc/bumblebee/xorg.conf.nvidia

Section "ServerLayout"
    Identifier  "Layout0"
    Option      "AutoAddDevices" "false"
    Option      "AutoAddGPU" "false"
EndSection

Section "Device"
    Identifier  "DiscreteNvidia"
    Driver      "nvidia"
    VendorName  "NVIDIA Corporation"

#  $ lspci | egrep 'VGA|3D'
# 00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09)
# 01:00.0 3D controller: NVIDIA Corporation GF117M [GeForce 610M/710M / GT 620M/625M/630M/720M] (rev a1)

BusID "PCI:01:00:0"

    Option "ProbeAllGpus" "false"

    Option "NoLogo" "true"
    Option "UseEDID" "false"
    Option "UseDisplayDevice" "none"
EndSection

/etc/bumblebee/bumblebee.conf

[bumblebeed]
VirtualDisplay=:8
KeepUnusedXServer=false
ServerGroup=bumblebee
TurnCardOffAtExit=false
NoEcoModeOverride=false
Driver=nvidia
XorgConfDir=/etc/bumblebee/xorg.conf.d

[optirun]
Bridge=auto
VGLTransport=proxy
PrimusLibraryPath=/usr/lib/x86_64-linux-gnu/primus:/usr/lib/i386-linux-gnu/primus
AllowFallbackToIGC=false

[driver-nvidia]
KernelDriver=nvidia
PMMethod=auto
LibraryPath=/usr/lib/nvidia-current:/usr/lib32/nvidia-current
XorgModulePath=/usr/lib/nvidia-current/xorg,/usr/lib/xorg/modules
XorgConfFile=/etc/bumblebee/xorg.conf.nvidia

Linux yoyo-laptop 3.8.0-19-generic #30-Ubuntu SMP Wed May 1 16:35:23 UTC 2013 x86_64 x86_64 x86_64 
--
Distributor ID: Ubuntu
Description:    Ubuntu 13.04
Release:    13.04
Codename:   raring
--
baseboard-manufacturer: ASUSTeK COMPUTER INC.
baseboard-product-name: UX32VD
baseboard-version     : 1.0       
system-manufacturer   : ASUSTeK COMPUTER INC.
system-product-name   : UX32VD
system-version        : 1.0       
bios-vendor           : American Megatrends Inc.
bios-version          : UX32VD.214
bios-release-date     : 01/29/2013
--
bbswitch-dkms 0.6-1~raringppa2
bumblebee 3.2.1-1~raringppa2
bumblebee-nvidia 3.2.1-1~raringppa2
nvidia-304 304.88-0ubuntu1
nvidia-current 304.88-0ubuntu1
nvidia-settings-304 304.88-0ubuntu1
primus 20130427-1~raringppa1

/var/log/syslog

May  7 21:55:49 yoyo-laptop bumblebeed[5680]: Received Terminated signal.
May  7 21:55:49 yoyo-laptop bumblebeed[5983]: /usr/sbin/bumblebeed 3.2.1 started
May  7 21:55:49 yoyo-laptop kernel: [ 1707.887900] bbswitch: disabling discrete graphics
May  7 21:55:49 yoyo-laptop kernel: [ 1707.994780] pci 0000:01:00.0: power state changed by ACPI to D3cold
May  7 21:55:56 yoyo-laptop kernel: [ 1715.058476] bbswitch: enabling discrete graphics
May  7 21:55:57 yoyo-laptop kernel: [ 1715.479607] pci 0000:01:00.0: power state changed by ACPI to D0
May  7 21:55:57 yoyo-laptop kernel: [ 1715.495189] nvidia: Unknown symbol mcount (err 0)
May  7 21:55:57 yoyo-laptop bumblebeed[5983]: Module nvidia-304 could not be loaded (timeout?)
May  7 21:55:57 yoyo-laptop bumblebeed[5983]: Could not load GPU driver
May  7 21:56:09 yoyo-laptop kernel: [ 1727.664637] nvidia: Unknown symbol mcount (err 0)
Owner

ArchangeGabriel commented May 11, 2013

No, that's a different one. I think your driver is too old for your system. Please try installing nvidia-313-updates instead of nvidia-304.

Hi, I am still getting the same error..
here is output of "optirun -v --debug glxgears"
[ 2818.116092] [DEBUG]optirun version 3.2.1 starting...
[ 2818.116151] [DEBUG]Active configuration:
[ 2818.116163] [DEBUG] bumblebeed config file: /etc/bumblebee/bumblebee.conf
[ 2818.116173] [DEBUG] X display: :8
[ 2818.116182] [DEBUG] LD_LIBRARY_PATH: /usr/lib/nvidia-313-updates:/usr/lib32/nvidia-313-updates
[ 2818.116193] [DEBUG] Socket path: /var/run/bumblebee.socket
[ 2818.116202] [DEBUG] Accel/display bridge: auto
[ 2818.116212] [DEBUG] VGL Compression: proxy
[ 2818.116221] [DEBUG] VGLrun extra options:
[ 2818.116231] [DEBUG] Primus LD Path: /usr/lib/x86_64-linux-gnu/primus:/usr/lib/i386-linux-gnu/primus
[ 2818.116318] [DEBUG]Using auto-detected bridge virtualgl
[ 2818.147227] [INFO]Response: No - error: XORG No devices detected.

[ 2818.147246] [ERROR]Cannot access secondary GPU - error: XORG No devices detected.

[ 2818.147250] [DEBUG]Socket closed.
[ 2818.147266] [ERROR]Aborting because fallback start is disabled.
[ 2818.147271] [DEBUG]Killing all remaining processes.

When I downgrade the xserver-xorg-core package, I can get it running. Here is my bumblebee.conf file


[bumblebeed]
VirtualDisplay=:8
KeepUnusedXServer=false
ServerGroup=bumblebee
TurnCardOffAtExit=false
NoEcoModeOverride=false
Driver=
XorgConfDir=/etc/bumblebee/xorg.conf.d

[optirun]
Bridge=auto
VGLTransport=proxy
PrimusLibraryPath=/usr/lib/x86_64-linux-gnu/primus:/usr/lib/i386-linux-gnu/primus
AllowFallbackToIGC=false

[driver-nvidia]
KernelDriver=nvidia-current
PMMethod=auto
LibraryPath=/usr/lib/nvidia-current:/usr/lib32/nvidia-current
XorgModulePath=/usr/lib/nvidia-current/xorg,/usr/lib/xorg/modules
XorgConfFile=/etc/bumblebee/xorg.conf.nvidia

[driver-nouveau]
KernelDriver=nouveau
PMMethod=auto

XorgConfFile=/etc/bumblebee/xorg.conf.nouveau

And here is my xorg.conf.nvidia file


Section "ServerLayout"
Identifier "Layout0"
Option "AutoAddDevices" "false"
Option "AutoAddGPU" "false"
EndSection

Section "Device"
Identifier "DiscreteNvidia"
Driver "nvidia"
VendorName "NVIDIA Corporation"

BusID "PCI:01:00:0"

Option "ProbeAllGpus" "false"

Option "NoLogo" "true"
Option "UseEDID" "false"
Option "UseDisplayDevice" "none"

EndSection

Using nvidia-331, and a downgraded xorg-server-core. Still not working... yawns.

r@i7:~$ optirun --debug -vv glxspheres
[ 380.069422] [DEBUG]Reading file: /etc/bumblebee/bumblebee.conf
[ 380.070065] [INFO]Configured driver: nvidia
[ 380.070404] [DEBUG]optirun version 3.2.1 starting...
[ 380.070432] [DEBUG]Active configuration:
[ 380.070441] [DEBUG] bumblebeed config file: /etc/bumblebee/bumblebee.conf
[ 380.070450] [DEBUG] X display: :8
[ 380.070459] [DEBUG] LD_LIBRARY_PATH: /usr/lib/nvidia-331:/usr/lib32/nvidia-331
[ 380.070468] [DEBUG] Socket path: /var/run/bumblebee.socket
[ 380.070476] [DEBUG] Accel/display bridge: auto
[ 380.070485] [DEBUG] VGL Compression: proxy
[ 380.070493] [DEBUG] VGLrun extra options:
[ 380.070501] [DEBUG] Primus LD Path: /usr/lib/x86_64-linux-gnu/primus:/usr/lib/i386-linux-gnu/primus
[ 380.070559] [DEBUG]Using auto-detected bridge virtualgl
[ 380.090382] [INFO]Response: No - error: Could not load GPU driver

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

[ 380.090398] [DEBUG]Socket closed.
[ 380.090414] [ERROR]Aborting because fallback start is disabled.
[ 380.090418] [DEBUG]Killing all remaining processes.

Owner

ArchangeGabriel commented Dec 27, 2013

It should just work OOTB on any 12.04+ Ubuntu version. There is no need for a downgraded X.org.

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