MrMEEE / bumblebee-Old-and-abbandoned

OUTDATED!!!!! - Replaced by "The Bumblebee Project" and "Ironhide"
http://www.martin-juhl.dk/2011/08/ironhide-reporting-for-duty/
469 stars 50 forks source link

Many bugfixes and cleanup (developed on Ubuntu) #468

Closed Lekensteyn closed 13 years ago

Lekensteyn commented 13 years ago

intel displays and OpenGL

After installation of Bumblebee, the symlinks are "restored" / removed to use Mesa. Since the alternatives system is bypassed, a future upgrade of nvidia-current or alike will recreate the links to use nvidia again. This will cause issues after a restart of the X server (reboot or logout+restart X): glxgears will fail to operate and Firefox+WebGL has the potentional to crash. More details are available in the extended comments in install-files/bumblebee-configuration or stages/installbumblebee.UBUNTU. The new implementation uses the alternatives system to force the use of the mesa drivers by default so subsequent upgrades will not cause a fallback to nvidia which would break OpenGL for the intel display. Cases which may cause Bumblebee to fail in the new situation when OpenGL is used because Mesa is used:

The ten seconds loop after enabling the nvidia card has been lowered to three since the X server process will always be available in a few seconds unless some unknown kernel bug causes processes to spawn very slow (unlikely and it'll never happen). Furthermore, if the X server failed to start, the log is examined to provide (hopefully) useful debugging information. This is currently limited to informing the user of the log file and that rmmod nouveau and/ or modprobe nvidia-current must be called.

Previously, if the initscript failed to start the X server, optirun would still attempt to run the application. That is guaranteed to fail so the initscript returns the proper exit codes which are verified by optirun.

One optirun file

If optirun is referenced by a symlink named "optirun32", the 32-bits libraries are used. The file can be used on both a 32-bit and a 64-bit system

Custom X display

$VGL_DISPLAY from /etc/default/bumblebee is respected in optirun and the init script /etc/init.d/bumblebee. Previously, the initscript would always start the X server on :1. It's now set to :8 to avoid problems with fast user switching under Ubuntu and other distros which increases the display number without checking if it's actually free.

Improved process detection

Whenever possible, pidof on the absolute path of binaries is used. This has an advantage over ps that processes containing a part of the search term are ignored. Previously, commands like less optirun would generate a false positive, and due to an invalid search term, xorg?conf?nvidia would be matched too (. is a wildcard character). lsof is used on the path to the libnvidia-glcore.so file to avoid false positiives and to speed up searching.

MrMEEE commented 13 years ago

There are really some good things here.. but I will have to look the whole thing through before merging.. Thanks a lot...

Lekensteyn commented 13 years ago

Understood, would you like me to pull small changes the next time? Note that my proposed commits breaks #460. A cleaner approach would be querying the alternatives system for the mesa lib or test a set of files for their existence.

MrMEEE commented 13 years ago

If possible, yes, would like you to break it into smaller commits, as it simplify things alot..

ArchangeGabriel commented 13 years ago

Re-open this until we manually merge the content.

Lekensteyn commented 13 years ago

Please run grep -EHrn --exclude-dir=.git ':1|\.X1' /path/to/git/source against the source tree to find the below files that needs to be updated to work with the VGL_DISPLAY variable in /etc/default/bumblebee. I do not know what the "right" way is to create initscripts on Fedora or OpenSUSE.

The next files needs review:

./install-files/optirun64.opensuse:20
./install-files/optirun64.opensuse:29
./install-files/optirun32.opensuse:20
./install-files/optirun32.opensuse:29
./install-files/bumblebee.script.openSUSE:41
./install-files/bumblebee.script.openSUSE:42
./install-files/bumblebee.script.openSUSE:43
./install-files/bumblebee.script.fedora:28
./install-files/bumblebee.default:9
./stages/setvariables.FEDORA:3
./stages/packageinstall.OPENSUSE:175
./stages/packageinstall.OPENSUSE:187
./stages/packageinstall.OPENSUSE:197
./stages/packageinstall.OPENSUSE:218
Ximi1970 commented 13 years ago

I will change the VGL_DISLAY for openSuSE.

Lekensteyn commented 13 years ago

Bugs found:

Perhaps lsof should be used in conjuction with pidof/pgrep/ps?

Lekensteyn commented 13 years ago

I'm closing the pull request because I'm reordering the commits which includes more bugfixes / enhancements.