G5: Nouveau & 3D Acceleration


UPDATE 1: Updated glxgears output after running it not synced to vsync

As many of our readers may already be aware, both 2D and now 3D acceleration are working with the nouveau driver on PPC!  However, with a couple of hopefully temporary caveats that should hopefully disappear over time.  The caveats include the following:

1. You can only try/test this out by upgrading your system to Stretch (the next stable release of Debian still in development/testing) or Sid ( forever unstable). Eventually Stretch will become the next stable release (sometime early 2017) and by then let us hope that whatever version of mesa and its related libraries  included in the release still has working 3D and 2D acceleration with nouveau.

You could also try to compile the latest versions yourself using the instructions here, but keep in mind this route is difficult even for more experienced Linux users.

2. As exciting as this news is, the current performance is still lacking, but with regards to G5 machines, this should also be improved with the move to 64 KB page sizes in the future among many other things relevant to just nouveau and PPC development in general. Sadly, still no update on the 64 KB page size mapping bug yet either, but I am trying to keep in touch with the developers.

As first reported, by again, Peter Saisanas, in a comment from my last post, it appears the fix was included in Mesa's 11.0.3 release back in November.  He has also posted about his testing on the Debian PPC mailing list here.  One of the included fixes that may have resolved the remaining issues with 3D acceleration with nouveau on PPC in that release by Mesa developer Ilia Mirkin was "nv30: always go through translate module on big-endian."  That is the current theory anyways as looking through the rest of the fixes over that same release as well other recent releases, this one appears to be the most relevant.

I figured I would conduct my own testing as well by first upgrading to Stretch from Jessie (8.3) to Stretch.  I skipped backing up my current install as nothing on it is all that crucial. Most of my crucial files and configurations live on my G4 QS at the current time.  Since Stretch or Sid can be (is) unstable at times, you may not want to use it on a production system.  Choose your set up wisely.  I plan to eventually either partition my current SSD to host both Jessie and Stretch on separate dedicated partitions or use a drive in each available drive bay to host each release of Debian (one for testing and one for stable) so I can always fall back to one or the other in case something breaks.

Speaking of instability, there are issues when doing upgrades to or fresh installs of Stretch as the current kernel included with the release is broken on PPC. So you if you want to test this out, I would highly recommend first instaling Jessie and then downloading and installing one of the pre-built kernels available from Peter's Google Drive before doing the upgrade. I opted to use his latest kernel (at the time of this writing) 4.5.0-rc2. Just download the kernel-image deb and install it using the following command:

sudo dpkg -i  linux-image-4.5.0-rc2-powerpc64_2_powerpc.deb

With that out of the way, you will want to update your /etc/yaboot.conf file to either contain a new entry for the newly installed kernel or replace your existing one.

Here is an excerpt from my yaboot.conf file with the new kernel configuration:
image=/vmlinux-4.5.0-rc2-powerpc64
    label=Linux
    read-only
    initrd=/initrd.img-4.5.0-rc2-powerpc64


Save your changes and run the following:
sudo ybin -v

Next, go ahead reboot to the new kernel using whatever label you assigned to it in your yaboot configuration.
 
The kernels he has available work with a wide range of G5 towers and nVidia cards but if you are curious to see what has worked for others up to this point, see this post on the Debian PPC mailing list.

Once that is out of the way, upgrading to Stretch was simple enough as all it requires is editing your /etc/apt/sources.list file by replacing all occurrences of the word Jessie with Stretch.  If you are using vim for your text editing tool you can use the following trick once you have the file opened for editing:

:%s/jessie/stretch/

The %s basically means every occurrence of the string jessie with the string stretch.  Easy enough.  Save your changes run apt-get update and apt-get dist-upgrade per usual. This will update the list of packages from the stretch repositories and start the upgrade to testing.

Once the upgrade is complete, I would recommend rebooting one more time for good measure.  Once logged in, make sure mesa-utils or hardinfo (if you prefer a GUI to view what currently active renderer) is installed. Here is the output from my system:

br0c0l1@TheMaster:~$ glxinfo | grep -i renderer
    GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer,
    GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer,
Extended renderer info (GLX_MESA_query_renderer):
OpenGL renderer string: Gallium 0.4 on NV47

As you can see we are using version 0.4 of Gallium on NV47 (my G5 machine's Quadro 4500FX nVidia card) to provide graphics rendering.

Here is the output when running glxgears:

br0c0l1@TheMaster:~$ vblank_mode=0 glxgears
ATTENTION: default value of option vblank_mode overridden by environment.
1840 frames in 5.0 seconds = 367.913 FPS
1861 frames in 5.0 seconds = 372.069 FPS
1828 frames in 5.0 seconds = 365.374 FPS
1823 frames in 5.0 seconds = 364.437 FPS

So again, not spectacular in terms of performance, but it is definitely a worthy start.  It is comforting and exciting to know we have made it this far. One thing I think I should make clear is that having 3D acceleration does not improve video playback performance as that is already optimized to its fullest with 2D acceleration.  3D acceleration helps considerably though if you are into gaming and OpenGL/WebGl projects.

I cannot thank Peter Saisanas enough for the work he puts into nouvea and PPC and kudos to the nouveau developers for not leaving us PPC users in the dust! 

I encourage you to try this out and report your findings with either 3D acceleration on nouvea and/or Peter's pre-built G5 kernels either here in the comments or on the Debian PowerPC mailing list.

And finally, as I always say, let the rest of us due our due diligence and report bugs!

13 comments:

  1. Not that glxgears is a benchmark but it is running synced to vsync (60Hz).

    Try the following command to run glxgears without vsync:

    vblank_mode=0 glxgears

    Id expect you to get approximately 380fps with your Quadro FX4500 and G5.

    ReplyDelete
    Replies
    1. I was aware that glxgears is not really much of a benchmark, but I was not aware of running it without it syncing it to vsync. I've updated my post with results of running it as such and got the results back you thought I would for my graphics card. Thanks for your input. Much appreciated!

      Delete
  2. Great work, Brock. As always.

    ReplyDelete
  3. Where are all the G5 Linux users for goodness sakes? Are you all taking advice from the ignorant fanboys and sticking with old and insecure Mac OS?

    ReplyDelete
    Replies
    1. Good question. Thankfully, there has been quite a bit of G5 activity on the Debian PPC mailing list the past couple of months, which has given me a bit of hope. I receive a bit of feedback there as well every now and then. ;) However, I'm hoping there are still more of us out there somewhere...

      Delete
  4. Thank you for the awesome G5 work B-Rock. I really appreciate the time and effort you've put into this.

    I'd love to have a go at this if I could. My iMac G5 is in need of a power supply. I hope that's the case anyway. I powered it up one day and it made an incredibly loud popping noise. It's been absolutely unresponsive ever since. Hopefully I'll get lucky and it'll just be the power supply and not the logic board. The logic board capacitors look OK so that's a good start.

    ReplyDelete
    Replies
    1. What's the model # of your iMac G5? I only ask because a very good friend of mine works for a university close by and recently donated 3 iMac G5s as well as a few Intel ones (which I've already sold!). I can't force myself to part with them. The university have been cleaning house lately so I have taken as much of their older PPC hardware as possible and selling the rest to pay for upgrades on the PPC stuff! Anyways, if one of them would work, I could send it your way.

      I'm hoping to receive more in the near future. And another thing... I miss reading your posts!

      Delete
    2. That's awesome! I appreciate that. I'll get more info on mine and let you know. I would love to get the iMac back online.

      Delete
    3. Back with some more info, my iMac is a 1.6ghz 17 inch. I can get the actual "EMC" number in a bit.

      Delete
    4. I think I might actually have one of those available. If you'd like I could just ship the entire thing to you. Feel free to send me a personal message if that's easier.

      Delete
  5. Debian Stretch Alpha 5 boot CD doesn't work on this Powermac G5 PPC970 1.8PCI-X at all - the keyboard doesn't respond after picking install from yaboot, but Jessie 8.3 XFCE install works. After install, it cannot get into X, so following these instructions to install Peter's kernel works wonders for it. Upgrading to Mesa 11 adds 3D acceleration, but Iceweasel doesn't work with window acceleration together with FX5200. Midori has better performance but YouTube stutters a lot. Video playback through something like VLC works okay, with 720p video working with some framedrops, which is respectable enough.

    Don't need to upgrade all the way to Stretch when Mesa 11 is available for Jessie-Backports actually.

    The only thing broken is suspend. Not sure if optical audio ever worked but at least the front speaker and headphones do work.

    As of this writing, the latest 4.4 kernel which is built for Stretch still fails to boot to X, so Peter's kernel is still much needed.

    Midori seems to have better performance than Iceweasel but scrolling performance is poor. If you need to watch YouTube, install a userscript like ViewTube.

    ReplyDelete
  6. Good point on Mesa 11 being available for Jessie-backports. I'll see about putting together a post on how to go that route instead of a complete upgrade to Stretch. Thanks for your input.

    ReplyDelete
  7. why do i get a higher value when running

    vblank_mode=0 glxgears


    on my imac g5 with 64mb geforce
    5200 (around 510fps) when compared to 256mb geforce7800gtx (around 380fps) on my mac g5 quad?



    ATTENTION: default value of option vblank_mode overridden by environment.
    2545 frames in 5.0 seconds = 508.941 FPS
    2629 frames in 5.0 seconds = 525.651 FPS

    ReplyDelete