Slashdot Mirror


Hardware Based XRender Slower than Software Rendering?

Neon Spiral Injector writes "Rasterman of Enlightenment fame has finally updated the news page of his personal site. It seems that the behind the scenes work for E is coming along. He is investigating rendering backends for Evas. The default backend is a software renderer written by Raster. Trying to gain a little more speed he ported it to the XRender extension, only to find that it became 20-50 times slower on his NVidia card. He has placed some sample code on this same news page for people to try, and see if this is also experienced on other setups."

15 of 297 comments (clear)

  1. The damndest thing. by Raven42rac · · Score: 4, Informative

    I have used both ATI and NVIDIA,(and 3dfx, and matrox, but staying relevant). Generally the NVIDIA cards I have owned have been vastly outperformed by the ATI cards right off the bat, without tweakage. (This is under Linux, mind you) Even with tweakage, in my experience, you rarely get the full potential from your card.

    --
    I hate sigs.
  2. One word: by i_am_nitrogen · · Score: 4, Informative

    Irix.

    IrisGL or OpenGL (I think OpenGL is based on IrisGL, so Irix probably now uses OpenGL) is used extensively in Irix, for both 2D and 3D.

  3. Not enough details by bobtodd · · Score: 5, Informative
    Raster doesn't say whther he had 'Option "RenderAccel" "True"' enabled, which you must do on Nvidia cards if you want XRender acceleration.

    Here is the entry from the driver README:
    Option "RenderAccel" "boolean" Enable or disable hardware acceleration of the RENDER extension. THIS OPTION IS EXPERIMENTAL. ENABLE IT AT YOUR OWN RISK. There is no correctness test suite for the RENDER extension so NVIDIA can not verify that RENDER acceleration works correctly. Default: hardware acceleration of the RENDER extension is disabled.


    Following that option, this one is noted:

    Option "NoRenderExtension" "boolean" Disable the RENDER extension. Other than recompiling the X-server, XFree86 doesn't seem to have another way of disabling this. Fortunatly, we can control this from the driver so we export this option. This is useful in depth 8 where RENDER would normally steal most of the default colormap. Default: RENDER is offered when possible.

  4. Raster's on holiday by Rabid+Penguin · · Score: 5, Informative

    Normally, he would answer some questions or comments posted about something he has written, but he will be out of town for at least a few days.

    I highly doubt he meant for this to get wide-spread exposure beyond developers of Enlightenment or X. Since it has, this is a good opportunity. I'll make this clear for anyone that didn't catch it, raster WANTS XRENDER TO BE FASTER! If there is a way to alter configuration or to recode the benchmark to do so, he wants to know about it.

    Rather than posting questions about his configuration (which he can't answer right now), grab the benchmarks that he put up and get better results.

    Now back to your regularly scheduled trolling...

  5. nVidia Linux woes by bleachboy · · Score: 4, Informative
    I have an nVidia GeForce2 Ultra, and recently upgraded my kernel to 2.5.75. It caused my X graphics to become unbelievably slow -- like 2400 baud modem slow when doing a directory listing or anything where text was scrolling. Downgrading to 2.4.21-ac4 (ac4 needed for some Adaptec drivers) and it was back to fast again. Further, my favorite 3D shooter was about 60 fps faster with the 2.4 kernel. The kernels were compiled identically, or at least as identically as you can get with 2.4 vs 2.5. Here's a few tips I can offer to the nVidia users out there:
    • In case you don't know, nVidia provides official (but woefully non-GPL) drivers. They also have a message board which I found to be quite informative at times.
    • Compile your kernel with MTRR support. It will speed things up a great deal.
    • Compile your kernel without AGPGART support. The nVidia driver(s) are faster.
    • If you want to try the nVidia driver with a 2.5 kernel, you'll need a patch.
    • If you have an nForce chipset, make sure to add "mem=nopentium" to your kernel boot parameters, or else your system will be incredibly unstable. Better yet, ditch your nForce chipset (I did) since the Linux support totally blows, at least for now. Give your old nForce chipset to your wife, girlfriend, mother, Windows box, or whatever.
  6. Re:2D acceleration using OpenGL? by Rabid+Penguin · · Score: 4, Informative

    Yes, and yes. :-)

    The current version of Evas is actually the second iteration. The first version had a backend written for OpenGL, which performed quite well for large drawing areas, but was sluggish with many small areas (bad for window managers). The software engine easily outperformed in those cases, and will be used for the resulting window manager's border drawing.

    For now, there is not an OpenGL engine in Evas, because of time constraints. E has a relatively small active development team atm, so it's difficult to say when someone will get around to adding the OpenGL engine. There should be one eventually, all nicely encapsulated except for a couple setup functions.

  7. Re: Graphics cards and computation by Black+Parrot · · Score: 4, Informative


    > There has been some work on using graphics cards for computation. The tough part is figuring out how to rephrase your algorithm in terms of what the GPU can handle.

    Isn't there a lot of sloth involved in reading your results back as well?

    Meanwhile, users of GCC can exploit whatever multimedia SIMD instructions their processor supports by telling the processor you want to use them. For x86 see this and this; for other architectures start here. (Notice the GCC version in the URL; the supported options sometimes change between versions, so you should look in a version of the GCC Manual that matches what you're actually using.)

    I confess I haven't benchmarked these options, but in theory they should boost the performance of some kinds of number-crunching algorithms.

    BTW, Linuxers can find what multimedia extensions their CPU supports with cat /proc/cpuinfo, even from a user account. Look for multimedia support in the list at the end of the cpuinfo. Lots of those extensions only support integers or low-resolution fp numbers, but IIRC SSE2 should be good for high-precision FP operations. Use google to find out what your extensions are good for.

    And post us back if you do some benchmarking, or find some good ones on the Web.

    --
    Sheesh, evil *and* a jerk. -- Jade
  8. Render Bench by AstroDrabb · · Score: 4, Informative
    I just ran the render bench from the link. The results are pretty amazing.
    Available XRENDER filters:
    nearest
    bilinear
    fast
    good
    best
    Set up...
    --ROUND 1
    --
    Test: Test Xrender doing non-scaled Over blends
    Time: 22.842 sec.
    --
    Test: Test Imlib2 doing non-scaled Over blends
    Time: 0.501 sec.

    --ROUND 2
    --
    Test: Test Xrender doing 1/2 scaled Over blends
    Time: 11.438 sec.
    --
    Test: Test Imlib2 doing 1/2 scaled Over blends
    Time: 0.188 sec.

    --ROUND 3
    --
    Test: Test Xrender doing 2* smooth scaled Over blends
    Time: 225.476 sec.
    --
    Test: Test Imlib2 doing 2* smooth scaled Over blends
    Time: 3.963 sec.
    --
    If Tyranny and Oppression come to this land,
    it will be in the guise of fighting a foreign enemy. -James Madison
  9. Re:2D acceleration using OpenGL? by mvdwege · · Score: 4, Informative

    On using OpenGL in multiple windows....

    How well does Linux do with this?) Try running a few OpenGL apps that don't stress the graphics hardware at the same time. Do they slow down?

    While my graphics hardware is not quite representative (the Matrox G450 is not known for great 3D performance), I ran two instances of glxgears.

    Short conclusion: MesaGL on Linux has the same problem. Long conclusion: the windows showed noticable slowdowns, up to the point where animation was suspended in one window while the other ran, with the system switching the running window at seemingly random intervals.

    System specs:

    • Athlon 1600XP
    • MSI K7TPro2 Motherboard
    • Matrox G450 AGP Graphics Card
    • Linux kernel 2.6.0-test3
    • XFree86 4.2.1 (Debian patchlevel 9)

    Hope this helps,


    Mart

    --
    "I know I will be modded down for this": where's the option '-1, Asking for it'?
  10. Re:accelerated? by Spy+Hunter · · Score: 4, Informative
    Well I ran Renderman's benchmark on my Radeon 9100/Athlon XP 2800 system, and here are the results (edited for lameness filter):

    *** ROUND 1 ***
    Test: Test Xrender doing non-scaled Over blends
    Time: 15.925 sec.
    ---
    Test: Test Xrender (offscreen) doing non-scaled Over blends
    Time: 15.927 sec.
    ---
    Test: Test Imlib2 doing non-scaled Over blends
    Time: 0.321 sec.
    *** ROUND 2 ***
    Test: Test Xrender doing 1/2 scaled Over blends
    Time: 7.125 sec.
    ---
    Test: Test Xrender (offscreen) doing 1/2 scaled Over blends
    Time: 7.134 sec.
    ---
    Test: Test Imlib2 doing 1/2 scaled Over blends
    Time: 0.133 sec.
    *** ROUND 3 ***
    Test: Test Xrender doing 2* smooth scaled Over blends
    Time: 131.495 sec.
    ---
    Test: Test Xrender (offscreen) doing 2* smooth scaled Over blends
    Time: 131.703 sec.
    ---
    Test: Test Imlib2 doing 2* smooth scaled Over blends
    Time: 2.487 sec.
    *** ROUND 4 ***
    Test: Test Xrender doing 2* nearest scaled Over blends
    Time: 113.890 sec.
    ---
    Test: Test Xrender (offscreen) doing 2* nearest scaled Over blends
    Time: 113.945 sec.
    ---
    Test: Test Imlib2 doing 2* nearest scaled Over blends
    Time: 1.778 sec.
    *** ROUND 6 ***
    Test: Test Xrender doing general nearest scaled Over blends
    Time: 197.817 sec.
    ---
    Test: Test Xrender (offscreen) doing general nearest scaled Over blends
    Time: 197.800 sec.
    ---
    Test: Test Imlib2 doing general nearest scaled Over blends
    Time: 5.171 sec.
    *** ROUND 7 ***
    Test: Test Xrender doing general smooth scaled Over blends
    Time: 268.509 sec.
    ---
    Test: Test Xrender (offscreen) doing general smooth scaled Over blends
    Time: 268.656 sec.
    ---
    Test: Test Imlib2 doing general smooth scaled Over blends
    Time: 7.507 sec.

    Obviously XRender is getting crushed here by Imlib2. There are a million reasons this might be happening, it's definitely worth looking into. In the best Slashdot tradition, here's some wild speculation about what might be causing the slowdown:

    • Renderman's code might be giving an unfair advantage to Imlib2. The Imlib2 results are never shown on the screen. However, XRender is tested both with display and without, so it seems like it should be fair.
    • Renderman's code might be using XRender in an inefficient way. I'm no X programming expert so I have no idea if what he's doing is the best way to do it, but Rasterman is supposed to be some sort of expert in producing nice fast graphics on X so I'd say this is unlikely.
    • XRender might not be hardware accelerated for some reason, probably having to do with driver configuration or something. But geez, does the software rendering have to be that slow? Maybe they could learn something from Imlib2.
    • The hotly debated "X protocol overhead" might be causing this slowdown. But given the magnitude of the slowdown, I think this is unlikely.
    Hopefully someone knowledgeable like Keith Packard himself will come and enlighten us with the true cause.
    --
    main(c,r){for(r=32;r;) printf(++c>31?c=!r--,"\n":c<r?" ":~c&r?" `":" #");}
  11. Re:2D acceleration using OpenGL? by Rufus211 · · Score: 4, Informative

    Must be your hardware. I have an Ath 2700 XP with a ATI 9800 running Debian with X 4.3

    Single glxgears: 3600
    3 glxgears: 1200
    5 glxgears: 700

    (All aprox numbers). So basically it scales almost perfectly with the number of open windows.

  12. I ran the benchmark with RenderAccel true by Sits · · Score: 4, Informative

    And the results were pretty much the same. Using render was several magnitudes slower on tests 2 - 7. I have a GeForce1 with 1.0.4349 nvidia driver and haven't had the same trouble others have with this option on so I run with this extension on all the time.

    Here are the results for the interested:

    Available XRENDER filters:
    nearest
    bilinear
    fast
    good
    best
    Set up...
    *** ROUND 1 ***

    Test: Test Xrender doing non-scaled Over blends Time: 0.190 sec.

    Test: Test Xrender (offscreen) doing non-scaled Over blends Time: 0.303 sec.

    Test: Test Imlib2 doing non-scaled Over blends Time: 0.697 sec.

    *** ROUND 2 ***

    Test: Test Xrender doing 1/2 scaled Over blends Time: 10.347 sec.

    Test: Test Xrender (offscreen) doing 1/2 scaled Over blends Time: 10.231 sec.

    Test: Test Imlib2 doing 1/2 scaled Over blends Time: 0.315 sec.

    *** ROUND 3 ***

    Test: Test Xrender doing 2* smooth scaled Over blends Time: 207.028 sec.

    Test: Test Xrender (offscreen) doing 2* smooth scaled Over blends Time: 205.275 sec.

    Test: Test Imlib2 doing 2* smooth scaled Over blends Time: 5.695 sec.

    *** ROUND 4 ***

    Test: Test Xrender doing 2* nearest scaled Over blends Time: 164.460 sec.

    Test: Test Xrender (offscreen) doing 2* nearest scaled Over blends Time: 166.281 sec.

    Test: Test Imlib2 doing 2* nearest scaled Over blends Time: 4.119 sec.

    *** ROUND 6 ***

    Test: Test Xrender doing general nearest scaled Over blends Time: 313.187 sec.

    Test: Test Xrender (offscreen) doing general nearest scaled Over blends Time: 310.261 sec.

    Test: Test Imlib2 doing general nearest scaled Over blends Time: 11.444 sec.

    *** ROUND 7 ***

    Test: Test Xrender doing general smooth scaled Over blends Time: 477.511 sec.

    Test: Test Xrender (offscreen) doing general smooth scaled Over blends Time: 474.695 sec.

    Test: Test Imlib2 doing general smooth scaled Over blends Time: 17.290 sec.

    (reformatted to get past the lameness filter)

  13. Re:It's RIGHT to use 3D functionality for 2D graph by rmlane · · Score: 4, Informative
    On vaugley modern hardware the 3D path is so much faster than the 2D path that it ends up being significantly faster to use the 3D path to render your desktop if your desktop is at all complicated (not a dozen mono xterms).

    This ends up being even more true if you do any sort of complex compositing (eg: alpha blending, hardware accelerated mpeg / video, openGL windows, etc, etc). Enlightenment uses alpha channels, it would be fater to composite in hardware than software. These sorts of operations are not accelerated at all on the 2d path, and have to be done in software.

    Go check out Quartz Extreme at http://www.apple.com/macosx/jaguar/quartzextreme.h tml (excuse the space in html).

    Having used Xfree86 and Quartz extreme on the same graphics hardware, I can tell you there's no comparison. Quartz is much faster and much more capable.

  14. Quartz Extreme in a few words by The+Ego · · Score: 4, Informative

    Apple's OSX does all rendering through Quartz, (as PDFs) which is accelerated by OpenGL, and called QuartzExtreme.

    That's not accurate. Quartz is really made of two parts: Quartz 2D and the Quartz Compositor.

    The Quartz Compositor is reponsible for compositing all the layers (desktop, windows, layers inside windows) on-screen. It offers Porter-Duff compositing, which was developped at Pixar more than 15 years ago. See this post from Mike Paquette for details. Mr Paquette is one of the main developpers of Quartz. Quartz Extreme is "simply" an OpenGL implementation of Porter-Duff compositing and modern graphic cards offer the primitives needed to do that very efficiently.

    The Quartz 2D layer is what offers drawing primitives following the Postscript drawing model. The same drawing model is used with PDF (no surprise), Java2D and SVG (and Microsoft's GDI+ ?). This part is not HW accelerated. I am sure Apple is working on it, but it wouldn't surprise me if new HW will be required to make this possible. There is a strong incentive for card manufacturers to offer acceleration, since Longhorn is supposed to use GDI+ extensively. I doubt that such acceleration will fit in the traditionnal OpenGL/Direct3D rendering pipeline.

    The Apple JVM team implemented HW accelerated Java2D drawing in their 1.3.1 JVM. Their 1.4 JVM doesn't offer it (1.4.1 was a massive rewrite for them, 1.3.1 was more of a quick port to OS-X using some of their "old" carbon code). There were quite a few problems when HW acceleration was used. I hope they can and will wait for a system-wide Quartz-2D HW acceleration, it seems ludicrous to have the JVM team spend resources on an effort that will be wasted once Quartz2D is accelerated.

    See Apple Marketing page, another post from Mike Paquette, and the presentation from Apple at SIGgraph about Quartz Extreme and OpenGL.

    If that post doesn't end-up rated +5 informative, I don't know what will ! :-)

  15. Re:2D acceleration using OpenGL? by Animats · · Score: 4, Informative
    So basically it scales almost perfectly with the number of open windows.

    Which means it's broken. All the windows should run at full speed until the graphics pipeline saturates.

    There are several problems. First, make sure that you're not running with "wait for VBLANK" off. There's a stupid overclocker mania for running the graphics system faster than the display can refresh. This leads to high, meaningless frame rates, and to lower system performance because the useless redraws are using up all the CPU time.

    Once you're past that, the issues are more fundamental.

    The real problem is that OpenGL is double-buffered, but most windowing systems don't understand double-buffering or frame-synchronous drawing very well. Even OpenGL has no notion of time. But this could be fixed.

    Usually, each app draws into the back buffer, then makes the OpenGL call to swap the buffers. This blocks the app (older NVidia drivers for Windows spin-locked, but I got them to fix that), but worse, it typically locks up the OpenGL subsystem until the frame ends and the buffer swap occurs. Implementations like that can only draw one window per frame time, obviously.

    What ought to happen is that a request for a buffer swap should schedule a buffer swap for the next frame cycle, block the app, then let other apps get in their draw time. At the end of the frame, when everybody is done drawing, all windows get buffer swapped, and all the apps stuck in the OpenGL buffer swap call then unblock simultaneously. That way, multiple OpenGL apps running in different windows all run at full frame rate, until the scene complexity hits the limits of the graphics hardware.

    Part of the problem is that X and OpenGL are such drastically different architectures that making them play well together is tough. X assumes a network-centric model; OpenGL assumes you're local. X expects a weak terminal; OpenGL needs good graphics acceleration. X is built around a windowing concept; OpenGL doesn't know about windows. X and OpenGL are defined by different organizations.

    Microsoft is pulling this together in the Windows world, but it's all done with Microsoft APIs, and, recently, undocumented hardware that favors those APIs.