June 1, 2009
Before anything else, I just would like to say that GSoC is awesome! Sure, I still would’ve joined the free software movement without this program, but you have to admit that it is such a fantastic annual event for lots of different reasons that I, and many like me, couldn’t have jumped on the bandwagon this early if not for GSoC.
You see, I’m torn between academic pressures and conservative people who think that free software is either a cult hype or something that doesn’t make business sense. It’s nice to just say that, “Yes, I am a free software developer and my salary is higher than yours! Hah!” Now, really, I can’t just say that because:
- I care for some of them,
- I don’t for most of them, and
- I am not a free software developer (yet).
So yeah, kudos to Google and the free software organizations who made this possible. Especially to those people, Google employees or otherwise, who spent/are spending their time answering our stupid and (sometimes) paranoid questions on the mailing lists and IRC. I need not mention your names, you know who you are.
GIMP’s Knight in Shining Armor: GEGL
It has always been known that GIMP is not feature-complete for *all* workflows and use cases. (In fact, one could say that the same is true for most applications. People just looove to complain, nevertheless. :p) Some users get frustrated when they request for certain features only to discover that most of them are either planned (but aren’t implemented yet) or will never be implemented.
One such awaited feature is support for higher bit-depth images. This and many other limitations have magnified GIMP’s somehow notorious reputation of not being suitable for certain workflows. For certain other workflows, however, GIMP does pretty well. I should know because I have used GIMP as a web-graphics artist before.
As an effort to address many of these limitations, the GIMP developers started hacking on a new graphics core that would support the desired features on the get-go. Thereby, dodging ugly and misplaced refractorings that would otherwise make GIMP unstable. To help with the latter purpose, the aforementioned graphics core, GEGL, was developed as a separate library.
Now, sometime around late 2006, GEGL was deemed stable enough to be actually usable. Starting with GIMP 2.6, the developers started integrating GEGL into GIMP.
As I have said in the previous post, my GSoC has something to do with GIMP and its new graphics core, GEGL. To expound on that, my work won’t really touch any parts of the GIMP’s sources. Rather, I would be adding features to GEGL. However, since GIMP will rely heavily on GEGL to do most of the graphics tasks, GIMP users will also experience the benefits of my project.
General-Purpose Computing on Graphics Processing Units
Otherwise known as GPGPU (don’t ask me what happened to the ‘c’ in computing, I don’t know :). GPGPU is an ongoing trend to utilize the GPU (Graphics Processing Unit, found on modern video cards) for general computing. This is an interesting notion because none of this utilization can be automated (well, not yet at least). Meaning, that because the GPU is so specialized, you can’t just write code that runs on the CPU and expect the same code to run on the GPU as well. Also, not all applications can be rewritten to use the GPU; only a subset of the programming problems will fit to GPGPU.
These are the reasons why applications that want to take advantage of GPGPU techniques must be rewritten manually to explicitly use the GPU. Communication to the GPU is done through specialized libraries (or APIs) that expose the GPU’s features. One such well-known library is OpenGL.
OpenGL was created to allow games to talk directly to the GPU and render mind-blowing, very distracting (for me at least) images and animations on screen. Because of GPGPU, OpenGL is now used to program heavy mathematical calculations.
You might ask; why can’t we just develop and use specialized libraries for GPGPU? Well, in fact, we already have such libraries existing. But they’re either proprietary (e.g. NVIDIA’s CUDA, ATI’s CTM) or too young (e.g. OpenCL). Because of this, we have chosen to use OpenGL for its wealth of references, GPGPU or otherwise, on the internet and the stability of OpenGL implementations.
Stop beating around the bushes!
All right, you don’t need to be so harsh… :)
My task involves modifying GEGL to use GPGPU. That is, to modify GEGL to support doing pixel operations like blur, brighten, etc. on the GPU in addition to their existing CPU implementations. To accomplish this, I have to:
- modify the existing GEGL buffering mechanism to somehow make use of OpenGL textures, and
- implement some pixel operations to expect OpenGL textures instead of pixels from main memory.
It’s that simple, really. But so far, I’m not quite sure if it’s that easy when we get to the nitty-gritty parts. We’ll discuss about the issues in later posts.
The advantages of using the GPU is easy to see when you learn that typical video cards are heavily parallel; a NVIDIA GeForce 8600GT card has about 32 cores and an ATI HD4890 card has about 800 cores!1 This is in stark contrast to consumer-available CPUs that have a maximum of 8 (logical) processors (i.e. Intel Core i7). Imagine how much improvement in performance this brings!
May 31, 2009
For more than 2 years now, I have been a silent observer of everything that has to do with technology and free software. I have been a frequent visitor of some free software portals like GNOME Planet, Graphics Planet, Planet KDE, Blendernation & Free Software Daily (among others). Through these sites, I was able to widen my knowledge of the ethics, technologies and implications of free software.
As far as I can tell, I am a typical free software enthusiast and advocate. Since I discovered this brave new world of vast potentials, I immediately switched to a GNU/Linux distribution, read, listened and watched many talks and articles by Richard Stallman, Eric S. Raymond, Eben Moglen, Linus Torvalds, Larry Lessig, et. al., and “evangelized” about freedom in computing.
I diminished on the latter only when I realized that the world, as it is now, is so entrenched in proprietary software that all I can do is help to improve free software until such a point in time where the choice of using proprietary software over free software becomes inconvenient. After all, I believe that today’s copyright and patent laws are actually counter-intuitive when applied to software. And that the use of proprietary software is actually due to convenience rather than common sense. An idea exemplified by the amount of “piracy” pervasive across the world today.
Anyway, about a year or so ago, I learned about Google’s Summer of Code program (GSoC). This came as a rather perfect opportunity for me to kick-start my way into a culture that I have been longing to participate. I had planned to join GSoC last year, but because of a mix of both personal and academic factors, I only went as far as day-dreaming (a venture I am thoroughly good at).
Fortunately, this year, I finally managed to kick my metaphorical butt into actually passing two proposals to GSoC. After about two weeks of stomach-wrenching wait, I got accepted. The accepted proposal has something to do with GIMP and its future graphics core, GEGL. If you are interested, you can download a copy of my accepted proposal from here. (More on the GSoC project later. I’m supposed to boringly introduce myself now. I’m succeeding so far, don’t you think? :))
Like many others, I’m sure, I started at a fairly young age as a more-than-averagely-interested computer user. I met technology at an age of 14 in the form of a Winblows 98 box that I don’t own (it was in an internet cafe that charged about half a dollar an hour). Looking at the power, tools and information they bring amid the messy power cords and dirt-filled keyboards and mice, I immediately fell in love with computers! Months and years later, I decided to turn this love into my life-long work.
Since then, many things happened; I played computer games, fiddled with switches, knobs and buttons to try and crash the cafes’ computers (which I have managed to successfully do quite frequently), downloaded hundreds of useless programs which bit-rotted in my diskettes (I didn’t have my own computer that time), enrolled myself in a computer science course in college, learned to program in C, C++, Assembly and Java, discovered free software and managed to scare away some of my friends with my free software activism :). Thinking back, I really did come a long way and now that I’m here, I intend to stay (if not go deeper, of course).
The first time I had set my mind on free software was through its arguably much more known alter-ego, open source. It was early 2002 when one of my favorite applications’ company declared bankrupcy and open sourced its well-known then-freeware program, Blender. Imagine what it feels like when a software that you use and practically worship (because you know how to program) suddenly becomes available for you to modify. For me, it was both exhilirating and mind-boggling!
“Yay! I can look at how they implemented all those buttons and their functions!”, was one of my thoughts. But also, “There are people actually doing this? Making the source code available to everyone?”, was an almost immediate question.
One could say that my conventional thinking was both shattered and freed. I spent the remaining years until 2 years ago trying to reconcile open source and my traditional assumption of keeping my source code (and knowledge) to myself. After that, I sort of cracked and rejected the idea that software (or ideas, for that matter) can be owned. Yeah, I learned about free sofware. ;)
The rest, as one should normally say, is my humble version of history…
I’m very excited about this new development in my life and very much look forward into your much appreciated support and/or encouragement. Until next time!
Forthcoming: Going back to business, I will be verbosely talking about my GSoC project, introduce some GPU concepts, and discuss about GEGL and its nuts and bolts, so to speak.