Bug 978

Summary: JUnit tests all fail on Solaris
Product: [JogAmp] Jocl Reporter: Wade Walker <wwalker3>
Component: openclAssignee: Wade Walker <wwalker3>
Status: RESOLVED FIXED    
Severity: normal CC: sgothel
Priority: ---    
Version: 1   
Hardware: All   
OS: solaris   
Type: --- SCM Refs:
6ec10ee5e782da5d7ad88e93ee017925de85c37f a503ff720300362e68fd2868f2e87d731492bc46 c720767642618cfb4f3739dc6962cde0465e25c5 5003123575355ff088c7b2e4e9017056e9edbf5c
Workaround: ---

Description Wade Walker 2014-02-17 20:47:35 CET
Most tests fail with:

java.lang.ExceptionInInitializerError
	at com.jogamp.opencl.CLPlatform.initialize(CLPlatform.java:165)
	at com.jogamp.opencl.CLPlatform.initialize(CLPlatform.java:141)
	at com.jogamp.opencl.CLPlatform.listCLPlatforms(CLPlatform.java:223)
	at com.jogamp.opencl.CLPlatform.getDefault(CLPlatform.java:191)
	at com.jogamp.opencl.gl.CLGLTest.createContextTest(CLGLTest.java:113)
Caused by: java.lang.RuntimeException: Couln't load native CL/JNI glue library
	at com.jogamp.opencl.llb.impl.CLAbstractImpl$1.run(CLAbstractImpl.java:1822)
	at com.jogamp.opencl.llb.impl.CLAbstractImpl$1.run(CLAbstractImpl.java:1812)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.jogamp.opencl.llb.impl.CLAbstractImpl.<clinit>(CLAbstractImpl.java:1812)

And even the tests that appear to pass, like com.jogamp.opencl.JoclVersion, are failing with the same error, it's just not getting sensed by the test framework.
Comment 1 Wade Walker 2014-02-20 02:39:00 CET
Working on this now; got Solaris 11 x64 installed with an nvidia card, should duplicate this bug shortly.
Comment 2 Sven Gothel 2014-02-22 08:18:25 CET
(In reply to comment #1)
> Working on this now; got Solaris 11 x64 installed with an nvidia card,
> should duplicate this bug shortly.

I could not find an opencl driver .. i.e. NV's driver seems not to provide one.
Comment 3 Wade Walker 2014-02-22 18:57:25 CET
I've confirmed that there's no OpenCL driver in the latest nvidia drivers for Solaris. Unzipping the driver package (which will only unzip properly on Solaris BTW) shows that there's no libOpenCL.so in the Solaris package, even though there is in the Linux package.

So, shall we disable the OpenCL tests on Solaris? This will remove 64 failures from the test suite :)

How should we do this disablement? Is there some script modification you have to make on the build server, or should I change the Ant script so the JUnit tests don't run on Solaris?
Comment 4 Sven Gothel 2014-02-23 00:39:44 CET
(In reply to comment #3)
> I've confirmed that there's no OpenCL driver in the latest nvidia drivers
> for Solaris. Unzipping the driver package (which will only unzip properly on
> Solaris BTW) shows that there's no libOpenCL.so in the Solaris package, even
> though there is in the Linux package.
> 
> So, shall we disable the OpenCL tests on Solaris? This will remove 64
> failures from the test suite :)
> 
> How should we do this disablement? Is there some script modification you
> have to make on the build server, or should I change the Ant script so the
> JUnit tests don't run on Solaris?

I thought we might change CLPlatform in a way to behave more graceful
than this 'not initialized' exception ?

E.g. one could add a flag in it's private initialize method to flag non availability,
when then could be queried (add a isAvailable(???))  method similar to GLProfile ?

Then the unit tests could query and exit nicely ..

~Sven
Comment 5 Sven Gothel 2014-02-23 00:43:23 CET
(In reply to comment #4)
> 
> E.g. one could add a flag in it's private initialize method to flag non
> availability,
> when then could be queried (add a isAvailable(???))  method similar to
> GLProfile ?

  'public static CLPlatform[] listCLPlatforms(Filter<CLPlatform>... filter)'

i.e. adding the following accordingly: 

  'public static boolean isAvailable(Filter<CLPlatform>... filter)'
  'public static boolean isAvailable()'

?
Comment 6 Wade Walker 2014-02-23 18:37:51 CET
The isAvailable() function sounds like a good approach, I'll give it a try. I'll also put some check in the tests that the unavailability is occurring on Solaris. Otherwise tests on any platform could appear to pass without actually running if something went wrong deep in our framework.
Comment 7 Wade Walker 2014-02-24 01:45:13 CET
I've got a branch for this at https://github.com/WadeWalker/jocl/tree/bug_978_fix_solaris_tests. It works on Windows, but I still need to test it on Linux and Solaris, then after that I'll push it up assuming you don't see any problems.
Comment 8 Wade Walker 2014-02-25 02:48:30 CET
Merged in the fix after testing successfully on Mac OS X, Windows 7, Ubuntu 12.04, and Oracle Solaris 11.
Comment 9 Sven Gothel 2014-05-11 03:24:37 CEST
commit a503ff720300362e68fd2868f2e87d731492bc46:
  Promote whether a test shall fail due to unavailable CL driver in base UITest class
Comment 10 Sven Gothel 2014-09-03 03:26:08 CEST
Testing also on platform/nodes w/o OpenCL implementation,
but where general availability exists with other drivers.

Here: Replacing AMD proprietary driver w/ free software.

+++

c720767642618cfb4f3739dc6962cde0465e25c5
 - Promote CLAbstractImpl.isAvailable() to CLPlatform, public API.
    
 - CLAbstractImpl.isAvailable() simply shall return true 
   if JOCL/OpenCL libs could be loaded.


5003123575355ff088c7b2e4e9017056e9edbf5c

  UITestCase shall only report 'not available on this machine'.
  Giving the OS type leads to misconception that is may not be available 
  on all machines of this OS type.