AMD Open Sources Aparapi!

[quote]The AMD JavaLabs team is proud to announce the open source release of our Aparapi project.
[/quote]
In theory sounds like a much nicer way to use OpenCL from Java.

More info here.

Hmm what system should I use for my next new pc, i3 or Llano…?
[look the post]
maybe Llano~ ;D

That sounds like a very cool trick, I’m curious to know how often it’s able to compile java bytecode into an OpenCL kernel.

It’s more or less deterministic, since the requirements are documented in the Java Kernel Guidelines: http://code.google.com/p/aparapi/wiki/JavaKernelGuidelines

Hi!

[quote]At present Aparapi only works with AMD graphics cards
[/quote]
http://code.google.com/p/aparapi/wiki/FrequentlyAskedQuestions#Does_Aparapi_only_work_with_AMD_graphics_cards?
It will be more interesting when it works on other graphics cards too. It would be better to modify Aparapi so that it uses an existing Java binding for the OpenCL API (JOCL which is a part of JogAmp for example).

I like the principle but I don’t want to be forced to use ATI hardware.

Moreover, AMD claims that it might not work on other JVMs (OpenJDK).

I bet that’s because it uses Unsafe under the hood somewhere :slight_smile: Just a guess, mind.

Cas :slight_smile:

It’s more likely that they haven’t really tested it with other JVMs, and that is why they don’t recommend them.

It might be nice if this was taken a little further, and folded into a Java compiler. If the code could be used with OpenCL, it would be automatically translated into the appropriate code. It might also need to add some runtime checks to avoid using it on trivial examples. That would be pretty cool.

Actually, reading bits of the wiki I’d say Cas is right. There is use of Unsafe, as well as some tuning to the output of javac

http://code.google.com/p/aparapi/wiki/FrequentlyAskedQuestions#Why_does_the_Aparapi_documentation_suggest_I_use_Oracle's_J

@gouessej - I wouldn’t have thought that any of that poses an issue for OpenJDK. The fact they think most Linux distributions still default to gcj made me laugh though!

Unsafe works on OpenJDK as far as I know. Aparapi cannot be used on NVIDIA graphics cards. Therefore I won’t give it a try.

[quote=“gouessej,post:9,topic:37237”]
+1

I was specifically responding to your comment about OpenJDK.

While slightly amused at your NVIDIA comment, knowing your strong open-source beliefs, Aparapi cannot be used on NVIDIA graphics cards currently - they are actively seeking contributions to target other OpenCL implementations. I don’t think there’s much that’s vendor specific.

Is it actually based on OpenCL? Or is it a completely separate API?

Cas :slight_smile:

http://code.google.com/p/aparapi/wiki/FrequentlyAskedQuestions#Can_I_get_Aparapi_for_platforms_other_than_those_listed?

Does no-one read FAQs anymore??? :stuck_out_tongue:

I wonder how they screwed it up so that it only works on AMD GPUs if it’s OpenCL…

They should use JOCL, it would solve several problems of performances (see the FAQ) and you know that I cannot contribute to everything, I’m already working on the JOGL 2.0 renderer of Ardor3d…

I wasn’t suggesting that you specifically had to work on it!

As for JOCL solving some of the performance problems, aren’t you missing the point?! Maybe you should start coding in C or assembler because it solves some of the performance problems of Java? :stuck_out_tongue:

I wonder if a JOCL backing to the compiler would be possible though?

Like princec, I really wonder if people really reads the FAQ:
http://code.google.com/p/aparapi/wiki/FrequentlyAskedQuestions#Why_does_Aparapi_seems_to_be_copying_data_unnecessarily_back_and
JOCL works with NVIDIA and ATI graphics cards. I have seen a lot of projects duplicating objects in memory because they do not use NIO buffers, I’m not a newbie. For example, it is the case of the Java version of VSG OpenInventor. I remind you that I have a strong experience in C, I wrote a simulator of heavy processes, I accepted some missions at the beginning of my career in C. Maybe you were joking but I did not find it fun.

Huh? It was me that made that point to princec (in jest I hasten to add!)

Yes, I was joking, but you still seem to be misunderstanding what the point of Aparapi is - to run Java code on the GPU using OpenCL. It converts Java bytecode to OpenCL at runtime. You swap some performance for convenience, hence my comment about assembler over Java.

Yup agreed, OpenCL and even OpenGL shaders are a pain for java developers to pick up, no matter how nice the connecting api to C is, something like the above project is a pretty welcome idea/attempt IMO.

The objection that you shouldn’t support the project because it is AMD only or slow in some way are invalid atm, its still very early days for the project and they’ve made it clear they want to eventually support all OpenCL hardware (and even asked for help regarding this). Its pretty rare for a big vendor like AMD to spend time and resources to care for the small java gaming/graphics/computing community, its even open source under the really nice BSD license.

Well said.

The FAQ’s a bit of a big 'un though, had a bit of a tl;dr moment with it to be honest. But I was wondering why it only worked with ATI if it was purportedly built on OpenCL, which is supposedly supported by both ATI/AMD and Nvidia. (What about Intel? I suppose that’s asking a bit much seeing as they can’t even get their drivers to switch to bloody fullscreen without crashing)

Cas :slight_smile: