bumblebee: add patch to correctly load/unload nvidia-uvm

This commit is contained in:
Alessio Sergi 2015-06-23 01:00:00 +02:00
parent 688effc53a
commit 5ced5895a3
3 changed files with 49 additions and 18 deletions

View file

@ -0,0 +1,5 @@
In order to use Bumblebee, add your user to 'bumblebee' group:
# usermod -a -G bumblebee <username>
and then reboot to make it effective.

View file

@ -0,0 +1,34 @@
https://github.com/Bumblebee-Project/Bumblebee/issues/565#issuecomment-62546098
diff --git src/bbsecondary.c src/bbsecondary.c
index 6b635ee..7885aa5 100644
--- src/bbsecondary.c
+++ src/bbsecondary.c
@@ -119,6 +119,17 @@ static bool switch_and_load(void)
if (!module_load(module_name, driver_name)) {
set_bb_error("Could not load GPU driver");
return false;
+ } else {
+ /* XXX NVIDIA UVM support */
+ if (strstr(module_name, "nvidia")) { /* We are using NVIDIA's proprietary driver */
+ char uvm_module_name[1024];
+ sprintf(uvm_module_name, "%s-uvm", module_name);
+ if (!module_load(uvm_module_name, "nvidia_uvm")) {
+ char log_string[1024];
+ sprintf(log_string, "Cannot load UVM module: %s\n", uvm_module_name);
+ bb_log(LOG_ERR, log_string);
+ }
+ }
}
}
return true;
@@ -232,6 +243,10 @@ static void switch_and_unload(void)
}
/* unload the driver loaded by the graphica card */
if (pci_get_driver(driver, pci_bus_id_discrete, sizeof driver)) {
+ /* XXX NVIDIA UVM support */
+ if (strstr(driver, "nvidia")) {
+ module_unload("nvidia_uvm");
+ }
module_unload(driver);
}

View file

@ -1,22 +1,22 @@
# Template file for 'bumblebee' # Template file for 'bumblebee'
pkgname=bumblebee pkgname=bumblebee
version=3.2.1 version=3.2.1
revision=5 revision=6
only_for_archs="i686 x86_64"
build_style=gnu-configure build_style=gnu-configure
configure_args=" configure_args="
CONF_DRIVER_MODULE_NVIDIA=nvidia CONF_DRIVER_MODULE_NVIDIA=nvidia
CONF_LDPATH_NVIDIA=/usr/lib CONF_LDPATH_NVIDIA=/usr/lib
CONF_MODPATH_NVIDIA=/usr/lib/xorg/modules CONF_MODPATH_NVIDIA=/usr/lib/xorg/modules
--sbindir=/usr/bin --with-udev-rules=/usr/lib/udev/rules.d/
--with-udev-rules=/usr/lib/udev/rules.d/ --without-pidfile"
--without-pidfile"
hostmakedepends="pkg-config help2man" hostmakedepends="pkg-config help2man"
makedepends="VirtualGL-devel glib-devel MesaLib-devel" makedepends="VirtualGL-devel glib-devel MesaLib-devel"
depends="VirtualGL" depends="VirtualGL"
conf_files=" conf_files="
/etc/bumblebee/bumblebee.conf /etc/bumblebee/bumblebee.conf
/etc/bumblebee/xorg.conf.nouveau /etc/bumblebee/xorg.conf.nouveau
/etc/bumblebee/xorg.conf.nvidia" /etc/bumblebee/xorg.conf.nvidia"
system_groups="bumblebee" system_groups="bumblebee"
short_desc="NVIDIA Optimus support for Linux through VirtualGL" short_desc="NVIDIA Optimus support for Linux through VirtualGL"
maintainer="Juan RP <xtraeme@voidlinux.eu>" maintainer="Juan RP <xtraeme@voidlinux.eu>"
@ -25,16 +25,8 @@ license="GPL-3"
distfiles="http://www.bumblebee-project.org/${pkgname}-${version}.tar.gz" distfiles="http://www.bumblebee-project.org/${pkgname}-${version}.tar.gz"
checksum=1018703b07e2f607a4641249d69478ce076ae5a1e9dd6cff5694d394fa7ee30e checksum=1018703b07e2f607a4641249d69478ce076ae5a1e9dd6cff5694d394fa7ee30e
only_for_archs="i686 x86_64"
build_options="systemd"
replaces="runit-void<20141013_2"
post_install() { post_install() {
vsv bumblebeed vsv bumblebeed
# Install systemd service
if [ "$build_option_systemd" ]; then
vinstall scripts/systemd/bumblebeed.service 644 usr/lib/systemd/system
fi
# Make bash_completion work # Make bash_completion work
vmkdir usr/share/bash-completion/completions vmkdir usr/share/bash-completion/completions