View previous topic :: View next topic |
Author |
Message |
vilehost n00b
Joined: 07 Jan 2016 Posts: 26
|
Posted: Thu Jan 07, 2016 11:34 pm Post subject: anyone have a working bumblebee+nvidia setup? |
|
|
so for the past 4 years or so, i've had the darnedest time trying to get bumblebee to function 100% on gentoo, it's literally forcing me to stay put on arch all this time.
the problem has persisted all this time, it'll show random errors, mouse, font, no screen, wrong module loaded.. anything you can think of, i've had bumblebeed's log yell at me about, so yesterday i decided to compile a new system and give it a go, same thing were happening, i spent 30 hours researching the latests posts circa 2012 till now, lots of people had similar issues, lots of aforementioned fixes, made a custom xorg.conf.nvidia... added a line to grub.conf, the end result which i'm now sitting on is about 90% functionality, in that power savings provided by bbswitch are working, the card is shutoff when not in use which was most of my concern anyway.. but hey who likes to have a gpu that doesnt work when you want it to.
the problem now is that, whenever i attempt to do any optirun command, the system crashes, just a total freeze.. as luck would have it other people also had experienced this https://bbs.archlinux.org/viewtopic.php?id=180377.. which points to another thread https://bbs.archlinux.org/viewtopic.php?pid=1326090#p1326090 where there are reports of a fix, then the guy returning to his thread to mark solved
soo doing that changed nothing, bbswitch/bumblebee powersaving functionality is a go, however actually running anything on the card.. not so good.
does anyone have a current gentoo install with all latest main branch kernel/bumblebee/nvidia drivers running like a charm? if so post here so i can be mad.
:::::::::::FIXED::::::::::
dont know exactly, what changed because i tried 2 previous times but, added i915 nvidia bbswitch to modules in that order (apparently if bbswitch loads first it may be an issue with nvidia) then recompiled kernel(if you use genkernel make sure to atleast use menuconfig to check if noveau is supported and remove it)and initramfs, rebooted, and now optirun is successful.
excellent. |
|
Back to top |
|
|
[n00b@localhost] Apprentice
Joined: 30 Aug 2004 Posts: 266 Location: London, UK
|
Posted: Tue Jan 12, 2016 10:59 am Post subject: |
|
|
I just noticed this.
I have a working bumblebee setup on a Lenovo W530 (Intel + nVidia). If your magically working configuration ever ends up magically non-working, give me a shout.
Code: | ~ # lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09)
01:00.0 VGA compatible controller: NVIDIA Corporation GK107GLM [Quadro K2000M] (rev ff)
~ # emerge -pv1 --nodeps $(qlist -IC bumblebee xf86-video-intel nvidia-drivers)
These are the packages that would be merged, in order:
[ebuild R ~] x11-drivers/nvidia-drivers-358.16-r1:0/358::gentoo USE="X acpi gtk2 gtk3 kms multilib tools uvm -pax_kernel" 0 KiB
[ebuild R ] x11-drivers/xf86-video-intel-2.99.917-r2::gentoo USE="dri sna udev -debug -uxa -xvmc" 0 KiB
[ebuild R ] x11-misc/bumblebee-3.2.1::gentoo USE="bbswitch" VIDEO_CARDS="nvidia -nouveau" 0 KiB
Total: 3 packages (3 reinstalls), Size of downloads: 0 KiB |
|
|
Back to top |
|
|
vilehost n00b
Joined: 07 Jan 2016 Posts: 26
|
Posted: Tue Jan 12, 2016 7:39 pm Post subject: |
|
|
thank's, i'm bound to break it sooner or later. so far so good though
--actually, there may be something you could help me with..it's a prob with vgl, let's say you optirun somthing in this case avogadro
Code: | optirun avogadro
xauth: (argv):1: unable to read any entries from file "/var/lib/VirtualGL/vgl_xauth_key"
|
now it'll run and all will be well and functioning, it's just that msg, also if i try to add vgl to modules/rc-update add.. the system will hang on starting VirtualGL, nothing will be loaded after that and i have to chroot into the system to del from runlevel.
i did a minimal survey for forums this morning trying to find similar symptoms and i came across.. page 16 of https://forum.manjaro.org/index.php?topic=14080.225 specifically on reply 232 and 234 he found his fix
on 232 he modified /etc/conf.d/vgl.. but it's pertaining to un-commenting an entry dealing with lightDM which i do not use.. so i'm not sure about that.. for him doing that caused bumblebee to not start.. then on post 234 he configured bumblebee to run with no pid effectively making it functional again, now his vgl is loaded at runlevel and the system doesnt need to be chrooted.
i'm just confused because i dont understand what's causing it still, because this sounds like different cause but same effect in which case if i did what he did the effect might remain and or bloom into a bigger problem.
i also read that because bumblebee cannot function without vgl..which means if bumblebee and optirun are working inturn that means vgl is working despite the log, that it's not that vgl didnt start it's just that it didnt return the init process or something.
anyway no rush.. it's not a big deal as it seems all is well anyway plus i just cant wrap my brain around it right now too much going on at work, let me know if any ideas come to mind.
thanks again |
|
Back to top |
|
|
Yamakuzure Advocate
Joined: 21 Jun 2006 Posts: 2284 Location: Adendorf, Germany
|
Posted: Thu Jan 14, 2016 7:57 am Post subject: |
|
|
What exactly are you using?
My system works fine for over 18 months now using bumblebee with the following hardware: Code: | ~ # lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation 4th Gen Core Processor Integrated Graphics Controller (rev 06)
01:00.0 VGA compatible controller: NVIDIA Corporation GK106GLM [Quadro K2100M] (rev a1) | And the following packages: Code: | ~ # eix -I "(bumblebee|virtualgl|primus|bbswitch)"
[I] sys-power/bbswitch
Available versions: 0.8 (**)9999[1] {KERNEL="linux"}
Installed versions: 9999[1](10:42:35 28.12.2015)(KERNEL="linux")
Homepage: https://github.com/Bumblebee-Project/bbswitch
Description: Toggle discrete NVIDIA Optimus graphics card
[I] x11-misc/bumblebee
Available versions: 3.2.1 **9999[1] (**)9999-r2[2] {+bbswitch VIDEO_CARDS="nouveau nvidia"}
Installed versions: 9999-r2[2](10:54:49 28.12.2015)(bbswitch VIDEO_CARDS="nvidia -nouveau")
Homepage: http://bumblebee-project.org https://github.com/Bumblebee-Project/Bumblebee
Description: Service providing elegant and stable means of managing Optimus graphics chipsets
[I] x11-misc/virtualgl
Available versions: 2.3.3 ~2.4.1 ~2.4.1-r1 ~2.4.1-r2 ~2.4.1-r3 (**)9999-r1[1] {libressl ssl ABI_MIPS="n32 n64 o32" ABI_PPC="32 64" ABI_S390="32 64" ABI_X86="32 64 x32"}
Installed versions: 9999-r1[1](08:48:49 14.01.2016)(ssl ABI_MIPS="-n32 -n64 -o32" ABI_PPC="-32 -64" ABI_S390="-32 -64" ABI_X86="32 64 -x32")
Homepage: http://www.virtualgl.org/
Description: Run OpenGL applications remotely with full 3D hardware acceleration
[I] x11-misc/primus [1]
Available versions: (**)9999 {ABI_MIPS="n32 n64 o32" ABI_PPC="32 64" ABI_S390="32 64" ABI_X86="32 64 x32"}
Installed versions: 9999(00:47:42 11.12.2015)(ABI_MIPS="-n32 -n64 -o32" ABI_PPC="-32 -64" ABI_S390="-32 -64" ABI_X86="32 64 -x32")
Homepage: https://github.com/amonakov/primus
Description: Faster OpenGL offloading for Bumblebee
[1] "bumblebee" /var/lib/layman/bumblebee
[2] "seden" /var/lib/layman/seden | The live packages are rock solid on my system, and I can run vmware workstation, boinc with CUDA, steam and wine using primusrun just fine. Code: | ~ # nvidia-smi
Thu Jan 14 08:58:59 2016
+------------------------------------------------------+
| NVIDIA-SMI 355.11 Driver Version: 355.11 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 Quadro K2100M Off | 0000:01:00.0 Off | N/A |
| N/A 44C P0 N/A / N/A | 238MiB / 2047MiB | 96% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 22251 G /opt/vmware/lib/vmware/bin/vmware-vmx.real 68MiB |
| 0 22287 G Xorg 8MiB |
| 0 26960 C ...52_x86_64-pc-linux-gnu__BRP6-cuda32-nv270 150MiB |
+-----------------------------------------------------------------------------+ | Note: The Xorg entry is the BOINC manager. _________________ Important German:- "Aha" - German reaction to pretend that you are really interested while giving no f*ck.
- "Tja" - German reaction to the apocalypse, nuclear war, an alien invasion or no bread in the house.
|
|
Back to top |
|
|
[n00b@localhost] Apprentice
Joined: 30 Aug 2004 Posts: 266 Location: London, UK
|
Posted: Thu Jan 14, 2016 2:00 pm Post subject: |
|
|
vilehost wrote: | if i try to add vgl to modules/rc-update add.. the system will hang on starting VirtualGL, nothing will be loaded after that and i have to chroot into the system to del from runlevel. |
I don't have vgl in /etc/modules.d nor in rc-update. It is started automatically by bumblebee in the default runlevel:
Code: | ~ # rc-status
Runlevel: default
...
bumblebee [ started ]
...
Dynamic Runlevel: hotplugged
Dynamic Runlevel: needed/wanted
...
vgl [ started ]
...
Dynamic Runlevel: manual |
vilehost wrote: | on 232 he modified /etc/conf.d/vgl.. |
I haven't edited my /etc/conf.d/vgl nor /etc/init.d/vgl:
Code: |
# /etc/conf.d/vgl
DISPLAY="${DISPLAY:-:0}"
# Make it a function in case we have to repeat it in init script later
set_xauth() {
# common case (works in almost all tested environments (except of lightdm)):
XAUTHORITY="$(ps wwax -C X,Xorg -o args= --sort=-stime | grep -m 1 -o '\B[-]auth\s*/var\S*' | cut -d ' ' -f 2)"
# kdm and some others:
# XAUTHORITY="$(find /var/run/xauth/A${DISPLAY}-*|tail -n1)"
# gdm:
# XAUTHORITY="/var/gdm/${DISPLAY}.Xauth"
# slim:
# XAUTHORITY="/var/run/slim.auth"
# lightdm:
# XAUTHORITY="/var/run/lightdm/root/${DISPLAY}"
# lxdm:
# XAUTHORITY="/var/run/lxdm/lxdm-${DISPLAY}.auth"
}
set_xauth
|
Code: |
#!/sbin/runscript
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
# TODO: description="*" and other OpenRC 0.9+ candies
depend() {
need xdm
after sshd
}
start() {
ebegin "Starting VirtualGL"
truncate --size=0 /var/lib/VirtualGL/vgl_xauth_key
set_xauth
if [ -z "$XAUTHORITY" ]; then
einfo "Waiting for xauthority..."
# wait for xauth file
while true; do
set_xauth
if [ -e "$XAUTHORITY" ]; then
break;
fi
sleep 1
done
fi
xauth -f /var/lib/VirtualGL/vgl_xauth_key add $DISPLAY . $(xauth -f $XAUTHORITY list | awk '{print $3;exit}') && \
chmod 644 /var/lib/VirtualGL/vgl_xauth_key
eend $?
}
stop() {
ebegin "Stopping VirtualGL"
[ -f /var/lib/VirtualGL/vgl_xauth_key ] && \
rm /var/lib/VirtualGL/vgl_xauth_key
eend $?
}
|
I use KDM installed by KDE. I sometimes use LightDM when I'm booting into LXQt which I also have installed. I am currently in the process of replacing both with SDDM. As far as I can remember I haven't had those problems with any of the display managers but I don't tend to run stuff that requires vgl from LXQt.
Bumblebee contains a kernel module, bbswitch, which is used to switch the nVidia card on and off. On my system, at boot, it is on, so bumblebee switches it off when it is started. The optirun command switches the nVidia card on, starts an Xorg server on it, then runs the program given to it using the Xorg bound to the nVidia card and a "GL bridge", then stops the Xorg server and switches the nVidia card off again. The GL bridge allows the program to render to an Xorg server running on the nVidia card, then copies the results into the Intel card's framebuffer for it to display. Bumblebee works with two GL bridges: VirtualGL (in portage) and primus (available in an overlay).
The VirtualGL bridge requires the xauth key to be able to write into the Xorg-on-the-Intel-card's framebuffer (I think). The error message says that it is unable to parse the key from the xauth file. My first question would be, does the file exist at the correct location? Have you tried running the xauth command from the initscript by yourself to see if there is an error? |
|
Back to top |
|
|
vilehost n00b
Joined: 07 Jan 2016 Posts: 26
|
Posted: Thu Jan 14, 2016 6:37 pm Post subject: |
|
|
Code: | lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)
01:00.0 VGA compatible controller: NVIDIA Corporation GF108M [GeForce GT 540M] (rev ff)
|
Code: |
eix -I "(bumblebee|virtualgl|primus|bbswitch)"
[I] sys-power/bbswitch
Available versions: 0.8 **9999[1] {KERNEL="linux"}
Installed versions: 0.8(12:43:58 PM 01/07/2016)(KERNEL="linux")
Homepage: https://github.com/Bumblebee-Project/bbswitch
Description: Toggle discrete NVIDIA Optimus graphics card
[I] x11-misc/bumblebee
Available versions: 3.2.1 **9999[1] {+bbswitch VIDEO_CARDS="nouveau nvidia"}
Installed versions: 3.2.1(01:33:10 AM 01/12/2016)(bbswitch VIDEO_CARDS="nvidia -nouveau")
Homepage: http://bumblebee-project.org https://github.com/Bumblebee-Project/Bumblebee
Description: Service providing elegant and stable means of managing Optimus graphics chipsets
[I] x11-misc/virtualgl
Available versions: 2.3.3 ~2.4.1 ~2.4.1-r1 ~2.4.1-r2 ~2.4.1-r3 **9999-r1[1] {libressl ssl ABI_MIPS="n32 n64 o32" ABI_PPC="32 64" ABI_S390="32 64" ABI_X86="32 64 x32"}
Installed versions: 2.3.3(07:58:19 PM 01/06/2016)(ssl ABI_MIPS="-n32 -n64 -o32" ABI_PPC="-32 -64" ABI_S390="-32 -64" ABI_X86="64 -32 -x32")
Homepage: http://www.virtualgl.org/
Description: Run OpenGL applications remotely with full 3D hardware acceleration
|
the system is an i72670qm + g540m, specifically an asus k53sv.. i have to optirun nvidia-smi otherwise it'll tell me driver isnt loaded, which i guess is normal
Code: |
optirun nvidia-smi
xauth: (argv):1: unable to read any entries from file "/var/lib/VirtualGL/vgl_xauth_key"
Thu Jan 14 08:27:03 2016
+------------------------------------------------------+
| NVIDIA-SMI 355.11 Driver Version: 355.11 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GT 540M Off | 0000:01:00.0 N/A | N/A |
| N/A 44C P0 N/A / N/A | 8MiB / 1023MiB | N/A Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 Not Supported |
+-----------------------------------------------------------------------------+
|
as i said, everything is rock solid on this end aswell, everything works with optirun it's just the log entry with no impact on system.. or atleast functionality wise i cant see any problems.
my /etc/conf.d/vgl is default stock with no changes, same with the init.d/vgl... i use LXDM at the moment to launch kde, previously i just startxfce4.. both work properly although i'll say i haven't tried to optirun anything in xfce4..i could later to see if the xauth msg also appears in term's there.
but.. as for var/lib/VirtualGL/vgl_xauth_key... file does not exist... i think i recall reading somewhere in that thread i posted that the guys was located elsewhere.
i cant add bumblebee to default because during boot it loads vgl which causes the same hang to happen as if i just added vgl to the runlevel, i have to run bumblebeed postboot to get it up and running.
also i dont have primus installed i've always just used optirun... guess i been out of the loop for a minute.
--update, ok so i installed primus.. it doesnt give me the xauth message.... probably because it passes things differently then optirun i'm thinking... but im just going to go with it... no reason to break what isn't broken. |
|
Back to top |
|
|
ExecutorElassus Veteran
Joined: 11 Mar 2004 Posts: 1435 Location: Berlin, Germany
|
Posted: Fri Jan 15, 2016 4:28 pm Post subject: |
|
|
ohai, thread about bumblebee that comes up right as I can't get bumblebee to work!
(home you don't mind my jumping in)
So: what's the good way to get bumblebee installed? I have a brand-new MSI MP-72, with Optimus, and I can't get X to start. If I run 'lightdm' it spits out what looks like a core dump, the log says nothing after loading xorg.conf, and I get no X. *sadface*
What's a good guide for getting it working? All I see are guides from, like, 2013.
Cheers,
EE |
|
Back to top |
|
|
[n00b@localhost] Apprentice
Joined: 30 Aug 2004 Posts: 266 Location: London, UK
|
Posted: Fri Jan 15, 2016 5:26 pm Post subject: |
|
|
vilehost wrote: | --update, ok so i installed primus.. it doesnt give me the xauth message.... probably because it passes things differently then optirun i'm thinking... but im just going to go with it... no reason to break what isn't broken. |
Mind walking me through what you did there? I have a working bumblebee setup with virtualGL but am thinking of replacing the virtualGL part with primus because virtualGL is slow for games and links against OpenSSL.
One of the main reasons for optimus is having a more powerful graphics card than can be enabled on demand and not suck up power when it isn't being used, but if all the performance gained is lost using a slow bridge then what's the point (other than having more features than an integrated card like CUDA and OpenGL 4.2)? VirtualGL links against OpenSSL because it can transport OpenGL across network interfaces (one of the reasons it is slow - primus does everything in RAM AFAIK). This is a problem for me at the moment because steam statically links a different version of OpenSSL to the steam client, and anything using this (such as games run through optirun with virtualGL) crash.
I'm a bit sceptical about the future of primus though as development has been nonexistent for about 3 years now.
ExecutorElassus wrote: | What's a good guide for getting it working? All I see are guides from, like, 2013. |
Not much has changed so those guides should still work. I followed the Bumblebee guide on the Arch wiki to get it working (but did so in 2013). One of these days I'll write down what I did and put it up on the Gentoo Wiki but I don't have much spare time right now.
EDIT -- I've found that the bumblebee repo on github is even older than that of primus! I suppose it would be hypocritical of me to continue to use bumblebee because primus is out of date (although they don't seem to have tagged any official releases). |
|
Back to top |
|
|
ExecutorElassus Veteran
Joined: 11 Mar 2004 Posts: 1435 Location: Berlin, Germany
|
Posted: Fri Jan 15, 2016 5:39 pm Post subject: |
|
|
followed the guide. When I try 'startx', it dumps lines and lines onto the console, looking like
Code: |
7f44d75a0000-7f7f44d75a10000 r--p 0003000 08:14 6320129 /usr/lib64/libXfont.so.1.4.1 |
The last one is
Code: | ffffffffff600000-ffffffffff601000 00000000 00:00 0 [vgsyscall] |
and then xinit gives up.
The Xorg.log.0 file says nothing after loading the xorg.conf file
my xorg.conf file reads:
--EDIT--
oh, I wrote the first line of xorg.conf as 'Sectio "ServerLayout"' (notice the missing 'n'). So that's why that puked. Now I see that it says "Could not find provider with name NVIDIA-0". How do I find the proper name of the provider?
Cheers,
EE |
|
Back to top |
|
|
vilehost n00b
Joined: 07 Jan 2016 Posts: 26
|
Posted: Fri Jan 15, 2016 6:25 pm Post subject: |
|
|
[n00b@localhost] wrote: | vilehost wrote: | --update, ok so i installed primus.. it doesnt give me the xauth message.... probably because it passes things differently then optirun i'm thinking... but im just going to go with it... no reason to break what isn't broken. |
Mind walking me through what you did there?
. |
i didnt do anything other than emerge primus. in bumblebee.conf you can switch the bridge entry to primus which i have not done yet.. because i think when you primusrun it automatically uses primus istead of virtualgl -- which is why i dont get the xauth message with it as opposed to optirun i believe. so i think if your .conf has auto in it for bridge optirun will use vgl as default, but when you primusrun, auto defaults to primus. so for you, just emerge primus, and primusrun something to see what's up. i'm thinking for primus use with good old optirun, just change the bridge method from auto to primus
(btw i dont use the one in the bumblebee overlay/git, just use the regular one from repod
Quote: |
What's a good guide for getting it working? All I see are guides from, like, 2013.
Cheers,
EE |
(jump to the lbottom for why i think your x wont start all stuff in between is bumblebee related)
well, there's not one guide currently that's going to give you all the details you need. the bumblebee info in the archwiki is great for the dependencies you need, when things didnt work correctly i googled up all the info i could.
but in theory everything should work out of the box(aside from modules). i'll try to walk you step by step of what i did (i just made this installation like last week) i'm going to have to wing it.
firstly i got xfce4 working.
so lets say your on a fresh install, no de or anything. first in your portage/make.conf add a line that says VIDEO="nvidia intel" also you can put vaapi into use if you want but it's not neccesary it has nothing to do with this, just a tip.
install your xf86-video-intel driver, libva,(libva-intel-driver ebuild is broken atm so avoid that), mesa, xorg-drivers and xorg-server, now install your DE, for the purposes of this rough walkthrough i suggest xfce4 as starting it is literally as simple as typing startxfce4.
now after that and you have a working desktop enviroment, install nvidia-drivers. after that do eselect opengl list, you should have 2 entries, nvidia and xorg-x11, set it to xorg-x11, eselect opencl list should only show one, nvidia.
now emerge bumblebee and bbswitch.
after both are installed, open /etc/bumblebee/bumblebee.conf, for the driver entry, type nvidia. save it and close.
add i915 nvidia bbswitch in that order to your /etc/conf.d/modules (you might have to blacklist the nouveau module). add your user to the bumblebee group (gpassword -a (user) -g bumblebee) now reboot, startxfce4 open a terminal as root or sudo bumblebeed, then from another terminal optirun glxgears -info, if all goes well it'll confirm your gpu is in use.
now i'm not saying this is the correct way to go about things, but it's what worked for me.
i think the reason why you cant get x started is because you mightve changed somthing like xorg.conf or xorg.conf.nvidia... something, because my de worked out of the box with no added attention, also i think i mightve adverted this issue your having by getting xfce4 up and running first and then getting bumblebee to work, the way you did it, installing bumblebee and nvidia first before you had a working de.. it might have changed the default conf file or something, not sure.
this is my /etc/bumblebee/xorg.conf.nvidia which is stock.
Code: | 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
|
now remember, i didnt touch any xorg.conf.. for instance i dont even have an xorg.conf in my /etc/X11/ nor my /etc/X11/xorg.conf.d so i'm thinking thats where your problem is hiding.. i.e it's trying to read from something from a file that shouldnt even exist. --(not that it shouldnt exist ever, sometimes one is probably still needed, but i think nowadays xorg is setup to be compatible with most rigs out of the box with out modification)
Last edited by vilehost on Mon Feb 01, 2016 4:54 pm; edited 1 time in total |
|
Back to top |
|
|
vilehost n00b
Joined: 07 Jan 2016 Posts: 26
|
Posted: Mon Feb 01, 2016 1:04 pm Post subject: |
|
|
heads up if your going to upgrade to the newest nvidia-driver
Code: |
* x11-drivers/nvidia-drivers
Latest version available: 358.16-r1
Latest version installed: 358.16-r1
Size of files: 75,541 KiB
Homepage: http://www.nvidia.com/
Description: NVIDIA Accelerated Graphics Driver
License: GPL-2 NVIDIA-r2
|
you must explicitly tell it not to build with kms either Code: | USE="-kms" emerge nvidia-drivers | or add it to package.use or whatever your prefer to do, it causes a total disabling of bumblebees power management.
this happened last year with one of there releases aswell
if you already upgraded and didnt notice, it's why your running 10-15c hotter and lifetime is cut in half.
https://github.com/Bumblebee-Project/Bumblebee/issues/719
building without kms still causes you to manually kill the nvidia server after each useage of optirun/primus run with
Code: | rmmod nvidia_modeset
rmmod nvidia
kill (bumblebeed pid)
bumblebeed |
|
|
Back to top |
|
|
Yamakuzure Advocate
Joined: 21 Jun 2006 Posts: 2284 Location: Adendorf, Germany
|
Posted: Wed Feb 03, 2016 11:17 am Post subject: |
|
|
vilehost wrote: | you must explicitly tell it not to build with kms either Code: | USE="-kms" emerge nvidia-drivers | or add it to package.use or whatever your prefer to do, it causes a total disabling of bumblebees power management. | Not here, mate. Built with kms and everything works fine, since I added nvidia-modeset to my blacklist of not to automatically load kernel modules. vilehost wrote: | if you already upgraded and didnt notice, it's why your running 10-15c hotter and lifetime is cut in half. | Unless you edit /etc/modprobe.d/nvidia-rmmod.conf to remove nvidia-modeset, too. It shoudl read: Code: | ~ $ cat /etc/modprobe.d/nvidia-rmmod.conf
# Nvidia UVM support
remove nvidia modprobe -r --ignore-remove nvidia-modeset nvidia-uvm nvidia | Otherwise bbswitch can no longer unload the nvidia drivers and turn the discrete card off. vilehost wrote: | building without kms still causes you to manually kill the nvidia server after each useage of optirun/primus run with
Code: | rmmod nvidia_modeset
rmmod nvidia
kill (bumblebeed pid)
bumblebeed |
| What? Why? /etc/init.d/bumblebee is working on my system and optirun/primusrun work nicely and the card gets turned off automatically when the last application using it quits.- Nothing running using nvidia:
Code: | # /etc/init.d/bumblebee status
* status: started
# nvidia-smi
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.
# cat /proc/acpi/bbswitch
0000:01:00.0 OFF | Now starting something using primusrun: Code: | ~ $ primusrun glxgears -info
GL_RENDERER = Quadro K2100M/PCIe/SSE2
GL_VERSION = 4.5.0 NVIDIA 358.16
GL_VENDOR = NVIDIA Corporation
GL_EXTENSIONS = (removed! Too lengthy!)
VisualID 201, 0xc9
3690 frames in 5.0 seconds = 737.998 FPS
6789 frames in 5.0 seconds = 1357.495 FPS
3086 frames in 5.0 seconds = 617.039 FPS
...
# nvidia-smi
Wed Feb 3 12:12:59 2016
+------------------------------------------------------+
| NVIDIA-SMI 358.16 Driver Version: 358.16 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 Quadro K2100M Off | 0000:01:00.0 Off | N/A |
| N/A 35C P0 N/A / N/A | 26MiB / 2047MiB | 11% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 12245 G glxgears 7MiB |
| 0 12256 G Xorg 8MiB |
+-----------------------------------------------------------------------------+
# cat /proc/acpi/bbswitch
0000:01:00.0 ON | Now ending glxgears and take a look again: Code: | # nvidia-smi
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.
# cat /proc/acpi/bbswitch
0000:01:00.0 OFF | See? The reason for bbswitch losing the possibility to turn the card off, was, at least on my systenm, the new nvidia-modeset module, which got autoloaded (pulling nvidia-uvm and nvidia in its wake) by the kernel on boot time. I blacklisted it, and all is well again.
Note: Blacklisting using kernel options in grub only means, that the kernel does not see the card and goes "Hey! Cool card on that PCI bus, Bro! Lemme activate it for ya!" _________________ Important German:- "Aha" - German reaction to pretend that you are really interested while giving no f*ck.
- "Tja" - German reaction to the apocalypse, nuclear war, an alien invasion or no bread in the house.
|
|
Back to top |
|
|
vilehost n00b
Joined: 07 Jan 2016 Posts: 26
|
Posted: Wed Feb 03, 2016 5:33 pm Post subject: |
|
|
yeah i still get
Code: | rmmod: ERROR: Module nvidia is in use by: nvidia_modeset
[ 131.086071] [ERROR]Unloading nvidia driver timed out.
|
after adding the blacklist line to grub. have to manually rmmod and restart bb after using gpu. dont know. my nvidia-rmmod.conf is the same.
i rebuilt nvidia-drivers with kms to try aswell but still no go
one note of detail i suppose is the only thing that start/stops properly is bumblebee, init.d status will show it stopped when not running gpu, and started when something is being ran with opti/primusrun, then off again when i close the application, nvidia-smi will still show its loaded and bbswitch proc will still report :ON
Code: | Calculating dependencies... done!
[ebuild R ] sys-kernel/gentoo-sources-4.1.15-r1
[ebuild R ] x11-misc/virtualgl-2.3.3
[ebuild R ] x11-misc/bumblebee-3.2.1 [3.2.1]
[ebuild R ] x11-drivers/nvidia-drivers-358.16-r1
|
are you using a different kernel? |
|
Back to top |
|
|
Yamakuzure Advocate
Joined: 21 Jun 2006 Posts: 2284 Location: Adendorf, Germany
|
Posted: Thu Feb 04, 2016 9:53 am Post subject: |
|
|
Do not use rmmod. Use "modprobe -r". rmmod only tries to yank the module out, while "modprobe -r" honests the settings nvidia-rmmod.conf.
vilehost wrote: | one note of detail i suppose is the only thing that start/stops properly is bumblebee, init.d status will show it stopped when not running gpu, and started when something is being ran with opti/primusrun, then off again when i close the application, nvidia-smi will still show its loaded and bbswitch proc will still report :ON | Then there is something completely wrong. How I showed above is how it is supposed to work:- /etc/init.d/bumblebee always lists as "started"
- When no application is using the nvidia gpu, its status must be OFF, no nvidia module is loaded, and nvidia-smi must error out.
- When any application is started via optirun/primusrun, the bumblebee daemon does the following:
- Tell bbswitch that the card is needed.
- If the card is OFF, bbswitch turns it to ON and loads the nvidia module
- optirun/primusrun use the bumblebee daemon to get a virtual server over the discrete card and run the application on it
- Now bbswitch reports the card to be ON and nvidia-smi shows the status.
- Once the application stops, the foolowing is happening:
- The ending optirun/primusrun process tells the bumblebee daemon that its going bye-bye.
- If no other application is running, the daemon asks bbswitch to turn off the card.
- bbswitch unloads the nvidia module using "modprobe -r" (that's why the nvidia-rmmod.conf is so important!)
- bbswitch turns off the card.
- Now bbswitch reports the card as OFF and nvidia-smi errors out again.
vilehost wrote: | are you using a different kernel? |
I am currently using gentoo-sources-4.3.5. Here is my setup: Code: | ~ $ eix -I "(bbswitch|bumblebee|primus|virtualgl)"
[I] sys-power/bbswitch
Available versions: 0.8 (**)9999[1] {KERNEL="linux"}
Installed versions: 9999[1](17:35:42 03.02.2016)(KERNEL="linux")
Homepage: https://github.com/Bumblebee-Project/bbswitch
Description: Toggle discrete NVIDIA Optimus graphics card
[I] x11-misc/bumblebee
Available versions: 3.2.1 **9999[1] (**)9999-r2[2] {+bbswitch VIDEO_CARDS="nouveau nvidia"}
Installed versions: 9999-r2[2](15:58:50 20.01.2016)(bbswitch VIDEO_CARDS="nvidia -nouveau")
Homepage: http://bumblebee-project.org https://github.com/Bumblebee-Project/Bumblebee
Description: Service providing elegant and stable means of managing Optimus graphics chipsets
[I] x11-misc/virtualgl
Available versions: 2.3.3 ~2.4.1 ~2.4.1-r1 ~2.4.1-r2 ~2.4.1-r3 (**)9999-r1[1] {libressl ssl ABI_MIPS="n32 n64 o32" ABI_PPC="32 64" ABI_S390="32 64" ABI_X86="32 64 x32"}
Installed versions: 9999-r1[1](15:58:33 20.01.2016)(ssl ABI_MIPS="-n32 -n64 -o32" ABI_PPC="-32 -64" ABI_S390="-32 -64" ABI_X86="32 64 -x32")
Homepage: http://www.virtualgl.org/
Description: Run OpenGL applications remotely with full 3D hardware acceleration
[I] x11-misc/primus [1]
Available versions: (**)9999 {ABI_MIPS="n32 n64 o32" ABI_PPC="32 64" ABI_S390="32 64" ABI_X86="32 64 x32"}
Installed versions: 9999(15:59:08 20.01.2016)(ABI_MIPS="-n32 -n64 -o32" ABI_PPC="-32 -64" ABI_S390="-32 -64" ABI_X86="32 64 -x32")
Homepage: https://github.com/amonakov/primus
Description: Faster OpenGL offloading for Bumblebee
[1] "bumblebee" /var/lib/layman/bumblebee
[2] "seden" /var/lib/layman/seden
4 Hits. | The reason I use the live ebuilds are the modprobe related issues that got fixed in the repository but not yet released.
And with app-portage/smart-live-rebuild maintaining live ebuilds is a piece of cake, so I do not bother so much.
I do hope there will be a bug fix release anytime soon. Bumblebee 3.2.1 is from 26 Apr 2013, so it would be about time, wouldn't it?
Important: Use the updated live ebuild for bumblebee from my overlay "seden". It uses the appropriate branch. The portage tree ebuild uses the master branch, which wasn't updated for three years. All development got into the develop branch. I have filed a bug report, but the ebuild isn't updated, yet.
However, even with the live ebuilds, you should check the following:- boot your machine
- do not login to any DE
- just switch back to your console if you are in a login manager
- check with lsmod whether any nvidia module is loaded.
If any nvidia module is loaded, your blacklisting is not enough. You have pre-loaded the modules somewhere. _________________ Important German:- "Aha" - German reaction to pretend that you are really interested while giving no f*ck.
- "Tja" - German reaction to the apocalypse, nuclear war, an alien invasion or no bread in the house.
|
|
Back to top |
|
|
vilehost n00b
Joined: 07 Jan 2016 Posts: 26
|
Posted: Thu Feb 04, 2016 3:57 pm Post subject: |
|
|
i have no idea why init.d would be showing bumblebee as stopped when it is started, and it is working, power saving, optirun will show my proper card and driver being used it's 100% functional as far as that goes... so no idea there
the thing with rmmod is i have to use it since this nividia update because modprobe -r will spit out errors about no modules found...
maybe thats why adding the modprobe.blacklist line to grub and blacklist isnt doing anything for me? maybe i should change the nvidia-rmmod.conf file to use rmmod instead of modprobe -r? because when you say dont use rmmod use modprobe, maybe my machine is backwards somehow now.. because as said above i have to use rmmod manually because manually modprobe -r will just give errors about no nvidia-modeset found
aaaand nope, changing nvidia-rmmod.conf to use rmmod instead still yields same results.
hmm
okay so i patched module.c and built my own bumblebee with a tiny patch someone posted on git Added nvidia_modeset detection for issue #699
https://github.com/arafey/Bumblebee/commit/09d537e8e5313cd0f2c7bf6620ca70454de8a04a
amongst other things had to change nvidia_modeset to nvidia-modeset,
and it's working now.
this is the original thread https://github.com/Bumblebee-Project/Bumblebee/issues/699
theres also this patch NEW MAJOR PATCH FOR FIX bumblebee issue with nvidia_nomodeset https://github.com/manjaro/packages-community/commit/95bf2c39a3daec6371d9d49ea896699eef22aaab is this the fix you said wasn't moved to live yet?
also, i haven't used layman in a loong long time, prolly when i was testing sabyon in 2010.. the only way i remember to install a 3rd party ebuild is with doing the whole local overlay method, i have no idea how to pull it from an eix sync'd layman overlay, would i just mask the one in master the same way? |
|
Back to top |
|
|
Yamakuzure Advocate
Joined: 21 Jun 2006 Posts: 2284 Location: Adendorf, Germany
|
Posted: Fri Feb 05, 2016 7:25 am Post subject: |
|
|
vilehost wrote: | i have no idea why init.d would be showing bumblebee as stopped when it is started, and it is working, power saving, optirun will show my proper card and driver being used it's 100% functional as far as that goes... so no idea there | I assume this is because of the age of the stable ebuild.
vilehost wrote: | the thing with rmmod is i have to use it since this nividia update because modprobe -r will spit out errors about no modules found...
maybe thats why adding the modprobe.blacklist line to grub and blacklist isnt doing anything for me? maybe i should change the nvidia-rmmod.conf file to use rmmod instead of modprobe -r? because when you say dont use rmmod use modprobe, maybe my machine is backwards somehow now.. because as said above i have to use rmmod manually because manually modprobe -r will just give errors about no nvidia-modeset found | Hmmm... You have the same config as me, but you wrote that you disabled the "kms" USE Flag. I guess without that USE flag, nvidia-modeset isn't built. Then the line in /etc/modules.d/nvidia-rmmod.conf should read: Code: | remove nvidia modprobe -r --ignore-remove nvidia-uvm nvidia | That said, the whole config is only needed to have nvidia-uvm (and nvidia-modeset) being removed by using "modprobe -r nvidia" instead of having to rmmod all two or three modules in the correct order.
I do not know how important the nivida-modeset module is these days. But could you please try again with enabled "kms" USE flag and the original line in nvidia-rmmod.conf?
No. None of these are in the development branch, yet. My ebuild only adds a patch to enable bumblebee to prefer nvidia-uvm if it is there. (UVM must be loaded first. It'll then pull in "nvidia-modeset" as a dependency, which will be followed by "nvidia")
I have commented in issue 719 already that autoloading the nvidia drivers by the kernel is the actual problem.
For systems like gentoo, where the user is in control and not some package maintainer of pre-built system parts, we can control the autoloading. However, for users, who can not really shut off all autoloading of the nvidia drivers, there must be some solution to get bumblebee running reliably for everyone.
We gentooers can work around the module dependency stuff and autoloading. But anyway, I'd prefer the system just to be emerged and then to be capable of handling autoloaded drivers itself, of course. vilehost wrote: | also, i haven't used layman in a loong long time, prolly when i was testing sabyon in 2010.. the only way i remember to install a 3rd party ebuild is with doing the whole local overlay method, i have no idea how to pull it from an eix sync'd layman overlay, would i just mask the one in master the same way? | Layman is the easy method. These days it works with almost no need for user interference. See the wiki page for a howto. Its pretty easy, and the modern "emerge --sync" or "eix-sync" handle it well. _________________ Important German:- "Aha" - German reaction to pretend that you are really interested while giving no f*ck.
- "Tja" - German reaction to the apocalypse, nuclear war, an alien invasion or no bread in the house.
|
|
Back to top |
|
|
vilehost n00b
Joined: 07 Jan 2016 Posts: 26
|
Posted: Fri Feb 05, 2016 5:00 pm Post subject: |
|
|
Code: | [I] x11-drivers/nvidia-drivers [1]
Available versions: [M]96.43.23-r1(0/96)^msd [M]173.14.39-r1(0/173)^msd 304.131(0/304)^msd ~304.131-r1(0/304)^msd ~304.131-r3(0/304)^msd 340.93-r1(0/340)^msd 340.96(0/340)^msd ~340.96-r4(0/340)^msd 346.96-r1(0/346)^msd ~346.96-r5(0/346)^msd 352.63(0/352)^msd ~352.79(0/352)^msd ~352.79-r3(0/352)^msd 355.11-r2(0/355)^msd ~355.11-r3(0/355)^msd 358.16-r1(0/358)^msd ~358.16-r4(0/358)^msd ~361.18-r1(0/361)^msd ~361.18-r4(0/361)^msd {+X acpi custom-cflags +driver gtk gtk2 gtk3 +kms multilib pax_kernel static-libs (+)tools uvm KERNEL="FreeBSD linux"}
Installed versions: 358.16-r1(0/358)^msd(07:46:26 AM 02/03/2016)(X acpi gtk2 kms multilib tools -gtk3 -pax_kernel -uvm KERNEL="linux -FreeBSD")
Homepage: http://www.nvidia.com/
Description: NVIDIA Accelerated Graphics Driver
[1] "gentoo" /usr/portage
|
default conf and + kms (default flags^)still results in Code: | rmmod: ERROR: Module nvidia is in use by: nvidia_modeset
[ 131.086071] [ERROR]Unloading nvidia driver timed out. | then manual unload of mods and restart bumblebeed
i'll try with +uvm
ok your ebuild, + latest nvidia-drivers with +kms and +uvm along with the kernel blacklisting is a success no more error or manual unload. tyty
Code: |
[I] x11-misc/bumblebee
Available versions: 3.2.1[3] **9999[2] (**)9999-r2[1] {+bbswitch VIDEO_CARDS="nouveau nvidia"}
Installed versions: 9999-r2[1](08:02:42 AM 02/05/2016)(bbswitch VIDEO_CARDS="nvidia -nouveau")
Homepage: http://bumblebee-project.org https://github.com/Bumblebee-Project/Bumblebee
Description: Service providing elegant and stable means of managing Optimus graphics chipsets
[I] x11-drivers/nvidia-drivers [1]
Available versions: ********************
Installed versions: 358.16-r1(0/358)^msd(08:24:14 AM 02/05/2016)(X acpi gtk2 kms multilib tools uvm -gtk3 -pax_kernel KERNEL="linux -FreeBSD")
Homepage: http://www.nvidia.com/
Description: NVIDIA Accelerated Graphics Driver |
oh, ebuild didnt fix init.d of incorrectly showing bumblebee status as stopped though Code: | /etc/init.d/bumblebee status
* status: stopped |
but its still running perfect, thanks again |
|
Back to top |
|
|
Yamakuzure Advocate
Joined: 21 Jun 2006 Posts: 2284 Location: Adendorf, Germany
|
Posted: Mon Feb 08, 2016 8:21 am Post subject: |
|
|
You are welcome!
I hope the bumblebee devs will get a new relase out soon. And that we'll get fresh and shiny ebuilds. _________________ Important German:- "Aha" - German reaction to pretend that you are really interested while giving no f*ck.
- "Tja" - German reaction to the apocalypse, nuclear war, an alien invasion or no bread in the house.
|
|
Back to top |
|
|
Xywa Veteran
Joined: 23 Jul 2005 Posts: 1631 Location: /mnt/Gentoo/Europe
|
Posted: Wed Feb 17, 2016 6:27 am Post subject: |
|
|
Yamakuzure wrote: | You are welcome!
I hope the bumblebee devs will get a new relase out soon. And that we'll get fresh and shiny ebuilds. |
I hope so, nvidia driver stopped work for me from February 2016, and I waste last week to solve the problem... Time to go back to the future and again use bumblebee... |
|
Back to top |
|
|
truekaiser l33t
Joined: 05 Mar 2004 Posts: 801
|
Posted: Sat Mar 05, 2016 5:04 am Post subject: |
|
|
Xywa wrote: | Yamakuzure wrote: | You are welcome!
I hope the bumblebee devs will get a new relase out soon. And that we'll get fresh and shiny ebuilds. |
I hope so, nvidia driver stopped work for me from February 2016, and I waste last week to solve the problem... Time to go back to the future and again use bumblebee... |
primusrun seems borked for me on only a single game. pillars of eternity. optirun though allows it to work fine. |
|
Back to top |
|
|
kiksen Guru
Joined: 24 Jun 2002 Posts: 401 Location: Denmark
|
Posted: Wed May 11, 2016 7:04 am Post subject: |
|
|
Sorry for bringing the thread back to life, but I had to solve it by adding
Quote: | blacklist nvidia_modeset
blacklist nvidia_drm
|
to /etc/modprobe.d/blacklist.conf
Then my bumblebee setup is functional again. Hope it helps someone. |
|
Back to top |
|
|
vilehost n00b
Joined: 07 Jan 2016 Posts: 26
|
Posted: Sat May 14, 2016 8:26 pm Post subject: |
|
|
kiksen wrote: | Sorry for bringing the thread back to life, but I had to solve it by adding
Quote: | blacklist nvidia_modeset
blacklist nvidia_drm
|
to /etc/modprobe.d/blacklist.conf
Then my bumblebee setup is functional again. Hope it helps someone. |
did this just happen to you after upgrading kernel?
--cant build bbswitch with 4.4-4.4.6? |
|
Back to top |
|
|
sao98021 Tux's lil' helper
Joined: 03 Apr 2012 Posts: 145 Location: Michigan
|
Posted: Fri Jun 01, 2018 4:32 pm Post subject: |
|
|
god i made this thread 2 years ago, and your repo has once again saved my skin |
|
Back to top |
|
|
opafix n00b
Joined: 09 Sep 2018 Posts: 10
|
|
Back to top |
|
|
sao98021 Tux's lil' helper
Joined: 03 Apr 2012 Posts: 145 Location: Michigan
|
Posted: Sun Sep 16, 2018 5:43 pm Post subject: |
|
|
Very good stuff, I immensely appreciate the effort put into making that page I'm sure it will help people.
I only have one thing to add, I think if you optirun/primusrun steam, you might not need to go through each game adding optirun to the launch commands. I'm not certain though. iirc if you optirun steam, then just launch a game after it like normal, your nvidia-smi will show 2 things loaded on the card.
same goes for other things suchas optirun playonlinux |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|