Probably a long shot here but... :)
I managed to compile cgminer in Android and trying to run it in my SGS4 with opencl, and I had stumbled on a problem to run it. cgminer is an open source cryptocurrency miner that supports opengl for GPU accelerated mining. More about here: https://github.com/ckolivas/cgminer
Anyway-- running cgminer -n gives me:
[2013-09-13 12:07:15] CL Platform 0 vendor: QUALCOMM
[2013-09-13 12:07:15] CL Platform 0 name : Snapdragon(TM)
[2013-09-13 12:07:15] CL Platform 0 name : OpenCL 1.1 QUALCOMM build: (CL3579225)
Build Date: 04/22/13 Mon
Local Branch: adreno_sba_20130419
Remote Branch:
Local Patches:
Reconstruct Branch:
[2013-09-13 12:07:15] Platform 0 devices: 1
[2013-09-13 12:07:15] 0 QUALCOMM Adreno(TM)
[2013-09-13 12:07:15] 1 GPU devices max detected
Trying to run cgminer with the usual parameters (--scrypt -o <host:port> -u <username> -p <password>) gives me:
[2013-09-13 12:08:12] Started cgminer 3.1.1
[2013-09-13 12:08:12] Probing for an alive pool Assertion failed: !spillIs.empty() && "No spill intervals?", file vendor/qcom/proprietary/gles/adreno200/llvm/lib/CodeGen/QGPURegAlloc.cpp, line 2628
I compiled cgminer with libraries I found in OpenCL Adreno SDK, tried to use libOpenCL.so from the android NDK, from the Adreno SDK, and from my SGS4 itself when compiling, but same result. Thoughts?
Ok, got more progress. It seems the assertion fails in loading the source kernel (via clBuildProgram)
https://github.com/ckolivas/cgminer/blob/master/scrypt130511.cl
But I'm stuck in here since I don't know about this "spill interval" assertion-- well there's a lot of math in that source, so I'm assuming one of the functions are actually not supported?
The error message sounds like an issue within spill fill algorithm during register allocation. This is deep in the bowels of the openCL compiler. It may or may not be due to some intricacies of the kernel you are trying to compile.
I would say two things come to mind: try to fiddle with the kernel to reduce potential register pressure. It may or may not help, you might get a kernel that doesn't trigger this unlucky code path. Another thing is to file a bug report attaching this kernel as a test case. This might be a genuine compiler bug.
Got it-- trimming the kernel code is not something I had in mind, but I'll try and see what happens. Thanks.
A bit more progress, but it doesn't look promising.
I ran clinfo apk in my Galaxy S4 and see that the OpenCL property Compile Available : False on Adreno. Dreading the gut feeling, I found this link:
http://stackoverflow.com/questions/18527450/main-difference-between-open...
That means I cannot load the source and compile, correct? If so how can I compile the source externally and load the compiled source to the kernel?
Some devices, such as the Kindle Fire HDX, support compilation of kernels. I would be more than welcome if you were to send the compiled binary for me to test.