Login  Register

Re: JOCL on the ODROID-XU / Android

Posted by MichaelEGR on Oct 23, 2013; 3:34am
URL: https://forum.jogamp.org/JOCL-on-the-ODROID-XU-Android-tp4030220p4030331.html

Sven et al....

Thanks for taking a look at adding the Android libPVROCL.so loading... I got stuck though still in trying to print out basic OpenCL device info.

in my basic test execution hangs after "CLContext.create();"

Here is what is output in the logs:

3821-3844/? D/dalvikvm﹕ Trying to load lib /data/app-lib/com.egrsoftware.gridwalk-1/libgluegen-rt.so 0x4109c678
3821-3844/? D/dalvikvm﹕ Added shared lib /data/app-lib/com.egrsoftware.gridwalk-1/libgluegen-rt.so 0x4109c678
3821-3844/? D/dalvikvm﹕ No JNI_OnLoad found in /data/app-lib/com.egrsoftware.gridwalk-1/libgluegen-rt.so 0x4109c678, skipping init
3821-3844/? D/dalvikvm﹕ Trying to load lib /data/app-lib/com.egrsoftware.gridwalk-1/libjocl.so 0x4109c678
3821-3844/? D/dalvikvm﹕ Added shared lib /data/app-lib/com.egrsoftware.gridwalk-1/libjocl.so 0x4109c678
3821-3844/? E/IMGSRV﹕ :0: Invalid device type.

Execution halts after "Invalid device type"...

As things go I don't have visibility into the depths of JOCL yet and can't proceed with prepping the demos for tomorrows talk. It's a bummer not to have the CL demos running on the ODROID, but there is plenty to talk about. Hopefully the audience is receptive to the bleeding edge nature of OpenCL on Android. I basically hit my coding drop dead time, so now it's off to slide making... If possible though if you have any thoughts on what to attempt I'd be glad to take a look.

------------------------------------------

For folks using Android Studio here is how to setup the gradle.build file for including the JogAmp native libraries:

dependencies {
    compile files('libs/gluegen-rt.jar')
    compile files('libs/jogl.jar')
    compile files('libs/jocl.jar')
    compile files("$buildDir/native-libs/native-libs.jar")
}

task nativeLibsToJar(type: Zip) {
    destinationDir file("$buildDir/native-libs")
    baseName 'native-libs'
    extension 'jar'
    from fileTree(dir: 'libs', include: '**/*.so')
    into 'lib/'
}

tasks.withType(Compile) {
    compileTask -> compileTask.dependsOn(nativeLibsToJar)
}



-------------------

Put the Android native files in libs/armeabi

I validated that indeed the *.so files are included in the Android app build process and they are indeed found given the log output above.

I don't think jogl.jar and natives are necessary, but after I couldn't get things to work with just the gluegen and jocl native libraries I added them just in case.

-------------------

For anyone who is picking up the ODROID-XU be sure to sign up for the gpu-compute early access program from Imagination Tech:
http://www.imgtec.com/powervr/insider/gpu_compute/