bumblebee: add patch to correctly load/unload nvidia-uvm
This commit is contained in:
parent
688effc53a
commit
5ced5895a3
3 changed files with 49 additions and 18 deletions
5
srcpkgs/bumblebee/INSTALL.msg
Normal file
5
srcpkgs/bumblebee/INSTALL.msg
Normal 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.
|
34
srcpkgs/bumblebee/patches/nvidia-uvm-support.patch
Normal file
34
srcpkgs/bumblebee/patches/nvidia-uvm-support.patch
Normal 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);
|
||||
}
|
|
@ -1,22 +1,22 @@
|
|||
# Template file for 'bumblebee'
|
||||
pkgname=bumblebee
|
||||
version=3.2.1
|
||||
revision=5
|
||||
revision=6
|
||||
only_for_archs="i686 x86_64"
|
||||
build_style=gnu-configure
|
||||
configure_args="
|
||||
CONF_DRIVER_MODULE_NVIDIA=nvidia
|
||||
CONF_LDPATH_NVIDIA=/usr/lib
|
||||
CONF_MODPATH_NVIDIA=/usr/lib/xorg/modules
|
||||
--sbindir=/usr/bin
|
||||
--with-udev-rules=/usr/lib/udev/rules.d/
|
||||
--without-pidfile"
|
||||
CONF_DRIVER_MODULE_NVIDIA=nvidia
|
||||
CONF_LDPATH_NVIDIA=/usr/lib
|
||||
CONF_MODPATH_NVIDIA=/usr/lib/xorg/modules
|
||||
--with-udev-rules=/usr/lib/udev/rules.d/
|
||||
--without-pidfile"
|
||||
hostmakedepends="pkg-config help2man"
|
||||
makedepends="VirtualGL-devel glib-devel MesaLib-devel"
|
||||
depends="VirtualGL"
|
||||
conf_files="
|
||||
/etc/bumblebee/bumblebee.conf
|
||||
/etc/bumblebee/xorg.conf.nouveau
|
||||
/etc/bumblebee/xorg.conf.nvidia"
|
||||
/etc/bumblebee/bumblebee.conf
|
||||
/etc/bumblebee/xorg.conf.nouveau
|
||||
/etc/bumblebee/xorg.conf.nvidia"
|
||||
system_groups="bumblebee"
|
||||
short_desc="NVIDIA Optimus support for Linux through VirtualGL"
|
||||
maintainer="Juan RP <xtraeme@voidlinux.eu>"
|
||||
|
@ -25,16 +25,8 @@ license="GPL-3"
|
|||
distfiles="http://www.bumblebee-project.org/${pkgname}-${version}.tar.gz"
|
||||
checksum=1018703b07e2f607a4641249d69478ce076ae5a1e9dd6cff5694d394fa7ee30e
|
||||
|
||||
only_for_archs="i686 x86_64"
|
||||
build_options="systemd"
|
||||
replaces="runit-void<20141013_2"
|
||||
|
||||
post_install() {
|
||||
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
|
||||
vmkdir usr/share/bash-completion/completions
|
||||
|
|
Loading…
Reference in a new issue