Skip to content
This repository has been archived by the owner on Oct 17, 2021. It is now read-only.

Nouveau support #18

Closed
Samsagax opened this issue Aug 15, 2011 · 56 comments
Closed

Nouveau support #18

Samsagax opened this issue Aug 15, 2011 · 56 comments

Comments

@Samsagax
Copy link
Member

As some might notice, our current Bumblebee implementation isn't completely free as we depend on the proprietary binaries from nVidia.

To develop a complete free solution we are in need to support Bumblebee under nouveau drivers and their Gallium3D features. This, of course, will have the limitation of such features and support from nouveau in each particular card.

Advantages of supporting nouveau:

  • Our beloved bumblebee will be free/Libre (yeah... sounds little lame)
  • Nouveau support will prevent us (developers and users) from those hard times tweaking things to use the nVidia libraries as the nouveau DRI system uses the same libGL as intel driver.
  • We don't have the limitation of telling the X server which monitor is connected as nouveau doesn't fail if it is unable to recognize any monitor in the server.

This feature will be implemented in the branch "common-nouveau"

@Ximi1970
Copy link

It is a shame that you removed the nouveau support from the openSuSE version...
Luckely it is still available at my git tree (or MrMEEE) or in the openSuSE repositories.

@Lekensteyn
Copy link
Member

@Ximi1970 it's available in the history of git. We're just trying to get an unified Bumblebee to give everyone the same experience of using it.

@ArchangeGabriel
Copy link
Member

It is even available in the to_clean branch, which purpose is to save all the old work.

I've only removed it to have the same basis for every distro. nouveau could be available as soon as you would have updated the install script for openSuSE.

@Samsagax
Copy link
Member Author

Well after some research I found that nouveau support will be easy to implement but difficult to maintain with the actual installer.

First, how it works:

a simple configuration file xorg.conf.nouveau will do for the X server:

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

Section "Device"
    Identifier     "Device1"
    Driver         "nouveau"
EndSection

This file will work with 3d enabled provided the following conditions are met:

  • The 'nouveau' kernel module is inserted (obviously) and the card is supported by it and supports nouveau's direct rendering interface (DRI)
  • The proper xserver-driver is available (package under ArchLinux: xf86-video-nouveau)
  • The packages for Gallium3D are available (Under Arch those are: 'nouveau-dri', 'mesa' and 'libgl')

Things that are not needed by nouveau but nvidia need them (so here is the problem on how we split them):

  • No LD_LIBRARY_PATH, nor MODULEPATH need to be set (neither in bumblebee X server or optirun).
  • No configuration of hardware of any kind (BusID, ConnectedMonitor)

I've tested that myself and worked fine with some advantages (application compatibility, non broken libgl, proper 32/64 bit selection, it's free) and disadvantages (performance, some cards are not supported).

There are changes to be made in both the installer and daemon. They are not hard to make in the daemon as is a matter of variable setting; but the main concern is the installer.

@Lekensteyn
Copy link
Member

The installer needs another stage for the driver.
The next stages are currently involved:

  • setvars: defines which driver should be used (possibly by using --driver=DRIVER)
  • distro/setvars: XORG_MODULEPATH, NVIDIA_LIB{32,64}DIR which is driver-dep
  • checkdependencies: the driver needs to be installed. Should we create a new stage for each driver or include it in the installer?
  • buildfiles: configures files to use nvidia
  • copyfiles: copies the xorg.conf file
  • configure: configures the xorg.conf file

Looks like there must be a stage between welcome and checkdependencies. Proposal:

  • new stage: setdrivervars
    • defines packages which should be depended on/ conflict with in checkdependencies
    • defines XORG_MODULEPATH, NVIDIA_LIB{32,64}DIR. This should probably be XORG_MODULEPATH="/path/to/drivers/${XORG_MODULEPATH:+,$XORG_MODULEPATH}" because XORG_MODULEPATH is set in distro/setvars as well
  • the PCI Bus ID detection in configure could be replaced by # REPLACE WITH PCI BUS ID CHECK which could be filled by buildpackages
  • todo: blacklisting. What are our alternatives to blacklisting?

Now, to be flexible in packaging, we should probably package like this:

  • bumblebee - core package containing the daemon and optirun
    • bumblebee-$DRIVER - xorg.conf, driver options in $LIBDIR/drivers, sets default DRIVER value in $CONFDIR (really? or do we need to set it only if DRIVER is unset?)

@Lekensteyn Lekensteyn reopened this Aug 18, 2011
@ghost ghost assigned Samsagax Aug 19, 2011
@Samsagax
Copy link
Member Author

Ok. I'm again on the run for this one:
Current installer is used adding the separate options according to DRIVER. The whole idea is to keep the present installer usable for both drivers.

setvars: defines which driver should be used (possibly by using --driver=DRIVER)

Added the two options for AVAILABLE_DRIVERS array. The only thing to discuss is which would be the default one.

distro/setvars: XORG_MODULEPATH, which is driver-dep
checkdependencies: the driver needs to be installed. Should we create a new stage for each driver or include it in the installer?

Solved by adding a 'case' statement (if no driver set will fail). NVIDIA_LIB{32,64}DIR are not used anymore (at least in Ubuntu/Arch). For the dependencies i was trying to integrate the checkdependencies to the distro-independent installer by setting variables in the DISTRO/setvars stage. As for balcklisting nouveau: most packages do taht automatically (in Ubuntu is done by installing the nvidia-current package) so this might be left to that packages instead of doing it myself

Regarding packaging, it would be great to use a "core" for driver-independent installer and separate packages for each one. The installer should be then laid out in that way.

@Lekensteyn
Copy link
Member

About blacklisting, good point, Ubuntu indeed blacklists nouveau when installing nvidia-current so it should be removed in a future version. I guess that no cleanup action is required for nouveau-blacklist.conf since that file will only be created if nouveau hasn't blacklisted yet.

I like the package idea of separating the core from driver-deps.

As for the default driver, what about using nvidia-current as default since it gives better performance over the nouveau one? We should probably avoid detecting an available one (nvidia vs nouveau) as it makes the installers behavior not consequent.

@ArchangeGabriel
Copy link
Member

I didn't have had the time to read this thread, but I would just add something important for me : it would be really nice to be able to use both. For example, running optirun uses the default setting, and you can run optirun --driver (driver being replaced by driver name) to use bumblebee with this driver.

@Samsagax
Copy link
Member Author

There is still a little catch: My test-runs on the daemon result in fullscreen corruption and no manner to retrieve usefull debug data. But if I start the X server at minimum required and vglrun at minimum it starts with no problems. Maybe the problem is in the client side (optirun) but can't know for sure.

I'll add an option to the daemon to start the X on-demand so we can test this. The installer is almost ready to deploy either driver right now and is a good step to eliminate the need for a distro-check in checkdependencies.

@Samsagax
Copy link
Member Author

News: The model works on nouveau (YAY!). Still the blacklisting is a problem to be solved and the load/unload of the appropriate graphics card should be done based on the DRIVER configuration in /etc/bumblebee/bumblebee.conf file.

Need some discussion on how to integrate this to the current nvidia-only model and be able to switch between them.

For packaging: the only substantial difference/problem I see in packaging is the dependencies for each driver are totally different. The 'core' package can be the actual one but configuration and dependencies can be managed by this two metapackages 'bb-nouveau' and 'bb-nvidia'.

I'll try to integrate both in a way that the daemon can switch between them provided the good dependencies are met.

@ArchangeGabriel
Copy link
Member

nouveau and nvidia are only conflicting if we try to run them at the same time, right ?

Then what I propose is to install both, set one as default (and give the user the ability to choose which one is default), and give the ability ro run the other via optirun --nouveau or optirun --nvidia (or even optirun --driver nouveau, optirun --driver=nouveau, optirun --driver nvidia, optirun --driver=nvidia).

In order to do that, before modprobing one, we should verify if the other one is running, and in that case mordpobe -r it (only if there are no X server running with it, else, tell the user that there is an app running with the other driver).

@Samsagax
Copy link
Member Author

Samsagax commented Sep 1, 2011

The branch 'common-nouveau' is merged into develop. Now comes the testing part and bugfixing the installer mostly

@ArchangeGabriel
Copy link
Member

In my opinion, it shouldn't have been merged so fast, because the installer still lacks support, and we didn't make testing yet. develop isn't here for such testing but in order to merge function back when there are READY.

Imagine that nouveau support can't be ready for sunday, then releasing ACPI will be blocked because nouveau has been merged into develop. I've particularly insisted on that point.

By the way, we discussed about packaging, and here is what went out:
-bumblebee will be packaged by default with nouveau support as default
-bumblebee-nvidia will provide nvidia support for Bumblebee (this package depends on nvidia one) and make nvidia the default

@Lekensteyn
Copy link
Member

Todo: allow the installer to install multiple drivers, I'll do that.

@ArchangeGabriel
Copy link
Member

I will unmerge nouveau in order to make a dev snapshot of acpi-framework for our dev PPA.

Should I merge it again after or do we decide to finish work to support both drivers before ?

@ArchangeGabriel
Copy link
Member

Discussed in IRC. I will not unmerge anything as changes in the installer doesn't impact our building scripts.

About installer, here is my opinion on what we should do. The global behavior is to install nouveau anyway and to install nvidia in addition if the user want it. Why that ? Because I think that someone that want to get ride of nouveau is someone that should be able to modify bumblebee to suit his need, first because removing things like nouveau need a good knowledge of what you're doing, then because that's probably someone that want a really minimalist system, and that should then use a custom recompiled kernel, so use a custom bumblebee is not a great obstacle...

So, for git installer, the idea is the following:

  • if you run just ./install, that does install bumblebee with nouveau support, so makes nouveau the default
  • if you run it with --nvidia, that does also install nvidia support, and nvidia is then made the default

For packages, this is translated like that:

  • bumblebee would be a package containing the core architecture of bumblebee and support for nouveau, and will use nouveau as default. This package depends on virtualgl and nouveau packages.
  • bumblebee-nvidia will add support for nvidia in bumblebee, and also will make nvidia the default. This package depends on nvidia one and also bumblebee one. Like this, it will be installed after bumblebee, and nvidia will be easily made the default. Note that according to what we will do for conf files, we should put that default thing in custom conf file, the default one should ever contain nouveau as default.

The concern with this plan is: is nouveau everywhere in the linux world (or at least the part that may use bumblebee, won't check that support for Hannah Montanah Linux or Baby Linux ...)

Fedora: OK, default since Fedora 11
Ubuntu: OK, default since 10.04, lowest version we support
Mandriva: OK since somewhere in 2009 (don't know if it is the default now, they are potentially still using nv)
openSUSE: OK (didn't look since when)
Debian: OK since Squeeze
Gentoo: Did not find the information in less than one minute, abandonned research
RHEL: OK, default since at least RHEL 6.0

Globally, nouveau is present everywhere there is at least a 2.6.34 kernel, which we could hope when we're talking about Optimus technology... Do you want me to do more research on other distros (Slackware, ...) ?

About both driver support, there is one concern for me, about how we will handle that in the backend part.

For what I see now, we need to restart the daemon in order to switch driver. That is better to be sure that no X server is running on the other driver and for some other things, but there is one problem with that.

Could we add something like an argument to start the daemon on a given driver ? Actually, it will start using the driver defined in the conf file. So if you want to restart it for an other driver, you need to stop it, change the conf file, start it again (or edit the file and restart). Can't there be an easier way todo that ?

Also take a loot at #77.

Having all this ready for 02/09 is at risk, so here is what we should do:

  • first, just release that backend support for nouveau if nothing is breaking (that why we need to freeze code tomorrow, in order to do some tests before releasing on sunday)
  • next, target this new installer for release 3.0, which could be the next one.

@Samsagax
Copy link
Member Author

Samsagax commented Sep 2, 2011

won't check that support for Hannah Montanah Linux or Baby Linux ...

You won't check for Justin Beiber distro either? :'( < BIG FAT LOL!

@Lekensteyn
Copy link
Member

No need for a command line option (at least not to the initscript!). If you need to change the driver quickly, use sed like this:

sudo /etc/init.d/bumblebee stop
sudo sed 's,^DRIVER=.*,DRIVER=nouveau,' -i /etc/bumblebee/bumblebee.conf
sudo /etc/init.d/bumblebee start

So, we'll use nouveau by default (for now) and provide nvidia in an additional package. Still, we haven't made a decision on the driver choice during installation yet. Should we default to nouveau, and let the user change the conffile? Not really userfriendly imo, and I'd like to use alternative links for that. An alternative solution (given that we've just two drivers for now) would be making a post{inst,rm} script that sets the driver to nvidia or reverts it back to nouveau on removal of bumblebee-nvidia. What do you think of that?

@ArchangeGabriel
Copy link
Member

In fact we've already made this choice. We would ever have just two drivers, this has been discussed a lot.

So what we decided about that is:

  • if you just install bumblebee, without nvidia, obviously default to nouveau
  • if you install nvidia support too, default to nvidia. Effectively, we forgot to add something in the removal of nvidia part to default nouveau in this case.

About you code block just before, I will make from that a function. Will see how.

@Lekensteyn
Copy link
Member

I missed a trailing comma in the code which I've now edited in.

For the installer, I've decided to extend --driver with --driver=driverA,driverB,driverC(default) (--driver=nvidia,nouveau)

Please join #bumblebee-dev for a faster discussion

@Lekensteyn
Copy link
Member

@ArchangeGabriel: should we really make nouveau the default driver for Ubuntu?
There does not seem to be official nouveau releases since the code is always in development and not finished yet.
The PPA https://launchpad.net/~oibaf/+archive/graphics-drivers/+packages broke desktop effects on my intel display, so I didn't bother trying nouveau from it either. (the updated mesa package was causing issues with errors like "Mesa warning: failed to remap index [number]" in /var/log/kdm.log).

@Samsagax
Copy link
Member Author

Samsagax commented Sep 3, 2011

Are really Canonical that narrow?

+1 on banning Ubuntu from existence :P.

You just don't need any packages from ppa. With the mesa + libgl + nouveau-dri should do the trick.

@ArchangeGabriel
Copy link
Member

@Lekensteyn: For this release, I'm packaging it only for nvidia. Will see later for nouveau.

@Lekensteyn
Copy link
Member

@ArchangeGabriel: that's fine, I'll include the updated bugreport tool too and update the ppa files to use nvidia.

@starks
Copy link
Member

starks commented Sep 7, 2011

On the Ubuntu side of things, shouldn't libgl1-mesa-dri-experimental be a dependency?

@Lekensteyn
Copy link
Member

From it's package description:

This package does not include the OpenGL library itself, only the DRI
modules for accelerating direct and indirect rendering. The drivers
in this package may provide more features than the drivers in the
libgl1-mesa-dri at the cost of less stability.

I'm really sure about the differences, but as the nouveau driver provided with Ubuntu are quite old. Natty does not support NVC0, not sure about the level of support in Oneiric. For that reason, default use of nouveau has been postponed. Back to your question, I don't know the implications of the -experimental dependency, it should be up to the user to install it (perhaps a Suggests or Recommends for the package). Currently, virtualgl depends on libgl1-mesa-glx | libgl1 which makes it even more confusing. If we're going to split the package into bumblebee-nouveau and bumblebee-nvidia it may be easier to set such dependencies.

@starks
Copy link
Member

starks commented Sep 7, 2011

As I understand it, -experimental provides Nouveau 3D and that Nouveaubee needs it.

It may such that a person may want to optirun an app in 2D only, but I don't think that should be the default behavior.

@Lekensteyn
Copy link
Member

I'm running GT425M, and 5xx is also very common now.

"It is recommended to use the Linux 3.1 kernel or newer (or a backported driver from this kernel)" (from http://nouveau.freedesktop.org/wiki/CodeNames#NVC0)
Not sure if that also means that the driver may work for 3.0.

@starks
Copy link
Member

starks commented Sep 7, 2011

On 09/07/2011 01:35 PM, Peter wrote:

I'm running GT425M, and 5xx is also very common now.

"It is recommended to use the Linux 3.1 kernel or newer (or a backported driver from this kernel)" (from http://nouveau.freedesktop.org/wiki/CodeNames#NVC0)
Not sure if that also means that the driver may work for 3.0.

I haven't been able to use nouveau even with edgers and the 3.1 dailies.

@Samsagax
Copy link
Member Author

Samsagax commented Sep 8, 2011

The problem is that even xorg-edgers in Ubuntu is using an outdated version. Nouveau developers suggest and even encourage to use git code for newer cards (git as today) and report back into the irc channel to help developing.

I can talk from my distro only and my hardware: I have a 310M and is fully supported under nouveau (except a little annoyance with a i2w error) and works great on Gallium. Arch releases a new package every month of xorg-nouveau driver git. So I can test it myself: All NV50 or less is well supported under nouveau. The NVC0 is a steady WIP

See http://nouveau.freedesktop.org/wiki/FeatureMatrix for more info.

@starks starks closed this as completed Sep 8, 2011
@starks starks reopened this Sep 8, 2011
@starks
Copy link
Member

starks commented Sep 8, 2011

NV50 Optimus and NVC0 Optimus are separate case because the former more often than the latter will have non-offloading options available such as vga/asus/byo-switcheroo due to the presence of a mux. As such, I think NVC0 should be the primary target of Bumblebee since it will be increasingly the only choice for NVC0 laptops.

At the same time, I also think it's a bit premature to promote a free/libre default or alternative to the nvidia blob for bumblebee when there are still huge problems with nouveau support for NVC0. The most profound of these problems is that you either need to extract the firmware manually using the nvidia blob or use git trees (nouveau and maybe a kernel roll for better drm) to generate the firmware. Even if Nouveau loads, other support may be lacking.

This is a fundamental problem that we need to upfront with our users should we go ahead with favoring nouveau or packaging it separately.

@ArchangeGabriel
Copy link
Member

Effectively, for now, we should let nvidia as default, and just tell users that nouveau backend is ready.

@starks
Copy link
Member

starks commented Sep 10, 2011

If you guys want comparative, real-world benchmark testing of backends, I'd recommend OpenArena or the upcoming OilRush demo.

I'd even go so far to recommend usage of the Phoronix Test Suite to organize and coordinate further benchmarking. It could shed light on where the Nouveau drivers are lacking and provide much needed data for the devs that have otherwise been unable to use Nouveau on muxless laptops.

@raveit65
Copy link

Pls, let the nvidia driver as the default driver for bumblebee, because

  • i hat the grey veil if using the nouveau driver
  • nvidia gives a perfect support for linux, releasing every two mounth
  • most problems to install a driver for nvidia cards in fedora arrived since the nouveau driver is default in fedora.
  • most users used the nvidia driver because of it's better quality
  • i pay for my nvidia card why should i used a inferior driver software
  • nouveau is a reengineering software, so with new nvidia cards you get problems.

a user opinion

@Samsagax
Copy link
Member Author

We can discuss this as much as you want @NiceandGently. But we are trying to push as much as we can to make nouveau the default whenever possible because:

  • Nouveau driver is GPL, Nvidia is proprietary.
  • Nvidia does not give good support... that's just on paper...
  • The per-distro problems are packager's fault, not the software ;)
  • The better quality is arguable, the Gallium3D software is better in AlienArena, Nexuiz and more. Nvidia doen't use the fact that 64bit systems are better in memory allocation and process. And Gallium is getting better every day while Nvidia binary is not. I can tell Gallium is in it's floor, while Nvidia is in it's roof.
  • Nvidia refuses to give any support for Optimus laptops, even refuses to give help at all. The newer Nvidia cards are not supported even with the proprietary driver/binary.

Another user opinion ;)

@Lekensteyn
Copy link
Member

For now, we keep nvidia as default, but may consider using nouveau by default providing the replacement does not cause incompatibilities.

I guess we're going to release bumblebee-nouveau and bumblebee-nvidia packages in addition to the bumblebee package which would contain the static / shared stuff.

@ArchangeGabriel
Copy link
Member

For your information, I've figured out that nouveau needs the PCI Bus ID of the nvidia card in its xorg.conf, else it doesn't detect it.

@ArchangeGabriel
Copy link
Member

I'm unable to use nouveau, it results in :
Polygons in scene: 62464 /usr/bin/optirun: line 239: 3646 Segmentation fault vglrun -c "$VGL_COMPRESS" -d "$VGL_DISPLAY" -ld "$VGL_DRIVER" -- "$@"

@Lekensteyn
Copy link
Member

Try running it with gdb and get a backtrace:

optirun gdb glxgears
> run
[error here]
> bt
[backtrace here]

Also, I'm in #bumblebee-dev

@ArchangeGabriel
Copy link
Member

#0 0x00000000 in ?? () #1 0xb7fd06d0 in ?? () from /usr/lib/i386-linux-gnu/dri/swrast_dri.so #2 0xb7ebd9de in ?? () from /usr/lib/i386-linux-gnu/mesa/libGL.so.1 #3 0xb7e9b6b8 in ?? () from /usr/lib/i386-linux-gnu/mesa/libGL.so.1 #4 0xb7e98193 in ?? () from /usr/lib/i386-linux-gnu/mesa/libGL.so.1 #5 0xb7e982c5 in glXGetConfig () from /usr/lib/i386-linux-gnu/mesa/libGL.so.1 #6 0xb7f17d16 in ?? () from /usr/lib/i386-linux-gnu/librrfaker.so #7 0xb7f1939b in ?? () from /usr/lib/i386-linux-gnu/librrfaker.so #8 0xb7efa347 in glXChooseVisual () from /usr/lib/i386-linux-gnu/librrfaker.so #9 0x0804a351 in ?? () #10 0xb7bc2113 in __libc_start_main () from /lib/i386-linux-gnu/libc.so.6 #11 0x08049101 in ?? () Backtrace stopped: Not enough registers or memory available to unwind further

@ArchangeGabriel
Copy link
Member

And for glxspheres :
#0 0x00000000 in ?? () #1 0xb7fd06d0 in ?? () from /usr/lib/i386-linux-gnu/dri/swrast_dri.so #2 0xb7ebd9de in ?? () from /usr/lib/i386-linux-gnu/mesa/libGL.so.1 #3 0xb7e9b6b8 in ?? () from /usr/lib/i386-linux-gnu/mesa/libGL.so.1 #4 0xb7e98193 in ?? () from /usr/lib/i386-linux-gnu/mesa/libGL.so.1 #5 0xb7e982c5 in glXGetConfig () from /usr/lib/i386-linux-gnu/mesa/libGL.so.1 #6 0xb7f17d16 in ?? () from /usr/lib/i386-linux-gnu/librrfaker.so #7 0xb7f1939b in ?? () from /usr/lib/i386-linux-gnu/librrfaker.so #8 0xb7efa347 in glXChooseVisual () from /usr/lib/i386-linux-gnu/librrfaker.so #9 0x0804a475 in main ()

@ArchangeGabriel
Copy link
Member

Also, some users are facing issues since we don't blacklist nouveau anymore that are solved by blacklisting nouveau again. I will try to find their messages and post them here.

@ArchangeGabriel
Copy link
Member

After installing debug symbols :

glxgears
#0 0x00000000 in ?? () #1 0xb7fd06d0 in driCreateNewScreen (scrn=0, extensions=0xb7ed52bc, driver_configs=0xbfffed2c, data=0x807e2a0) at ../common/drisw_util.c:69 #2 0xb7ebd9de in driswCreateScreen (screen=0, priv=0x80ad370) at drisw_glx.c:560 #3 0xb7e9b6b8 in AllocAndFetchScreenConfigs (priv=0x80ad370, dpy=0x805d5d0) at glxext.c:784 #4 __glXInitialize (dpy=0x805d5d0) at glxext.c:882 #5 __glXInitialize (dpy=0x805d5d0) at glxext.c:803 #6 0xb7e98193 in GetGLXPrivScreenConfig (dpy=0x805d5d0, scrn=0, ppriv=0xbfffedf8, ppsc=0xbfffedfc) at glxcmds.c:176 #7 0xb7e982c5 in glXGetConfig (dpy=0x805d5d0, vis=0x8077da8, attribute=5, value_return=0x807840c) at glxcmds.c:862 #8 0xb7f17d16 in ?? () from /usr/lib/i386-linux-gnu/librrfaker.so #9 0xb7f1939b in ?? () from /usr/lib/i386-linux-gnu/librrfaker.so #10 0xb7efa347 in glXChooseVisual () from /usr/lib/i386-linux-gnu/librrfaker.so #11 0x0804a351 in ?? () #12 0xb7bc2113 in __libc_start_main () from /lib/i386-linux-gnu/libc.so.6 #13 0x08049101 in ?? () Backtrace stopped: Not enough registers or memory available to unwind further

glxspheres:
#0 0x00000000 in ?? () #1 0xb7fd06d0 in driCreateNewScreen (scrn=0, extensions=0xb7ed52bc, driver_configs=0xbfffedcc, data=0x80ca520) at ../common/drisw_util.c:69 #2 0xb7ebd9de in driswCreateScreen (screen=0, priv=0x807ac80) at drisw_glx.c:560 #3 0xb7e9b6b8 in AllocAndFetchScreenConfigs (priv=0x807ac80, dpy=0x805f5d0) at glxext.c:784 #4 __glXInitialize (dpy=0x805f5d0) at glxext.c:882 #5 __glXInitialize (dpy=0x805f5d0) at glxext.c:803 #6 0xb7e98193 in GetGLXPrivScreenConfig (dpy=0x805f5d0, scrn=0, ppriv=0xbfffee98, ppsc=0xbfffee9c) at glxcmds.c:176 #7 0xb7e982c5 in glXGetConfig (dpy=0x805f5d0, vis=0x8079da8, attribute=5, value_return=0x807a40c) at glxcmds.c:862 #8 0xb7f17d16 in ?? () from /usr/lib/i386-linux-gnu/librrfaker.so #9 0xb7f1939b in ?? () from /usr/lib/i386-linux-gnu/librrfaker.so #10 0xb7efa347 in glXChooseVisual () from /usr/lib/i386-linux-gnu/librrfaker.so #11 0x0804a475 in main ()

@Samsagax
Copy link
Member Author

Xorg server nouveau driver testcase.

I'm following the standar Arch convention on commands, when the prompt is marked as # means the command should be issues as root (via su, sudo or logged in as root user). When the promp is marked with $ then the command is issued as a regular user.

First check that Bumblebee is completely stopped and you ahve the right packages. Under ArchLinux these are the names of the needed packages to have full 3D acceleration through Gallium3D:

  • xf86-video-nouveau
  • nouveau-dri
  • mesa

You can look at the contents of each package here: http://www.archlinux.org/packages/

Start the X server with nouveau

Check nouveau is loaded and it recognizes your card by checking dmesg. Otherwhise load it:

# modprobe -v nouveau
insmod /lib/modules/3.0-ice/kernel/drivers/platform/x86/mxm-wmi.ko.gz 
insmod /lib/modules/3.0-ice/kernel/drivers/gpu/drm/ttm/ttm.ko.gz 
insmod /lib/modules/3.0-ice/kernel/drivers/gpu/drm/nouveau/nouveau.ko.gz

Start X with a simple configuration file using nouveau. I'm using the stock xorg.conf.nouveau shipped with Bumblebee.

# /usr/bin/X :8 -config /etc/bumblebee/xorg.conf.nouveau -sharevts -nolisten tcp -noreset

Check for it to start successfully.

Start a OpenGL 3D application

Now make sure you ahve VirtualGL isntalled and then try to run glxgears

$ vglrun -d :8 glxgears
1791 frames in 5.0 seconds = 358.181 FPS

That will tell you that this works.

You may try another options.

Measuring performance (some unintended but nice findings)

I found that some ways to start the VGL client adds some performance that is comparable to that from xpra (at least is better than the current Bumblebee performance).

Try running glxspheres to benchmark the card performance under vglrun:

$ vglrun -d :8 glxspheres
Polygons in scene: 62464
Visual ID of window: 0x21
Context is Direct
OpenGL Renderer: Gallium 0.4 on NVA8
44.592809 frames/sec - 39.535985 Mpixels/sec

Very crappy huh? Well, now start vglclient and try using an uncompressed transport method:

$ vglclient &
$ vglrun -d :8 -c rgb glxspheres
Polygons in scene: 62464
Visual ID of window: 0x21
Context is Direct
OpenGL Renderer: Gallium 0.4 on NVA8
101.045917 frames/sec - 89.587310 Mpixels/sec

More than 2X performance. This will improve some things If we add this to the mainline

@Lekensteyn
Copy link
Member

Isn't the first proxy (which we currently use)? The second can be set in bumblebee.conf using VGL_COMPRESS=rgb. It can have some graphical differences though.

@Samsagax
Copy link
Member Author

@Lekensteyn: indeed it is, but proxy is an uncompressed method too, funny thing is that vglconnect affects performance.

@Lekensteyn
Copy link
Member

Isn't that called "VGL transport", and required for rgb (and jpeg iirc)

@Samsagax
Copy link
Member Author

Samsagax commented Nov 4, 2011

Can we close this issue and remove the common-nouveau branch? This is done now and merged completely into master/develop since release 2.4. And in fact the only problem we find with this is the actual Nouveau support on some cards. On cards fully supported by Nouveau, this step is trivial. The only thing we can discuss is how to distribute differentiated packages for nvidia and nouveau.

@ArchangeGabriel
Copy link
Member

No, in fact there are some problems with nouveau others than lack of support for some hardware.

First, since we're not blackilisting nouveau anymore, some users can't use nvidia. So we need to work a little more on this.

Next, we still didn't decided as you said how to package different drivers.

Finally, there is still some things to enhance in my opinion about the driver management in the daemon.

@Lekensteyn
Copy link
Member

About the blacklisting thing, isn't that resolved now we unload the loaded driver (often nouveau)?
Proposal for packaging:

bumblebee, depends on bumblebee-driver
bumblebee-nouveau, provides bumblebee-driver
bumblebee-nvidia, provides bumblebee-driver

Perhaps it does not have to depend on bumblebee-driver at all since some users only need the power saving. @ArchangeGabriel have a look at the WIP bbswitch at https://github.com/Lekensteyn/acpi-stuff/tree/master/bbswitch for power saving.

@Samsagax
Copy link
Member Author

Samsagax commented Nov 4, 2011

First, since we're not blackilisting nouveau anymore, some users can't use nvidia. So we need to work a little more on this.

Well that's not true, I have nouveau inserted at bootup and if I switch the configuration to use Nvidia then the daemon unloads nouveau and loads nvidia (I don't like that, but in fact it does), as @Lekensteyn stated.

And that can be solved by the bumblebee-driver packaging solution (When bumblebee-nvidia package is installed it can "eventually" balcklist nouveau). Still is a matter of system/user/machine CONFIGURATION. That's a thing that should be left to distribution packagers. All post installation steps needed are in fact left to packagers. But maybe I'm being too user-centric about this. I meant no offenses but we should try to put some more credit on users (you'll be surprised) on managing their systems. And probably improve the documentation.

The new installation method is purely intended for distribution packagers and somewhat "advanced" users (those who can actually open a terminal and run make knowing what they are doing). So the post installation is up to the user/packager. So split-up the packages into 'drivers' is a way to delegate the post installation steps into the packagers (by the end-user).

Btw: @Lekensteyn, great work on the bbswitch, I know is utterly green right now, but it still doesn't break anything :P. I couldn't make it work. Because the calls are hardcoded and I need my own

@ArchangeGabriel
Copy link
Member

Will look at it next WE Lekensteyn, doesn't have the time right now.

About blacklisting, some people can't load nvidia even with our method (unload nouvea -> load nvidia), loading nvidia fails with such error messages :
Oct 19 17:52:44 mario-laptop-dell kernel: [ 74.932550] vmap allocation for size 16781312 failed: use vmalloc=<size> to increase size. Oct 19 17:52:44 mario-laptop-dell kernel: [ 74.937304] NVRM: RmInitAdapter failed! (0x26:0xffffffff:1077) Oct 19 17:52:44 mario-laptop-dell kernel: [ 74.937318] NVRM: rm_init_adapter(0) failed

P.S.: Some others users are having different problems that are also solved by blacklisting nouveau. That's currently one of the first thing I try when facing a unknown problem.

And here vmalloc just does nothing, but blacklisting nouveau solves the problem.

So, that's truly a problem.

@Samsagax
Copy link
Member Author

Samsagax commented Nov 6, 2011

A post-installation step regarding this issue would do the trick then. Still I wouldn't blacklist nouveau unless the user will use nvidia-only configuration. That indeed would be solved by packaging. And still I see this as a non-supported issue by nouveau card issue because is nouveau driver when inserted that messes up with the memory of the card, by blacklisting it you don't insert nouveau in the first place, then the memory is not touched.

Regarding this last statement, could you follow this testcase and report back?

  1. Start the machine with nouveau
  2. rmmod nouveau
  3. insert nvidia < here the issue will appear

the part I'm interested is in the dmesg output regarding nouveau initializing the card. Most likely a message will appear telling you the memory of the card could not be recognized or something. In such case, report back to #nouveau channel offering/asking help to debug the issue. But bear in mind that most Ubuntu and Ubuntu-based distributions has both their drivers and their kernel modules utterly outdated, so no wonder why new cards aren't supported.

@ArchangeGabriel
Copy link
Member

Will try all this as soon as possible, hope today or tomorrow/sunday.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants