OSX: "OpenCL library not found"

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

OSX: "OpenCL library not found"

felix
Hi,

I'm trying to get started with JOCL on OSX 10.6.8. Unfortunately the native (OSX) OpenCL library/framework cannot be loaded. (note: libjocl.dylib is found) Creating a context:
"CLContext context = CLContext.create();"
results in the following exception (full stacktrace at the end of this post):
Exception in thread "main" com.jogamp.common.JogampRuntimeException: JOCL initialization error.
Caused by: com.jogamp.common.JogampRuntimeException: OpenCL library not found.

As far as I can see from the Gluegen code it should not be necessary to add "/System/Library/Frameworks" to the library path. However doing so does not help.

I did some "debugging" and found that somewhere in CLContext.java the OpenCL library ist loaded using the following call:
NativeLibrary test = NativeLibrary.open("OpenCL", myClassLoader);
For some reason this call returns "null" on my system. Calling it with the absolute path to a symlink of the library like this:
NativeLibrary test = NativeLibrary.open("/System/Library/Frameworks/OpenCL.framework/OpenCL", myClassLoader);
returns the desired library.

However, I can't get JOCL to correctly load the framework. Am I missing something or might this be a bug in the Gluegen sources?

Any help is very welcome, thank you.

Full stack trace and JOCL version:
-----------------------------------------------------------------------------------------------------
Platform: MACOS / Mac OS X 10.6.8 (os), x86_64 (arch) 8 cores
MachineDescription: runtimeValidated true, littleEndian true, 32Bit false, primitive size / alignment:
  int8    1 / 1, int16   2 / 2
  int     4 / 4, long    8 / 8
  int32   4 / 4, int64   8 / 8
  float   4 / 4, double  8 / 8, ldouble 16 / 16
  pointer 8 / 8, page    4096
Platform: Java Version: 1.6.0_29, VM: Java HotSpot(TM) 64-Bit Server VM, Runtime: Java(TM) SE Runtime Environment
Platform: Java Vendor: Apple Inc., http://www.apple.com/, is JavaSE: true
-----------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------
Package: com.jogamp.opencl
Extension Name: com.jogamp.opencl
Specification Title: Java Bindings for OpenCL
Specification Vendor: JogAmp Community
Specification Version: 0.9
Implementation Title: Java Bindings for OpenCL
Implementation Vendor: JogAmp Community
Implementation Vendor ID: com.jogamp
Implementation URL: http://jocl.jogamp.org/
Implementation Version: 0.9-b28-20111202
Implementation Branch: rc
Implementation Commit: 70407434fd4cd205b127ed7d73832eb0b3d01263
-----------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------
Package: com.jogamp.common
Extension Name: com.jogamp.common
Specification Title: GlueGen Java Bindings Generator
Specification Vendor: JogAmp Community
Specification Version: 2.0
Implementation Title: GlueGen Run-Time
Implementation Vendor: JogAmp Community
Implementation Vendor ID: com.jogamp
Implementation URL: http://jogamp.org/
Implementation Version: 2.0-b32-20111202
Implementation Branch: rc
Implementation Commit: e5aaa05c071e311f1f0d8298dce268a3b44d32ea
-----------------------------------------------------------------------------------------------------
Exception in thread "main" com.jogamp.common.JogampRuntimeException: JOCL initialization error.
        at com.jogamp.opencl.CLPlatform.initialize(CLPlatform.java:220)
        at com.jogamp.opencl.CLPlatform.initialize(CLPlatform.java:148)
        at com.jogamp.opencl.CLPlatform.getDefault(CLPlatform.java:229)
        at com.jogamp.opencl.CLContext.create(CLContext.java:170)
        at com.jogamp.opencl.CLContext.create(CLContext.java:145)
        at ImagePyramide.allocate(ImagePyramide.java:39)
        at ImagePyramide.<init>(ImagePyramide.java:23)
        at FreeCamTest.main(FreeCamTest.java:6)
Caused by: com.jogamp.common.JogampRuntimeException: OpenCL library not found.
        at com.jogamp.opencl.CLPlatform$2.run(CLPlatform.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.jogamp.opencl.CLPlatform.initialize(CLPlatform.java:196)
        ... 7 more



Reply | Threaded
Open this post in threaded view
|

Re: OSX: "OpenCL library not found"

felix
I just tried the previous stable release from

http://jogamp.org/deployment/archive/rc/gluegen_28-joal_17-jogl_41-jocl_25/jar/

and it works! So this is most likely a bug...

Felix
Reply | Threaded
Open this post in threaded view
|

Re: OSX: "OpenCL library not found"

Sven Gothel
Administrator
On Wednesday, December 14, 2011 08:46:10 PM felix [via jogamp] wrote:
>
> I just tried the previous stable release from
>
> http://jogamp.org/deployment/archive/rc/gluegen_28-joal_17-jogl_41-jocl_25/jar/
>
> and it works! So this is most likely a bug...
>
> Felix

Thank you for finding this regression.
Probably related to our native JRE loading mechanism,
which has not been adapted to JOAL and JOCL.

Julien already reported this issue.

Will do after the OS X bug fixing.

~Sven
Reply | Threaded
Open this post in threaded view
|

Re: OSX: "OpenCL library not found"

felix
Ok, Thanks.
BTW: The Link to the JavaDoc on the JOCL main page is not working...
Reply | Threaded
Open this post in threaded view
|

Re: OSX: "OpenCL library not found"

Sven Gothel
Administrator
On Thursday, December 15, 2011 08:35:12 AM felix [via jogamp] wrote:
>
> Ok, Thanks.
> BTW: The Link to the JavaDoc on the JOCL main page is not working...
>

all fixed in RC5.
Reply | Threaded
Open this post in threaded view
|

Re: OSX: "OpenCL library not found"

Esteban
I am triying to work with jogamp jocl in from linux amd64 in version 2.0-b33-20111219 and the bug stills present.

Thats the output:

Platform: LINUX / Linux 3.0.0-16-generic (os), amd64 (arch) 4 cores
MachineDescription: runtimeValidated true, littleEndian true, 32Bit false, primitive size / alignment:
  int8    1 / 1, int16   2 / 2
  int     4 / 4, long    8 / 8
  int32   4 / 4, int64   8 / 8
  float   4 / 4, double  8 / 8, ldouble 16 / 16
  pointer 8 / 8, page    4096
Platform: Java Version: 1.6.0_23, VM: OpenJDK 64-Bit Server VM, Runtime: OpenJDK Runtime Environment
Platform: Java Vendor: Sun Microsystems Inc., http://java.sun.com/, is JavaSE: true
-----------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------
Package: com.jogamp.opencl
Extension Name: com.jogamp.opencl
Specification Title: Java Bindings for OpenCL
Specification Vendor: JogAmp Community
Specification Version: 0.9
Implementation Title: Java Bindings for OpenCL
Implementation Vendor: JogAmp Community
Implementation Vendor ID: com.jogamp
Implementation URL: http://jocl.jogamp.org/
Implementation Version: 0.9-b29-20111219
Implementation Branch: rc
Implementation Commit: c719d9420ca0205acf4a691e13687a0354018cb9
-----------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------
Package: com.jogamp.common
Extension Name: com.jogamp.common
Specification Title: GlueGen Java Bindings Generator
Specification Vendor: JogAmp Community
Specification Version: 2.0
Implementation Title: GlueGen Run-Time
Implementation Vendor: JogAmp Community
Implementation Vendor ID: com.jogamp
Implementation URL: http://jogamp.org/
Implementation Version: 2.0-b33-20111219
Implementation Branch: rc
Implementation Commit: 013600318f24391cd6c8c541343c208736b5f4f4
-----------------------------------------------------------------------------------------------------
Exception in thread "main" com.jogamp.common.JogampRuntimeException: JOCL initialization error.
        at com.jogamp.opencl.CLPlatform.initialize(CLPlatform.java:220)
        at com.jogamp.opencl.CLPlatform.initialize(CLPlatform.java:148)
        at com.jogamp.opencl.CLPlatform.getDefault(CLPlatform.java:229)
        at com.jogamp.opencl.CLContext.create(CLContext.java:170)
        at com.jogamp.opencl.CLContext.create(CLContext.java:145)
        at DemoJOCL.initJavaOCL(DemoJOCL.java:22)
        at DemoJOCL.main(DemoJOCL.java:65)
Caused by: com.jogamp.common.JogampRuntimeException: OpenCL library not found.
        at com.jogamp.opencl.CLPlatform$2.run(CLPlatform.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.jogamp.opencl.CLPlatform.initialize(CLPlatform.java:196)
        ... 6 more
Reply | Threaded
Open this post in threaded view
|

Re: OSX: "OpenCL library not found"

gouessej
Administrator
Hi

Do you reproduce this problem with the build 586? Have you tried to use OpenCL in plain C first to check whether your install is correct and your OpenCL driver works fine?
Julien Gouesse | Personal blog | Website