Skip to main content

Any GPU acceleration on Linux ever?

10 replies [Last post]
xlinuks
Offline
Joined: 2006-05-09
Points: 0

Hi,
The current update 10 build 28 shows that Java doesn't use GPU accelaration on Linux (Ubuntu 8.04.1). Are there plans to support this feature in Linux as well?

PS:
As a reference I checked this site, the applet in the lower left corner it reports which way Java renders the graphics:
http://weblogs.java.net/blog/campbell/archive/2008/02/effectuation_th.html
On windows Java uses Direct3D and the CPU is under 1%, on Linux it doesn't use acceleration (OpenGL) and the CPU is above 60% - that makes such applets on Linux dangerous/unusable!

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
linuxhippy
Offline
Joined: 2004-01-07
Points: 0

Hi,

I just can second that. OpenGL drivers don't seem to get a lot of attention, because most cards are sold because of benchmark results. And well, most games are based on D3D these days.

I am working on another approach for better 2D accaleration on Unix, you can find more about it there:
http://openjdk.java.net/projects/xrender/

Its not quite there yet, however I'll soon distribute builds and I would be glad if you could test it and report your results. However for now it also has to fight with broken and slow drivers, however at least here the situation is getting a lot better (instead of worse ;) ).

lg Clemens

mbien
Offline
Joined: 2007-04-29
Points: 0

i would like to defend a bit the OpenGL drivers on linux ;-)

So what people are actually saying if they say the drivers are not as good as they can be is that for doing hw accelerated _2d with OpenGL you have to go through a lot of corner cases and use not mainstream apis (remember OpenGL is a 3d api) which are quite buggy.

People are playing WoW, Quake etc on linux and aren't complaining much more about drivers as windows gamers, not to mention the compiz 3d desktop which is default on many mainstream desktop linux distributions (ubuntu, mandriva...).

From a birds eye view it seems like it is possible to do stable OpenGL on linux its just a matter of resources you are able to invest in it.

Since even the GTK combobox fix hasn't made it into the update 10 release, i pretty much gave up the dream of enabling the opengl pipeline anytime soon for linux java apps. (but no one can really blame sun for having windows on higher priority than linux...)

btw, good work with xrenderer!

linuxhippy
Offline
Joined: 2004-01-07
Points: 0

> So what people are actually saying if they say the
> drivers are not as good as they can be is that for
> doing hw accelerated _2d with OpenGL you have to go
> through a lot of corner cases and use not mainstream
> apis (remember OpenGL is a 3d api) which are quite
> buggy.
Well, OpenGL is both 2d and 3d, it e.g. has many types dedicated to 2d rendering - the java2d backend doesn't really do very special things, it just does a few things not that common for games.
Also, Direct3D is also 3D ;)

> From a birds eye view it seems like it is possible to
> do stable OpenGL on linux its just a matter of
> resources you are able to invest in it.
I don't agree here.
It took some releases for the nvidia driver to be able to run the pipeline, but since then new releases break, work, break again with another bug - looks like they don't have very advanced regression testing, or at least Java is not in their set and as far as I know Sun even sent them tool for veryfing the ogl pipeline works.
Code dies by working arround every possible bug.

The free, mesa based opengl drivers are ... I think free drivers are very important, and the guys working on that have all my respect, its just that its my impression they have a really hard time keeping up.

> btw, good work with xrenderer!
Thanks :)

lg Clemens

mbien
Offline
Joined: 2007-04-29
Points: 0

> Well, OpenGL is both 2d and 3d, it e.g. has many
> types dedicated to 2d rendering -
> the java2d backend
> doesn't really do very special things, it just does a
> few things not that common for games.
That is the point. I know you can easily disable depth buffer and everything but just by setting the z value to a constant doesn't transform a 3d api to a 2d api. Using OpenGL for 2d is a special case for the driver and may lead into not mainstream api usage with instability as consequence.

But what i intendet to say was actually it *seams* to be possible to use GL for this purpose. I have tried ubuntu on three systems (GF5, GF7GX2 dual head setup, X1600 mobility [ATI!]) with propretary drivers (via default install wizzard nothing fancy) and enabled everything what was possible on the compiz-fusion preferences and it worked suprisingly stable (google earth, video, my own JOGL apps using FBOs & GLSL etc. no problems) except java with opengl pipeline enabled.

xlinuks
Offline
Joined: 2006-05-09
Points: 0

The nvidia drivers are good, in fact they are quite as cool as those for windows, I think Java should check whether the driver are "acceptable", but, you see, Java only tries to use accelearation if it detects it's running on windows. I can understand if you're talking about ATI, but the majority of us know that ATI is cumbersome so we purchase Nvidia cards, so I think more than like 60% have nvidia cards so it's worth making Java detect that automatically (it is possible, and not more difficult to implement than on windows I think).
I think the OpenGL pipeline is _not_ enabled by default even when it _can_ be used because it's not robust enough, if so, the question is again, when will it be, if ever.
Why not just do that and more than half of all the Linux users will turn more than happy and will praise Java devs for doing a good/complete job.

trembovetski
Offline
Joined: 2003-12-31
Points: 0

> The nvidia drivers are good, in fact they are quite as cool as those for windows

Are you comparing OpenGL drivers on Linux and D3D drivers on Windows? If so, they are very much different, and the D3D drivers get WAY more attention from Nvidia, which shows in overall drivers quality.

In general drivers on Windows have much higher priority (which is understandable). But even on Windows the OpenGL drivers are behind Direct3D drivers in quality.

> I think the OpenGL pipeline is _not_ enabled by default even when it _can_ be used because it's not robust enough

And you base your opinion on what? In the last couple of years pretty much every bug filed against the Java2D OpenGL pipeline was traced to some driver-related issue and was either worked around or submitted to Nvidia when it's not possible or feasible.

Nvidia's drivers break the pipeline every few releases if not more often.
We're working with Nvidia to improve the situation by making sure they don't break the pipeline, by running our set of tests as part of their quality acceptance suite but it'll take some time until this initiative is up and running.

Again, it's not an issue with the pipeline quality, but with the drivers'.

Dmitri

xlinuks
Offline
Joined: 2006-05-09
Points: 0

Thanks,
So it turns out Nvidia is to blame, if so I see why the kernel devs lately tried forcing/talking Nvidia into open sourcing their drivers:
http://blogs.zdnet.com/open-source/?p=2587

Hopefully the ignition in open source drivers for ATI cards will be production quality (with 3D) by the end of the year or so, when that happens I get myself an ATI video card.

trembovetski
Offline
Joined: 2003-12-31
Points: 0

Just to clarify, noone is to blame. Everybody has their priorities.

As for ATI, don't expect much either. Most of these companies have completely different code bases for opened and closed drivers, and even different teams working on them (to avoid contamination) so it'd be very hard to have real parity between closed and opened driver versions until they truly are built from the same source.

Dmitri

trembovetski
Offline
Joined: 2003-12-31
Points: 0

There is an OpenGL pipeline on linux which is on par with the D3D pipeline, it's just not enabled by default because of the sore drivers situation on Linux. You can try it out with -Dsun.java2d.opengl=True.

Dmitri

i30817
Offline
Joined: 2006-05-02
Points: 0

Isn't the upcoming XRender pipeline for this?
Though there should be hardware acceleration already...

http://linuxhippy.blogspot.com/