tigerneil / aparapi

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

Can't run GPU mode of Aparapi samples in Eclipse #97

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi guys,

I noticed this kind of issue has been posted somewhere else but it doesn't help 
when I tried to follow the suggested steps.
My issue is I try to run Aparapi samples on Eclipse in GPU mode, it always runs 
in JTP mode. I got this message:

Check your environment. Failed to load aparapi native library aparapi_x86_64 or 
possibly failed to locate opencl native library (opencl.dll/opencl.so). Ensure 
that both are in your PATH (windows) or in LD_LIBRARY_PATH (linux)."
Execution mode=JTP

I downloaded Aparapi_2013_01_23_windows_x86.zip
I using AMD Radeon HD 7970 graphic card.
I have installed AMD-APP-SDK v2.8-Windows-64, OpenCL 1.2

Both java and system are 64-bit
"java version "1.7.0_17"
Java(TM) SE Runtime Environment (build 1.7.0_17-b02)
Java HotSpot(TM) 64-Bit Server VM (build 23.7-b01, mixed mode)"

Here comes the info when I run clinfo.exe and GPU Caps Viewer (files attached)

I set the system variables:
PATH = C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program Files (x86)\AMD 
APP\lib\x86_64;C:\Users\phapntp\Desktop\Aparapi_2013_01_23_windows_x86
where 
C:\Program Files (x86)\AMD APP\bin\x86_64 locates OpenCL.dll
C:\Program Files (x86)\AMD APP\lib\x86_64 locates OpenCL.so
C:\Users\phapntp\Desktop\Aparapi_2013_01_23_windows_x86 locates aparapi_x86.dll

For the project configuration in Eclipse, I also added 
-Djava.library.path=C:\Users\phapntp\Desktop\Aparapi_2013_01_23_windows_x86    
to VM arguments
PATH = C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program Files (x86)\AMD 
APP\lib\x86_64;C:\Users\phapntp\Desktop\Aparapi_2013_01_23_windows_x86   to 
Environment

It still doesn't work, frustrating!!!

Do you have any idea how to fix this issue? Thanks much.

Original issue reported on code.google.com by pnt...@gmail.com on 7 Mar 2013 at 9:49

Attachments:

GoogleCodeExporter commented 8 years ago
In eclipse you need to add the following to the vm options of run configuration 
for the app you are trying to run. 

-Djava.library.path=C:\Users\phapntp\Desktop\Aparapi_2013_01_23_windows_x86

Under eclipse your PATH (and I suspect LD_LIBRARY_PATH) probably depends on how 
eclipse launches the JVM to run the app.

So the above method is what we use in the example <EXAMPLE>.bat files to run 
the samples. 

So generally we run using

java -Djava.library.path=<path to dir containing aparapi_x86_64.dll> -classpath 
<path to aparapi>/aparapi.jar;yourJar yourpackage.YourClass

Gary

Original comment by frost.g...@gmail.com on 7 Mar 2013 at 2:13

GoogleCodeExporter commented 8 years ago
Hi Gary,

As mentioned in my issue description, I already added
-Djava.library.path=C:\Users\phapntp\Desktop\Aparapi_2013_01_23_windows_x86
to VM arguments in the run configuration.

I forgot to mention that just to be careful, I also set the system variable:
LD_LIBRARY_PATH = C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program Files 
(x86)\AMD APP\lib\x86_64

But it still doesn't work.
Did I miss something else?

Thanks much.
Caroline

Original comment by pnt...@gmail.com on 7 Mar 2013 at 2:30

GoogleCodeExporter commented 8 years ago
Sorry Caroline, I did indeed miss that. 

You won't need LD_LIBRARY_PATH for Windows..

Oh wait what JVM are you using 64 bit or 32 bit?  I note that you have 64 bit 
Windows but you downloaded 32 bit (x86) aparapi.  

If you type java -version from the command line it should report the JVM 
version.  Including whether it is x86 (i385/486 or something) or 64 bit. 

Your Aparapi version must match the JVM version (bitness).  

As far as I understand the 64 bit JVM can't load 32 bit dlls

You might download the x86_64 version of aparapi.

Gary

Original comment by frost.g...@gmail.com on 7 Mar 2013 at 2:35

GoogleCodeExporter commented 8 years ago
Hi Gary,

Both my JVM and system are 64-bit
"java version "1.7.0_17"
Java(TM) SE Runtime Environment (build 1.7.0_17-b02)
Java HotSpot(TM) 64-Bit Server VM (build 23.7-b01, mixed mode)"

You are right, I get Aparapi_2013_01_23_windows_x86_64 and it works now.

Thanks much for your help.

Caroline

Original comment by pnt...@gmail.com on 8 Mar 2013 at 9:47

GoogleCodeExporter commented 8 years ago

Original comment by ryan.lam...@gmail.com on 12 Mar 2013 at 3:42