Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JavaCL.createBestContext() hangs on GTX680 (Kepler architecture) #15

Open
ochafik opened this issue Mar 18, 2015 · 8 comments
Open

JavaCL.createBestContext() hangs on GTX680 (Kepler architecture) #15

ochafik opened this issue Mar 18, 2015 · 8 comments
Labels

Comments

@ochafik
Copy link
Member

ochafik commented Mar 18, 2015

From @karolovbrat on October 5, 2012 10:22

Hi Olivier,

when I try to run my JavaCL application it hangs in JavaCL.createBestContext().

Used HW and SW is

CentOS linux
GTX 680 (Kepler architecture) with Cuda Toolkit 4.2

When I try to run it under same settings on GTX 480 (Fermi architecture) it runs just fine.

Thank you very much for investigating the matter.
Regards,
Jan

Copied from original issue: nativelibs4java/nativelibs4java#343

@ochafik ochafik added the JavaCL label Mar 18, 2015
@ochafik
Copy link
Member Author

ochafik commented Mar 18, 2015

Hi Jan,

Thanks for your bug report!

Is this happening on a 64 bit linux + 64 bit JVM? (java -version)
And by any chance, were you able to attach a Java debugger or gdb to see which call the process is hung into?

Also, could you please try to call JavaCL.createBestContext(CLPlatform.DeviceFeature.GPU) instead, and if it works, to check if other features than the default MaxComputeUnits cause the hang?

Cheers

@ochafik
Copy link
Member Author

ochafik commented Mar 18, 2015

From @karolovbrat on October 8, 2012 20:41

Hi Olivier,

"Is this happening on a 64 bit linux + 64 bit JVM? (java -version)"
-> Yes, the used JVM version is 1.7.0

"Also, could you please try to call JavaCL.createBestContext(CLPlatform.DeviceFeature.GPU) instead, and if it works, to check if other features than the default MaxComputeUnits cause the hang?"
-> It hangs with all the features.

"And by any chance, were you able to attach a Java debugger or gdb to see which call the process is hung into?"
Unfortunately, I am running my code on a cluster so I am not really allowed to do this but I guess if you do not have access to GTX 680 we have no other option :) (I will try to do it and get back to you)

Cheers,
Jan

@ochafik
Copy link
Member Author

ochafik commented Mar 18, 2015

From @karolovbrat on October 8, 2012 21:54

Hi Olivier,

I attached the jdb debugger to my application and retrieved the following stack trace
main:
[1] com.nativelibs4java.opencl.library.OpenCLLibrary.clCreateContext (native method)
[2] com.nativelibs4java.opencl.CLPlatform.createContext (CLPlatform.java:384)
[3] com.nativelibs4java.opencl.JavaCL.createBestContext (JavaCL.java:246)
[4] com.nativelibs4java.opencl.JavaCL.createBestContext (JavaCL.java:237)

I am running javacl 1.0.0-RC2.

Hopefully this helps.

Cheers,
Jan

@ochafik
Copy link
Member Author

ochafik commented Mar 18, 2015

Hi @karolovbrat ,

Thanks for your help!

Could you please try switching to the latest 1.0-SNAPSHOT version?
(here's a direct link in case you're not using Maven: https://oss.sonatype.org/content/groups/public/com/nativelibs4java/javacl/1.0-SNAPSHOT/javacl-1.0-20121008.223530-56-shaded.jar )

Cheers

@ochafik
Copy link
Member Author

ochafik commented Mar 18, 2015

From @karolovbrat on October 9, 2012 7:17

Hi Olivier,

the 1.0-SNAPSHOT version still hangs the stack trace follows:

[1] com.nativelibs4java.opencl.library.OpenCLLibrary.clCreateContext (native method)
[2] com.nativelibs4java.opencl.CLPlatform.createContext (CLPlatform.java:405)
[3] com.nativelibs4java.opencl.JavaCL.createBestContext (JavaCL.java:335)
[4] com.nativelibs4java.opencl.JavaCL.createBestContext (JavaCL.java:326)

Cheers,
Jan

@ochafik
Copy link
Member Author

ochafik commented Mar 18, 2015

Hi Jan,

Thanks a lot for your patience!

It turns out the way JavaCL called clCreateContext used an "implementation-defined" case, according to the specs (cf. case of NULL properties parameter: http://www.khronos.org/registry/cl/sdk/1.0/docs/man/xhtml/clCreateContext.html ).
This should be fixed in the latest snapshot, could you please try it and let me know how it goes?

https://oss.sonatype.org/content/repositories/snapshots/com/nativelibs4java/javacl-shaded/1.0-SNAPSHOT/javacl-shaded-1.0-20121009.225048-39.jar

Cheers

@ochafik
Copy link
Member Author

ochafik commented Mar 18, 2015

From @karolovbrat on October 10, 2012 9:35

Hi Olivier,

Thanks a lot for your effort. Unfortunately, it still hangs.

[1] com.nativelibs4java.opencl.library.OpenCLLibrary.clCreateContext (native method)
[2] com.nativelibs4java.opencl.CLPlatform.createContext (CLPlatform.java:408)
[3] com.nativelibs4java.opencl.JavaCL.createBestContext (JavaCL.java:335)
[4] com.nativelibs4java.opencl.JavaCL.createBestContext (JavaCL.java:326)

I will also try to call "createContext(Map<CLPlatform.ContextProperties,Object> contextProperties, CLDevice... devices)" so that I can specify the device for which I want to create the context.

Cheers,
Jan

@ochafik
Copy link
Member Author

ochafik commented Mar 18, 2015

From @karolovbrat on October 10, 2012 9:44

Creating the context for the specific device through:

CLDevice device = JavaCL.getBestDevice();
context = JavaCL.createContext(null, device);

did not help either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant