G5: Nouveau & 2D Acceleration


DISCLAIMER: None of what you'll read below is of my own work, but mostly a summary on what I read about on the Debian PPC mailing list.

I have what I believe is somewhat exciting news for G5 owners in regards to using Nvidia cards and the open source nouveau driver, but more testing needs to be done!  What I'm about to explain and show should hopefully be able to allow you to at least achieve 2D acceleration.

However, before we become too excited, let us take a step back first and examine the situation with nouveau on G5 PowerMacs.  As of today (7/5/2015), I'm the only other known individual who has been able to make this fix work with the other individual being the one who filled us (the Debian PowerPC mailing list) in on how to get it working.  To be clear, I'm using Late 2005 PowerMac (Identifier 11,2) using a Quadro FX4500 Nvidia card.

As already known from my previous post on a fresh install of Jessie on a G5, I had to pass in an extra yaboot parameter (nouveau.noaccel=1) that would disable any acceleration with the Nvidia card using the nouveau driver. This would at least give us G5 owners with an Nvidia card a usable system, although all graphics rendering was happening on the CPU.  Not the most terrible thing in the world when using a dual-core G5, but definitely disappointing knowing how much power the graphics cards have to offer. 

Since the release of Jessie, there have been a handful of threads on the mailing list about issues other users were having when trying to use the nouveau driver.  Many people, myself included, recommended the yaboot parameter fix due to lack of expertise and knowledge of the nouveau driver, graphics programming, and troubleshooting.  Just this past week or so, another Debian user posted a thorough analysis on why the nouveau driver was having issues with the Debian 3.16.0-4 powerpc64 kernel and what could be done as a workaround to overcome the issues and at least achieve 2D acceleration. Notice that I said "workaround" and not "fix."

Basically, it came down to one or two different kernel configurations or both.

1) Right now, only a 4Kb pagesize configuration in the kernel will work with the 64-bit G5 kernel running the nouveau driver. The default pagesize of the included kernel-image (again 3.16.0-4-powerpc64 in Debian Jessie) is 64kb, which as mentioned by the poster improves performance of the driver, but again is not supported on G5 PowerMacs. To check the pagesize in use by your running kernel run the following command in a terminal:

getconf PAGESIZE

This will likely either return 4Kb or 65536Kb. 

2) The kernel configuration might also be set to have the nouveau driver use MSI interrupts.  As quoted by the poster regarding these interrupts:

The newer nouveau drivers in more recent kernels default to using MSI interrupts, however with the PPC G5, when using MSI interrupts, the powerpc FCODE rom on Nvidia cards does not correctly set up the MSI address (or vector).

To verify if you are using MSI interrupts or not, run the following command in a terminal:

cat /proc/interrupts

Look for the nouveau entry and confirm whether it is MSI or MPIC.

What the poster ended up doing was rebuilding a newer 3.18.16 kernel, disabling MSI interrupts as well as adjusting the pagesize in the kernel configuration to 4kb.  Not only that, but he has also posted a copy of this kernel image and headers for G5 owners to download and test on their G5 machines.

So this is a call to all other G5 owners running the latest Debian Jessie release and using an Nvidia graphics card.  Download and install the files linked above and post your results to the Debian PPC mailing list ASAP!  If need be, drop a comment with your results, and I will plug them into the aforementioned thread on the mailing list.  I would recommend downloading and installing this newer kernel image and headers on a brand new Jessie install if possible.

Remember to add in a new kernel configuration in your /etc/yaboot.conf file that links to the newly installed kernel and run sudo ybin -v to wrap it all up. From there, go ahead and reboot to the new kernel and test things out.

I can vouch that the above kernel does allow 2D acceleration now on my G5 PowerMac. Also, as I mentioned in the mailing list thread, I had to load the i2c-powermac module to stop the fans from sounding like a 747 ready for takeoff.  Now that I have 2D acceleration, I can now use xrandr and arandr to set my dual monitors up properly in an extended desktop setup that spans across both of them.  Now if we could only figure out how to achieve 3D hardware acceleration us G5 owners would be set for a little while longer.

Bug reports for these two problematic issues and configurations have been filed here and here.  From the sounds of it, you would not be able to make these two configuration changes work on G5 with the current Debian kernel 3.16.0-4 so do not pull out your hair trying.

I did some browsing around on the nouveau website and found that this G5 PPC pagesize issue is listed as a DRM to-do on this page.  My plan is to touch base with them about it again and see what, if anything, I can do to help. In the meantime, I've been reading up more and more on the nouveau driver and Linux graphics in general, so here is to hoping I'll be able to assist in some small way.  The developers of nouveau have some excellent documentation over at their site so I encourage you to check that out if you would like to also assist in any way.

Also, and lastly, it appears that 4.0+ kernels present all sorts of new issues with nouveau and G5s, but if nothing else, this small bit of information outlined above is hopefully a good sized step in the right direction!  We need to continue to do our duty of reporting any bugs we find regardless of whether anybody who currently is a developer wants to devote any time to them.  It helps just to have that information out there and available.

12 comments:

  1. This is great news. The more people testing and reporting issues the better chance to see more PowerPC support. I hope in the future we can mesa 3D support working on G4 and G5.

    ReplyDelete
  2. Not only is it amazing to have G5 content here now, but it's even better to have someone figuring out a lot of the BS for others to get their Nvidia card running on Debian.

    Hurdles like these send some running, so it's good that you guide them, while you're still short of hand holding. Perfectly balanced and healthy writing - as always.

    ReplyDelete
  3. Awesome post B-Rock. I'm glad to hear that somebody is devoting time to our old architecture. I don't have a G5, unfortunately, but I would try this out if I did.

    P.S. I wanted to point out that you have one spelling error in your post: "Linux graphics in general, so her is to hoping I'll be able to assist in some small way."
    her should be here :-)

    ReplyDelete
    Replies
    1. @ B-rock

      I fixed this typo for you.

      Delete
    2. Thanks for the kind words and thanks to Zen for fixing the typo. I usually re-read my posts out loud once or twice to catch those small things, but 1 or 2 always manages to slip through. :)

      Delete
  4. It's working, but saying lost fan control.

    ReplyDelete
    Replies
    1. Have you tried running sudo modprobe i2c-powermac to see if that addresses the issue? If it does, go ahead and add this module to your /etc/modules file so it automatically loads in the future.

      Delete
  5. Got it running with 2D acceleration, thanks ! The only issue is that the system halts instead of powering off but I think this can be fixed easily.

    ReplyDelete
  6. I'm having similar results. Still investigating, but should hopefully have something for you soon!

    ReplyDelete
  7. I got the kernel to boot, but glxinfo and glxgears both say its still running in Software rasterizer, yet I checked the booted kernel and it's the one from this page. I've got a Powermac G5 quad with a 7800GT (dont think its apple branded, maybe flashed ROM) running on Debian 8.2.0 ppc64 build. Any help would be great!

    ReplyDelete
    Replies
    1. 3D acceleration is still broken with the version of nouveau and the mesa graphics library you are using in Jessie. Right now, you will only have working 2D acceleration.

      Delete
  8. Hi. I recompiled my kernel with a 4k page size and and with PCI_MSI disabled, but I still have to boot with `nomodeset video=ofonly`, otherwise I get a blank screen.

    ReplyDelete