Byte-Welt Forum

Zurück   Byte-Welt Forum > Projekte > Swogl / JCuda / JOCL > JCuda

Antwort
 
Themen-Optionen Thema durchsuchen
Alt 10.03.2010, 23:29   #1
Unregistered starter
Gast
 
Beiträge: n/a
Standard Link problems on Windows 7

Hi,

I'm trying to run the JCuda sample application. It compiles fine, but fails to link correctly:

>>>
Error while loading native library with base name "JCudaRuntime"
Operating system name: Windows 7
Architecture : x86
Architecture bit size: 32
Stack trace:
java.lang.UnsatisfiedLinkError: C:\Users\steve\Desktop\JCuda-All-0.2.3-bin-windows-x86_64\JCuda-All-0.2.3-bin-windows-x86_64\JCudaRuntime-windows-x86.dll: %1 ist keine zulässige Win32-Anwendung
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 jcuda.LibUtils.loadLibrary(LibUtils.java:53)
at jcuda.runtime.JCuda.assertInit(JCuda.java:227)
at jcuda.runtime.JCuda.initialize(JCuda.java:209)
at JCudaRuntimeSample.main(JCudaRuntimeSample.java:33 )
<<<

System in use: JAVA 6, 64-bit Windows 7 system

As far as I understand the error message, Windows 7 locates the respective JCudaRuntime-windows-x86.dll, but fails to load it.

Could someone explain why?


Kind regards,

Stefan
  Mit Zitat antworten
Alt 11.03.2010, 09:23   #2
Marco13
 
Registriert seit: 05.08.2008
Beiträge: 316
Marco13 befindet sich auf einem aufstrebenden Ast
Standard Re: Link problems on Windows 7

Hello Stefan,

According to the output
Code:
Architecture bit size: 32
Architecture : x86
you are most likely trying to run the example with a 32bit Java VM. (Although the error message seems unusual: When trying to load a 32bit DLL on a 64bit system, the error message should roughly be something like ~"Cannot load a IA-32 bit library on an AMD64 system"). Please make sure that you are using a 64bit JVM. Depending on your IDE and execution environment, this means that you should use the JRE/JDK that is located in "Program Files", and not the one that is located in "Program Files (x86)".

Hope that helps.
Marco13 ist offline   Mit Zitat antworten
Alt 13.03.2010, 01:19   #3
Unregistriert
Gast
 
Beiträge: n/a
Standard AW: Re: Link problems on Windows 7

Hello Marco,

Zitat:
Zitat von Marco13 Beitrag anzeigen

According to the output
Code:
Architecture bit size: 32
Architecture : x86
you are most likely trying to run the example with a 32bit Java VM.
Ah, interesting. Other Java apps run just fine. Eclipse itself launches as expected.

Doesn't Win7 launch the VM as 32bit or as 64bit process - depending on the architecture, the VM app was compiled for?

Zitat:
(Although the error message seems unusual: When trying to load a 32bit DLL on a 64bit system, the error message should roughly be something like ~"Cannot load a IA-32 bit library on an AMD64 system"). Please make sure that you are using a 64bit JVM. Depending on your IDE and execution environment, this means that you should use the JRE/JDK that is located in "Program Files", and not the one that is located in "Program Files (x86)".
Yes, somehow strange.
  Mit Zitat antworten
Alt 13.03.2010, 14:20   #4
Marco13
 
Registriert seit: 05.08.2008
Beiträge: 316
Marco13 befindet sich auf einem aufstrebenden Ast
Standard Re: Link problems on Windows 7

For Applications that no not use native DLLs there will be no problem. But the error message suggests that the JVM is a 32bit version (and I noticed that it's not an error due to compatibility problems: It tries to load the "JCudaRuntime-windows-x86.dll", which is not even contained in the binaries pacakage for Windows 64. It should try to load the "JCudaRuntime-windows-x86_64.dll" ...)

Have you tried to start it with a 64bit JVM? If you have a 64bit JVM installed, it should be possible to do something like the following in Eclipse:
Open the Run dialog for the Application -> Select the JRE Tab -> Select "Alternate JRE"
Click "Installed JREs" -> Click "Add" -> Click "Browse"
Browse to "Program Files\Java\jdkX.X.X\" (not to "Program Files (x86)"!)
Click "OK" -> Click "OK" -> Select the 64bit JRE in the Combo Box -> Click "Run"

It should then load the appropriate DLL.

If this still does not work: Which version of the CUDA driver and CUDA toolkit do you have installed? The binaries are compiled for CUDA 2.3...


EDIT: Doesn't Win7 launch the VM as 32bit or as 64bit process - depending on the architecture, the VM app was compiled for?

I'm not sure about the internal processes Windows 7 is using, but the version of the JVM certainly has to match the version of the DLLs that will be loaded...
Marco13 ist offline   Mit Zitat antworten
Alt 14.03.2010, 22:36   #5
Unregistered starter
Gast
 
Beiträge: n/a
Standard Re: Link problems on Windows 7

Zitat:
Zitat von Marco13 Beitrag anzeigen
For Applications that no not use native DLLs there will be no problem. But the error message suggests that the JVM is a 32bit version (and I noticed that it's not an error due to compatibility problems: It tries to load the "JCudaRuntime-windows-x86.dll", which is not even contained in the binaries pacakage for Windows 64. It should try to load the "JCudaRuntime-windows-x86_64.dll" ...)
Hm, my posting was misleading: Although the path-component indicated a 64bit release of JCuda, I in fact installed the 32bit and the 64bit releases of JCuda. Thus, the VM should have been able to load the required release.


Zitat:
Have you tried to start it with a 64bit JVM? If you have a 64bit JVM installed, it should be possible to do something like the following in Eclipse:
Open the Run dialog for the Application -> Select the JRE Tab -> Select "Alternate JRE"
Click "Installed JREs" -> Click "Add" -> Click "Browse"
Browse to "Program Files\Java\jdkX.X.X\" (not to "Program Files (x86)"!)
Click "OK" -> Click "OK" -> Select the 64bit JRE in the Combo Box -> Click "Run"
Thx! After my post, I installed the 64 bit JAVA (BETA) version for Windows 7. Additionally, I passed -D=64 to start the VM as 64bit version.

Et voilà, the source work as expected: JCublasSample.java performed 40x faster as a Core Quad using an NVidea GeForce 210.

Nice! Thank you, marco!
  Mit Zitat antworten
Antwort

Lesezeichen

Stichworte
-


Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)
 
Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche

Forumregeln
Es ist Ihnen erlaubt, neue Themen zu verfassen.
Es ist Ihnen erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.


Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
How to resolve performance issues and sporadic problems user_gs IDEs & Tools 3 27.04.2009 09:15
Java Link Base? Was ist das? L-ectron-X Java Link Base 5 09.09.2008 06:16
Link auf umgeleitete Site Xtian HTML / JavaScript / JScript / AJAX / JavaFX 2 16.10.2007 15:09
[Erledigt] Virtualler Server (D-Link Router) swerflash Software 4 06.05.2007 20:37


Alle Zeitangaben in WEZ +1. Es ist jetzt 01:55 Uhr.


Powered by vBulletin® Version 3.8.2 (Deutsch)
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.