I have wrote some cg examples using jogl_cg, they work well on 32-bit system of windows 7, but they can't work on the 64-bit system. And it always throw RuntimeException: Couln't load native Cg or CgGL library, at com.jogamp.opengl.cg.CgGL.<clinit>(CgGL.java:6581). Both of the two computers have same video card(GT750ti) and have installed Cg library. I don't kown why. Sorry my bad English.
|
Administrator
|
Hi
Which version of JOGL do you use? Please post the full stack trace.
Julien Gouesse | Personal blog | Website
|
I use the latest version of jogl. I enable the debug of NativeLibray through the System.setProperty("jogamp.debug.NativeLibrary", "true");
The printed logs: NativeLibrary.findLibrary(<java>, sun.misc.Launcher$AppClassLoader@2512b853) (CL): null NativeLibrary.findLibrary(<gluegen-rt>) (TempJarCache): C:\Users\ADMINI~1\AppData\Local\Temp\jogamp_0000\file_cache\jln8479201088581787533\jln8027402158686852717\gluegen-rt.dll Thread-0 - DynamicLibraryBundle.init start with: com.jogamp.opengl.cg.CgDynamicLibraryBundleInfo NativeLibrary.findLibrary(<Cg>) (TempJarCache): null NativeLibrary.findLibrary(<Cg>, sun.misc.Launcher$AppClassLoader@2512b853) (CL): null NativeLibrary.open(global true): Trying to load Cg.dll LoadLibraryW "Cg.dll" failed, error code: 0x0, 0 NativeLibrary.open: Last error Last error: 0x0 (0) NativeLibrary.open(global true): Trying to load C:\Program Files\Java\jre7\bin\Cg.dll LoadLibraryW "C:\Program Files\Java\jre7\bin\Cg.dll" failed, error code: 0x7e, 126 NativeLibrary.open: Last error Last error: 0x7e (126) NativeLibrary.open(global true): Trying to load C:\Program Files\Java\jre7\bin\Cg.dll LoadLibraryW "C:\Program Files\Java\jre7\bin\Cg.dll" failed, error code: 0x7e, 126 NativeLibrary.open: Last error Last error: 0x7e (126) NativeLibrary.open(global true): Trying to load C:\Windows\Sun\Java\bin\Cg.dll LoadLibraryW "C:\Windows\Sun\Java\bin\Cg.dll" failed, error code: 0x7e, 126 NativeLibrary.open: Last error Last error: 0x7e (126) NativeLibrary.open(global true): Trying to load C:\Windows\system32\Cg.dll LoadLibraryW "C:\Windows\system32\Cg.dll" failed, error code: 0x7e, 126 NativeLibrary.open: Last error Last error: 0x7e (126) NativeLibrary.open(global true): Trying to load C:\Windows\Cg.dll LoadLibraryW "C:\Windows\Cg.dll" failed, error code: 0x7e, 126 NativeLibrary.open: Last error Last error: 0x0 (0) NativeLibrary.open(global true): Trying to load C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common\Cg.dll LoadLibraryW "C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common\Cg.dll" failed, error code: 0x7e, 126 NativeLibrary.open: Last error Last error: 0x7e (126) NativeLibrary.open(global true): Trying to load C:\Program Files (x86)\Intel\iCLS Client\\Cg.dll LoadLibraryW "C:\Program Files (x86)\Intel\iCLS Client\\Cg.dll" failed, error code: 0x7e, 126 NativeLibrary.open: Last error Last error: 0x7e (126) NativeLibrary.open(global true): Trying to load C:\Program Files\Intel\iCLS Client\\Cg.dll LoadLibraryW "C:\Program Files\Intel\iCLS Client\\Cg.dll" failed, error code: 0x7e, 126 NativeLibrary.open: Last error Last error: 0x7e (126) NativeLibrary.open(global true): Trying to load C:\Windows\system32\Cg.dll LoadLibraryW "C:\Windows\system32\Cg.dll" failed, error code: 0x7e, 126 NativeLibrary.open: Last error Last error: 0x7e (126) NativeLibrary.open(global true): Trying to load C:\Windows\Cg.dll LoadLibraryW "C:\Windows\Cg.dll" failed, error code: 0x7e, 126 NativeLibrary.open: Last error Last error: 0x7e (126) NativeLibrary.open(global true): Trying to load C:\Windows\System32\Wbem\Cg.dll LoadLibraryW "C:\Windows\System32\Wbem\Cg.dll" failed, error code: 0x7e, 126 NativeLibrary.open: Last error Last error: 0x7e (126) NativeLibrary.open(global true): Trying to load C:\Windows\System32\WindowsPowerShell\v1.0\\Cg.dll LoadLibraryW "C:\Windows\System32\WindowsPowerShell\v1.0\\Cg.dll" failed, error code: 0x7e, 126 NativeLibrary.open: Last error Last error: 0x7e (126) NativeLibrary.open(global true): Trying to load C:\Program Files\Intel\Intel(R) Management Engine Components\DAL\Cg.dll LoadLibraryW "C:\Program Files\Intel\Intel(R) Management Engine Components\DAL\Cg.dll" failed, error code: 0x7e, 126 NativeLibrary.open: Last error Last error: 0x7e (126) NativeLibrary.open(global true): Trying to load C:\Program Files\Intel\Intel(R) Management Engine Components\IPT\Cg.dll LoadLibraryW "C:\Program Files\Intel\Intel(R) Management Engine Components\IPT\Cg.dll" failed, error code: 0x7e, 126 NativeLibrary.open: Last error Last error: 0x7e (126) NativeLibrary.open(global true): Trying to load C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL\Cg.dll LoadLibraryW "C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL\Cg.dll" failed, error code: 0x7e, 126 NativeLibrary.open: Last error Last error: 0x7e (126) NativeLibrary.open(global true): Trying to load C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT\Cg.dll LoadLibraryW "C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT\Cg.dll" failed, error code: 0x7e, 126 NativeLibrary.open: Last error Last error: 0x7e (126) NativeLibrary.open(global true): Trying to load C:\Program Files (x86)\Common Files\microsoft shared\TigerKin\Cg.dll LoadLibraryW "C:\Program Files (x86)\Common Files\microsoft shared\TigerKin\Cg.dll" failed, error code: 0x7e, 126 NativeLibrary.open: Last error Last error: 0x7e (126) NativeLibrary.open(global true): Trying to load C:\Program Files (x86)\Windows Kits\8.0\Windows Performance Toolkit\\Cg.dll LoadLibraryW "C:\Program Files (x86)\Windows Kits\8.0\Windows Performance Toolkit\\Cg.dll" failed, error code: 0x7e, 126 NativeLibrary.open: Last error Last error: 0x7e (126) NativeLibrary.open(global true): Trying to load C:\Program Files\Microsoft SQL Server\110\Tools\Binn\\Cg.dll LoadLibraryW "C:\Program Files\Microsoft SQL Server\110\Tools\Binn\\Cg.dll" failed, error code: 0x7e, 126 NativeLibrary.open: Last error Last error: 0x7e (126) NativeLibrary.open(global true): Trying to load C:\Program Files (x86)\NVIDIA Corporation\Cg\bin\Cg.dll LoadLibraryW "C:\Program Files (x86)\NVIDIA Corporation\Cg\bin\Cg.dll" failed, error code: 0xc1, 193 NativeLibrary.open: Last error Last error: 0x0 (0) NativeLibrary.open(global true): Trying to load C:\Program Files (x86)\NVIDIA Corporation\Cg\bin.x64\Cg.dll LoadLibraryW "C:\Program Files (x86)\NVIDIA Corporation\Cg\bin.x64\Cg.dll" failed, error code: 0x7e, 126 NativeLibrary.open: Last error Last error: 0x0 (0) NativeLibrary.open(global true): Trying to load C:\Program Files\TortoiseHg\\Cg.dll LoadLibraryW "C:\Program Files\TortoiseHg\\Cg.dll" failed, error code: 0x7e, 126 NativeLibrary.open: Last error Last error: 0x0 (0) NativeLibrary.open(global true): Trying to load C:\Program Files (x86)\CMake\bin\Cg.dll LoadLibraryW "C:\Program Files (x86)\CMake\bin\Cg.dll" failed, error code: 0x7e, 126 NativeLibrary.open: Last error Last error: 0x0 (0) NativeLibrary.open(global true): Trying to load .\Cg.dll LoadLibraryW ".\Cg.dll" failed, error code: 0xc1, 193 NativeLibrary.open: Last error Last error: 0x0 (0) NativeLibrary.open(global true): Trying to load E:\workspace\hg\java\lwjgl\Cg.dll LoadLibraryW "E:\workspace\hg\java\lwjgl\Cg.dll" failed, error code: 0xc1, 193 NativeLibrary.open: Last error Last error: 0x0 (0) NativeLibrary.open(global true): Did not succeed in loading (Cg, Cg, Cg) Unable to load any Tool library of: [Cg] NativeLibrary.findLibrary(<CgGL>) (TempJarCache): null NativeLibrary.findLibrary(<CgGL>, sun.misc.Launcher$AppClassLoader@2512b853) (CL): null NativeLibrary.open(global true): Trying to load CgGL.dll LoadLibraryW "CgGL.dll" failed, error code: 0xc1, 193 NativeLibrary.open: Last error Last error: 0x0 (0) NativeLibrary.open(global true): Trying to load C:\Program Files\Java\jre7\bin\CgGL.dll LoadLibraryW "C:\Program Files\Java\jre7\bin\CgGL.dll" failed, error code: 0x7e, 126 NativeLibrary.open: Last error Last error: 0x0 (0) NativeLibrary.open(global true): Trying to load C:\Program Files\Java\jre7\bin\CgGL.dll LoadLibraryW "C:\Program Files\Java\jre7\bin\CgGL.dll" failed, error code: 0x7e, 126 NativeLibrary.open: Last error Last error: 0x0 (0) NativeLibrary.open(global true): Trying to load C:\Windows\Sun\Java\bin\CgGL.dll LoadLibraryW "C:\Windows\Sun\Java\bin\CgGL.dll" failed, error code: 0x7e, 126 NativeLibrary.open: Last error Last error: 0x0 (0) NativeLibrary.open(global true): Trying to load C:\Windows\system32\CgGL.dll LoadLibraryW "C:\Windows\system32\CgGL.dll" failed, error code: 0x7e, 126 NativeLibrary.open: Last error Last error: 0x0 (0) NativeLibrary.open(global true): Trying to load C:\Windows\CgGL.dll LoadLibraryW "C:\Windows\CgGL.dll" failed, error code: 0x7e, 126 NativeLibrary.open: Last error Last error: 0x0 (0) NativeLibrary.open(global true): Trying to load C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common\CgGL.dll LoadLibraryW "C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common\CgGL.dll" failed, error code: 0x7e, 126 NativeLibrary.open: Last error Last error: 0x0 (0) NativeLibrary.open(global true): Trying to load C:\Program Files (x86)\Intel\iCLS Client\\CgGL.dll LoadLibraryW "C:\Program Files (x86)\Intel\iCLS Client\\CgGL.dll" failed, error code: 0x7e, 126 NativeLibrary.open: Last error Last error: 0x0 (0) NativeLibrary.open(global true): Trying to load C:\Program Files\Intel\iCLS Client\\CgGL.dll LoadLibraryW "C:\Program Files\Intel\iCLS Client\\CgGL.dll" failed, error code: 0x7e, 126 NativeLibrary.open: Last error Last error: 0x0 (0) NativeLibrary.open(global true): Trying to load C:\Windows\system32\CgGL.dll LoadLibraryW "C:\Windows\system32\CgGL.dll" failed, error code: 0x7e, 126 NativeLibrary.open: Last error Last error: 0x0 (0) NativeLibrary.open(global true): Trying to load C:\Windows\CgGL.dll LoadLibraryW "C:\Windows\CgGL.dll" failed, error code: 0x7e, 126 NativeLibrary.open: Last error Last error: 0x0 (0) NativeLibrary.open(global true): Trying to load C:\Windows\System32\Wbem\CgGL.dll LoadLibraryW "C:\Windows\System32\Wbem\CgGL.dll" failed, error code: 0x7e, 126 NativeLibrary.open: Last error Last error: 0x0 (0) NativeLibrary.open(global true): Trying to load C:\Windows\System32\WindowsPowerShell\v1.0\\CgGL.dll LoadLibraryW "C:\Windows\System32\WindowsPowerShell\v1.0\\CgGL.dll" failed, error code: 0x7e, 126 NativeLibrary.open: Last error Last error: 0x0 (0) NativeLibrary.open(global true): Trying to load C:\Program Files\Intel\Intel(R) Management Engine Components\DAL\CgGL.dll LoadLibraryW "C:\Program Files\Intel\Intel(R) Management Engine Components\DAL\CgGL.dll" failed, error code: 0x7e, 126 NativeLibrary.open: Last error Last error: 0x0 (0) NativeLibrary.open(global true): Trying to load C:\Program Files\Intel\Intel(R) Management Engine Components\IPT\CgGL.dll LoadLibraryW "C:\Program Files\Intel\Intel(R) Management Engine Components\IPT\CgGL.dll" failed, error code: 0x7e, 126 NativeLibrary.open: Last error Last error: 0x0 (0) NativeLibrary.open(global true): Trying to load C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL\CgGL.dll LoadLibraryW "C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL\CgGL.dll" failed, error code: 0x7e, 126 NativeLibrary.open: Last error Last error: 0x0 (0) NativeLibrary.open(global true): Trying to load C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT\CgGL.dll LoadLibraryW "C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT\CgGL.dll" failed, error code: 0x7e, 126 NativeLibrary.open: Last error Last error: 0x0 (0) NativeLibrary.open(global true): Trying to load C:\Program Files (x86)\Common Files\microsoft shared\TigerKin\CgGL.dll LoadLibraryW "C:\Program Files (x86)\Common Files\microsoft shared\TigerKin\CgGL.dll" failed, error code: 0x7e, 126 NativeLibrary.open: Last error Last error: 0x0 (0) NativeLibrary.open(global true): Trying to load C:\Program Files (x86)\Windows Kits\8.0\Windows Performance Toolkit\\CgGL.dll LoadLibraryW "C:\Program Files (x86)\Windows Kits\8.0\Windows Performance Toolkit\\CgGL.dll" failed, error code: 0x7e, 126 NativeLibrary.open: Last error Last error: 0x0 (0) NativeLibrary.open(global true): Trying to load C:\Program Files\Microsoft SQL Server\110\Tools\Binn\\CgGL.dll LoadLibraryW "C:\Program Files\Microsoft SQL Server\110\Tools\Binn\\CgGL.dll" failed, error code: 0x7e, 126 NativeLibrary.open: Last error Last error: 0x0 (0) NativeLibrary.open(global true): Trying to load C:\Program Files (x86)\NVIDIA Corporation\Cg\bin\CgGL.dll LoadLibraryW "C:\Program Files (x86)\NVIDIA Corporation\Cg\bin\CgGL.dll" failed, error code: 0xc1, 193 NativeLibrary.open: Last error Last error: 0x0 (0) NativeLibrary.open(global true): Trying to load C:\Program Files (x86)\NVIDIA Corporation\Cg\bin.x64\CgGL.dll LoadLibraryW "C:\Program Files (x86)\NVIDIA Corporation\Cg\bin.x64\CgGL.dll" failed, error code: 0x7e, 126 NativeLibrary.open: Last error Last error: 0x0 (0) NativeLibrary.open(global true): Trying to load C:\Program Files\TortoiseHg\\CgGL.dll LoadLibraryW "C:\Program Files\TortoiseHg\\CgGL.dll" failed, error code: 0x7e, 126 NativeLibrary.open: Last error Last error: 0x0 (0) NativeLibrary.open(global true): Trying to load C:\Program Files (x86)\CMake\bin\CgGL.dll LoadLibraryW "C:\Program Files (x86)\CMake\bin\CgGL.dll" failed, error code: 0x7e, 126 NativeLibrary.open: Last error Last error: 0x0 (0) NativeLibrary.open(global true): Trying to load .\CgGL.dll LoadLibraryW ".\CgGL.dll" failed, error code: 0xc1, 193 NativeLibrary.open: Last error Last error: 0x0 (0) NativeLibrary.open(global true): Trying to load E:\workspace\hg\java\lwjgl\CgGL.dll LoadLibraryW "E:\workspace\hg\java\lwjgl\CgGL.dll" failed, error code: 0xc1, 193 NativeLibrary.open: Last error Last error: 0x0 (0) NativeLibrary.open(global true): Did not succeed in loading (CgGL, CgGL, CgGL) Unable to load any Tool library of: [CgGL] No Tool libraries loaded DynamicLibraryBundle.init Summary: com.jogamp.opengl.cg.CgDynamicLibraryBundleInfo toolGetProcAddressFuncNameList: null, complete: true, 0x0 Tool Lib Names : [[Cg], [CgGL]] Tool Lib Loaded: 0/2 [false, false], complete false Glue Lib Names : [jogl_cg] Glue Lib Loaded: 0/1 [false], complete false All Complete: false LibLoaderExecutor: com.jogamp.common.util.RunnableExecutor$CurrentThreadExecutor Exception in thread "Thread-0" java.lang.ExceptionInInitializerError at jet.learning.opengl.test.cg.FragmentLighting10.onCreate(FragmentLighting10.java:62) at jet.learning.opengl.framework.Framework.run(Framework.java:214) Caused by: java.lang.RuntimeException: Couln't load native Cg or CgGL library at com.jogamp.opengl.cg.CgGL.<clinit>(CgGL.java:6581) ... 2 more |
Administrator
|
Please check whether the required native libraries are in the JARs containing the native libraries whose names contain "-natives-".
Julien Gouesse | Personal blog | Website
|
Not that, I have included all the native libraries in my project.
Maybe I found the reason why it can't load the cg.dll or cggl.dll. I tried to load cg.dll directly using the "System.load("Cg.dll")" method, and then the jvm throw a UnsatisfiedLinkError: Can't load IA 32-bit .dll on a AMD 64-bit platform. It means the Cg.dll is 32-bit dll that can't load into the 64-bit jvm. So I have to run cg code on 32-bit machine. Am I right? |
Administrator
|
A 32-bit JVM on a 64-bit machine requires 32-bit binaries. A 64-bit JVM requires 64-bit binaries. You're wrong, you have to use the 64-bit binaries instead of the 32-bit binaries. You shouldn't have to load the native libraries by yourself. Use the JARs containing the native libraries or set the Java library path. I advise you to read this part of our user guide:
http://jogamp.org/jogl/doc/userguide/#automatednativelibraryloading http://jogamp.org/jogl/doc/userguide/#traditionallibraryloading Edit.: Let us know whether it works. There is nobody to maintain the Cg support of JOGL.
Julien Gouesse | Personal blog | Website
|
Thanks for your help. I think I know how to do it. Thanks.
|
Administrator
|
You're welcome. I have looked at the Ant scripts, CG native libraries seem to be excluded from jogl-all-natives-*.jar:
https://github.com/sgothel/jogl/blob/master/make/build.xml#L180 You need jogl-cg-natives-*.jar to make CG work. You might have to remove any conflicting DLL installed by another library.
Julien Gouesse | Personal blog | Website
|
I had already contained the jogl-cg-natives-windows-amd64.jar and jogl-cg-natives-windows-i586.jar. The main problem is that the 64-bit jvm couldn't load the 32-bit Cg.dll library, and the Navidia doesn't provide any 64-bit cg.dll or cggl.dll for windows. When I call the cg native functions throw the jogl libraries, the first thing that jogl will to do is to load the gluegen-rt.dll into jvm, if this step success, it will load the Cg.dll and CgGL.dll, and finally load the jogl_cg.dll. Because my jvm is 64-bit, it needs 64-bit Cg libraries, they aren't match, so it would failed in the half way. So it nothing to do with the jogl-cg-natives-*.jar.
The only way to run the cg code through the jogl on 64-bit windows system is to use the 32-bit jvm instead of the 64-bit jvm. I hope you to check whether the jogl-cg code can work on 64-bit windows system. |
Administrator
|
You can use the option "-d32" to run the 64-bit JVM in a 32-bit environment so that you don't need a 32-bit JVM. I'm not sure that it works but you can give it a try.
The JOGL CG code should work but as I wrote, it's unmaintained :s
Julien Gouesse | Personal blog | Website
|
Free forum by Nabble | Edit this page |