mtchamengo / aparapi

Automatically exported from code.google.com/p/aparapi
Other
0 stars 0 forks source link

Java VM crash on openSUSE x64 and GeForce GTX 460 #87

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Prepare a kernel for aparapi (or use one from examples)
2. Run your application

What is the expected output? What do you see instead?
The Java VM crashes. The stack of failing thread suggests a problem with 
JNI/loading of native library (however it's in the right path):

Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x577cd7]  jni_GetObjectClass+0xa7

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  
com.amd.aparapi.KernelRunner.initJNI(Lcom/amd/aparapi/Kernel;Lcom/amd/aparapi/Op
enCLDevice;I)J+0
j  
com.amd.aparapi.KernelRunner.execute(Ljava/lang/String;Lcom/amd/aparapi/Range;I)
Lcom/amd/aparapi/Kernel;+250
j  
com.amd.aparapi.Kernel.execute(Ljava/lang/String;Lcom/amd/aparapi/Range;I)Lcom/a
md/aparapi/Kernel;+26
j  
com.amd.aparapi.Kernel.execute(Lcom/amd/aparapi/Range;I)Lcom/amd/aparapi/Kernel;
+5
j  com.amd.aparapi.Kernel.execute(I)Lcom/amd/aparapi/Kernel;+6
[...]

What version of the product are you using? On what operating system?
openSUSE 11.4 (x86_64)
Java 1.7.0_04-b20, HotSpot 64-bit Server VM (build 23.0-b21, mixed mode)  
Aparapi 2012-12-02
nVidia GeForce GTX 460

Please provide any additional information below.
The failing code worked fine on Windows 7 x64 and AMD Radeon HD7850 and Java 
1.7.0_09-b05 x64.

Original issue reported on code.google.com by pawlakto...@gmail.com on 19 Dec 2012 at 3:47

Attachments:

GoogleCodeExporter commented 9 years ago
The Nvidia's driver was in 270.41.19 version.

Original comment by pawlakto...@gmail.com on 19 Dec 2012 at 3:54

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Thanks for reporting.  I think this is a duplicate of Ryans last observation 
for http://code.google.com/p/aparapi/issues/detail?id=83

Sadly I do not have an NVidia setup to help me debug. Let me at least track 
through the code to see if we are doing something stupid. 

I suggest we track this problem here.  I think that #83 is being overloaded. 

Gary 

Original comment by frost.g...@gmail.com on 21 Jan 2013 at 3:28

GoogleCodeExporter commented 9 years ago
Pawlaktomek... Do you have a setup where you can build from trunk.  It is 
pretty easy on linux (assuming you have Java, Ant, g++ and OpenCL headers - 
which you can get from NVidia).

Can you run clinfo (if it is avaialable)?

If you do have the source checked out from trunk you can build cltest (cd into 
com.amd.aparapi.jni and then just 'ant cltest'), if you can run it and send me 
the output.  I need to know what OpenCL runtime version your machine is 
reporting. Also I need to know what devices are available. 

Gary   

Original comment by frost.g...@gmail.com on 21 Jan 2013 at 3:51

GoogleCodeExporter commented 9 years ago
As I stated I cannot recreate.  However, the crash was because 
OpenCLDevice.best() was returning NULL which was being passed to JNI and caused 
a segmentation violation.  This indicates that no GPU devices are available.  

I have checked in a guard against this which will fallback to JTP. However, the 
root cause is that Aparapi is not detecting a GPU device. 

If you can check usng clinfo (or cltest as described) above, I would be 
interested in the output of either.  

Original comment by frost.g...@gmail.com on 21 Jan 2013 at 9:41

GoogleCodeExporter commented 9 years ago
Pawlaktomek...  I added a Java/Aparapi sample app called 'info' which might 
help dignose this. I have checked into trunk/samples in SVN if you would like 
to try it it.  
I have also attached it to this post (in case you can't sync/build from SVN). 

Can you run the info.sh script in the contained ZIP (you may have to edit 
info.sh to point to your aparapi dir) it should list all available devices. 

This will help me/us diagnose. 

Original comment by frost.g...@gmail.com on 23 Jan 2013 at 3:29

Attachments:

GoogleCodeExporter commented 9 years ago
I ran the "info" script at the problematic machine, the output is following:

tpawlak@lab-ci-1:~/aparapi/info> ./info.sh
com.amd.aparapi.sample.info.Main
Machine contains 0 OpenCL platforms
OpenCLDevice.best() returned null!
OpenCLDevice.firstCPU() returned null!
OpenCLDevice.firstGPU() returned null!

Note that I have nvidia driver v304.64 installed:
tpawlak@lab-ci-1:~/aparapi/info> cat /proc/driver/nvidia/version
NVRM version: NVIDIA UNIX x86_64 Kernel Module  304.64  Tue Oct 30 10:58:20 PDT 
2012
GCC version:  gcc version 4.5.1 20101208 [gcc-4_5-branch revision 167585] (SUSE 
Linux)

Unfortunately there is no clinfo command on this system and I have no 
administrative rights on this machine to install it.

Note that I have rewritten my kernel to plain OpenCL and run it from Java using 
JavaCL 1.0.0-RC3 without problems. 

Original comment by pawlakto...@gmail.com on 23 Jan 2013 at 4:17

GoogleCodeExporter commented 9 years ago
clinfo is an AMD/ATI only application. NVIDIA does not make a nice utility like 
that.

If you download the Aparapi source code, there is another utility you can build 
for your native platform call 'cltest'. Are you able to build on your target 
platform?

Original comment by ryan.lam...@gmail.com on 24 Jan 2013 at 6:05

GoogleCodeExporter commented 9 years ago
The NVIDIA related crash has been resolved in the latest Aparapi build dated 
2013-01-23.

Original comment by ryan.lam...@gmail.com on 27 Jan 2013 at 9:21

GoogleCodeExporter commented 9 years ago

Original comment by ryan.lam...@gmail.com on 13 Feb 2013 at 4:26