Problem running JOCL on Linux

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem running JOCL on Linux

Giovanni Idili
I am back with yet another beginner question.

I've got a project running Ok on mac and Windows, now I am trying to test it on Linux SUSE (11, Enterprise SP1, 64bit) and I am running into some issues.

I am using the native libraries packaged in jocl-0.9-b13-20110303-linux-i586.7z -- I only need gluegen and jocl so I am using libgluegen-rt.so and libjocl.so (where on mac I was using libgluegen-rt.jnilib and libjocl.dylib).

This is what I get when I run it:

Exception in thread "main" java.lang.UnsatisfiedLinkError: /lib/libjocl.so: /lib/libjocl.so: wrong ELF class: ELFCLASS64 (Possible cause: architecture word width mismatch)
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at com.jogamp.common.jvm.JNILibLoaderBase.loadLibraryInternal(JNILibLoaderBase.java:218)
at com.jogamp.common.jvm.JNILibLoaderBase.access$000(JNILibLoaderBase.java:51)
at com.jogamp.common.jvm.JNILibLoaderBase$DefaultAction.loadLibrary(JNILibLoaderBase.java:81)
at com.jogamp.common.jvm.JNILibLoaderBase$DefaultAction.loadLibrary(JNILibLoaderBase.java:106)
at com.jogamp.common.jvm.JNILibLoaderBase.loadLibrary(JNILibLoaderBase.java:146)
at com.jogamp.opencl.JOCLJNILibLoader.loadOpenCL(JOCLJNILibLoader.java:46)
at com.jogamp.opencl.CLPlatform$2.run(CLPlatform.java:152)
at java.security.AccessController.doPrivileged(Native Method)
at com.jogamp.opencl.CLPlatform.initialize(CLPlatform.java:149)
at com.jogamp.opencl.CLPlatform.getDefault(CLPlatform.java:181)
at com.jogamp.opencl.CLContext.create(CLContext.java:168)
at com.jogamp.opencl.CLContext.create(CLContext.java:143)
at AlphaHHKernel_Tuning_Test.main(AlphaHHKernel_Tuning_Test.java:48)


Where's the catch?

Any help appreciated!
Reply | Threaded
Open this post in threaded view
|

Re: Problem running JOCL on Linux

Michael Bien
  if you are running it on a 64bit jvm you will have to use 64bit natives.

64bit -> *-linux-amd64
32bit -> *-linux-i586

amd64 is the old term for x86_64 not for the OpenCL amd sdk :)

regards,
michael

On 06/22/2011 03:05 AM, Giovanni Idili [via jogamp] wrote:

>
> I am back with yet another beginner question.
>
> I've go a project running Ok on mac and Windows, now I am trying to test it
> on Linux SUSE (11, Enterprise SP1, 64bit) and I am running into some issues.
>
> I am using the native libraries packaged in
> jocl-0.9-b13-20110303-linux-i586.7z -- I only need gluegen and jocl so I am
> using libgluegen-rt.so and libjocl.so (where on mac I was using
> libgluegen-rt.jnilib and libjocl.dylib).
>
> This is what I get when I run it:
>
> Exception in thread "main" java.lang.UnsatisfiedLinkError: /lib/libjocl.so:
> /lib/libjocl.so: wrong ELF class: ELFCLASS64 (Possible cause: architecture
> word width mismatch)
> at java.lang.ClassLoader$NativeLibrary.load(Native Method)
> at java.lang.ClassLoader.loadLibrary0(Unknown Source)
> at java.lang.ClassLoader.loadLibrary(Unknown Source)
> at java.lang.Runtime.loadLibrary0(Unknown Source)
> at java.lang.System.loadLibrary(Unknown Source)
> at
> com.jogamp.common.jvm.JNILibLoaderBase.loadLibraryInternal(JNILibLoaderBase.java:218)
> at
> com.jogamp.common.jvm.JNILibLoaderBase.access$000(JNILibLoaderBase.java:51)
> at
> com.jogamp.common.jvm.JNILibLoaderBase$DefaultAction.loadLibrary(JNILibLoaderBase.java:81)
> at
> com.jogamp.common.jvm.JNILibLoaderBase$DefaultAction.loadLibrary(JNILibLoaderBase.java:106)
> at
> com.jogamp.common.jvm.JNILibLoaderBase.loadLibrary(JNILibLoaderBase.java:146)
> at com.jogamp.opencl.JOCLJNILibLoader.loadOpenCL(JOCLJNILibLoader.java:46)
> at com.jogamp.opencl.CLPlatform$2.run(CLPlatform.java:152)
> at java.security.AccessController.doPrivileged(Native Method)
> at com.jogamp.opencl.CLPlatform.initialize(CLPlatform.java:149)
> at com.jogamp.opencl.CLPlatform.getDefault(CLPlatform.java:181)
> at com.jogamp.opencl.CLContext.create(CLContext.java:168)
> at com.jogamp.opencl.CLContext.create(CLContext.java:143)
> at AlphaHHKernel_Tuning_Test.main(AlphaHHKernel_Tuning_Test.java:48)
>
> Where's the catch?
>
> Any help appreciated!
>
>
> _______________________________________________
> If you reply to this email, your message will be added to the discussion below:
> http://forum.jogamp.org/Problem-running-JOCL-on-Linux-tp3093748p3093748.html
> To start a new topic under jogamp, email [hidden email]
> To unsubscribe from jogamp, visit
http://michael-bien.com/

Reply | Threaded
Open this post in threaded view
|

Re: Problem running JOCL on Linux

Giovanni Idili
Thanks Michael,

do you mean not only I have to swap the native libraries in (libgluegen-rt.so.so + libjocl.so) but I also have to repackage whatever java app I have with these jars?

gluegen-rt-natives-linux-amd64.jar
jocl-natives-linux-amd64.jar

Sorry for the confusion!
Reply | Threaded
Open this post in threaded view
|

Re: Problem running JOCL on Linux

Michael Bien
  sadly yes,

there is currently a naming conflict between 32 and 64 libs so you can't
just put all libs into one single folder and run the jocl app.
i have plans to fix this but i am currently a bit swamped with other
things...

regards,
michael


On 06/22/2011 07:46 PM, Giovanni Idili [via jogamp] wrote:

>
> Thanks Michael,
>
> do you mean not only I have to swap the native libraries in
> (libgluegen-rt.so.so + libjocl.so) but I also have to repackage whatever
> java app I have with these jars?
>
> <p>gluegen-rt-natives-linux-amd64.jar</p>
> <p>jocl-natives-linux-amd64.jar</p>
>
> Sorry for the confusion!

Reply | Threaded
Open this post in threaded view
|

Re: Problem running JOCL on Linux

Giovanni Idili
Once again thanks - working now! :)

I am getting the following error (which I wasnt getting on AMD/nVidia cards on Mac) when it compiles the kernel:

CLDevice [id: 140003654218144 name: Tesla M2050 type: GPU profile: FULL_PROFILE] build log:
<program source>:26:36: error: cannot modify value of type 'float'
for (float t = 0; t < steps; t++) {


but I realize this is out of scope on this forum so I'll probably post something over at the khronos forums.
Reply | Threaded
Open this post in threaded view
|

Re: Problem running JOCL on Linux

notzed
Just use t += 1, ++ is not allowed for float types according to the opencl spec (S6.3.d) but not every compiler enforces this.


Reply | Threaded
Open this post in threaded view
|

Re: Problem running JOCL on Linux

Giovanni Idili
And once again ... thanks!

You guys rock. I was gonna try something along those lines but now I know why it doesn't work -- it wouldn't hurt once in a while to have a look at the spec, wouldn't it now? :)