Future of Shiva, lack of future of OpenGTL

Cyrille Berger cberger at cberger.net
Sat Nov 30 08:35:17 UTC 2013


Hi,

I am writing about the future of Shiva. In short, I am going to 
discontinue OpenGTL, and most likely keep Shiva alive under some other 
form, meaning that I will remove the plugins from Krita today before 
tagging (and close the related bugs).

=== The end of OpenGTL

The main reason for abandoning OpenGTL is that it relies on llvm and 
that still requires quiet a high maintenance on the library as new 
version of llvm appear, and there are many incompatibilities (like with 
mesa open source driver). Also, now the CTL color spaces are gone, so 
Shiva was the remaining useful bit.

=== Here come ClOps

I am currently writing a (distributed) photo management and editing, 
targeted mainly at tablets, and when I was thinking about what 
technology to use for the editing part, I considered whether to use 
Shiva or not. Also, in recent years, other competing technologies have 
emerge, and at the time, I thought they would offer a much better 
solution, like OpenCL. If we compare Shiva vs OpenCL:

Shiva pro: full filter descriptions (from parameters to processing), 
high-end syntax
       con: tiny mindshare, high maintenance, only CPU
OpenCL pro: huge mindshare, CPU+GPU, wide spread industry standard
        con: only for the processing, low-end syntax

The first idea was for me to combine OpenCL with JavaScript/metadata 
(that I called ClOps) and you get a full filter description, that should 
be usable across devices and applications. In the end, except for a bit 
"low-end" syntax and the need for two programming languages, I thought I 
had come up with a pretty nice replacement for Shiva.
You can see some sample of ClOps here: 
https://bitbucket.org/cyrille/clops

=== Yes but OpenCL is not mobile

OpenCL is currently rather well supported on desktops, but what I failed 
to realize was that OpenCL has a very very very long way to go on 
portable devices, not just for technical reasons, but most often for 
political ones:
* Android: google is actively preventing OpenCL to be usable as an API 
[1], their intention is to push their own alternative called 
RenderScript, so even if some manufacturers would push OpenCL, it is 
unlikely to be widely usable
* iOS: Apple is a strong supporter of OpenCL, they have OpenCL has a 
private API, but they still have to announce plan on making at available 
to the public
* WinPhoneRTMetro: unlikely to be ever supported, MS is pushing its own 
API
* Mer: nothing official that I can see, but some desktop solution such 
as pocl might be portable
* Tizen: has some support for it

=== On the third day, Shiva came back

Since my main target is currently android, it does not look too good, 
for my plans. And other OSes are not doing much better. That is 
basically what resurrected Shiva. At that time the alternative was:

1) try to use OpenCL by compiling to native and then linking in some 
OpenCL runtime
2) write the same filter several times: C++, OpenCL and RenderScript
3) use shiva to convert C++, OpenCL or RenderScript

The first option would have been acceptable as a transition. But the 
ultimate goal is to run filters on the GPU, if it had been reasonable to 
hope that OpenCL would become available in the near future, that would 
have been a good option.
Second option is plainly unacceptable. That leave with only option 3).

The code is available in [2] (and soon a website in [3]). I have already 
done most of the work on the C++ backend, still have to test it though. 
OpenCL/RenderScript are planned, but I don't have concrete roadmap, I 
still have more important to fix on my application before putting those 
on the table.

=== Will Shiva be back in Krita ?

Most definitely. I don't have an explicit roadmap yet. I also haven't 
follow closely enough to know if you already have figured out a way to 
integrate OpenCL in Krita, but in any case, I would start with 
integrating the C++ backend first.

[1] 
http://www.anandtech.com/show/7191/android-43-update-for-nexus-10-and-4-removes-unofficial-opencl-drivers
[2] https://bitbucket.org/shivalang/shiva
[3] http://shiva-lang.org/

-- 
Cyrille Berger Skott


More information about the kimageshop mailing list