While the Optimus technology is a great idea, there is no official support for it using Linux. The problem here is not to judge the choice made by Nvidia, but to find a way to flawlessly run WebCL content even if you can't use Nvidia drivers out of the box.
In fact, it is not difficult to get it working, as the linux community is doing a very great work to support Nvidia Optimus : the main idea of this post is to show that it can be done, for those who doubt of the compatiblity of WebCL with the Bumblebee hack.
To summarize the problem briefly, the main problem with Optimus technology is that the Nvidia card doesn't have any standard output : it just computes data and returns them to the Intel video card, which is the only one used to display the results. Bumblebee is a well done hack (and a well found pun) that is based on Virtual GL - a software that is able to use accelerated graphics in a remote display - to render images using the Nvidia video card.
So, as you have already guessed, you will need to apply the Bumblebee hack. Don't worry, everything has been done to be as simple as possible. Using Ubuntu is the easier way to get it working, as you just have to add a PPA repository. For other distribs, you have to clone the git repository and launch a script (please note though that last time I tried it did not work with ArchLinux). After some questions, you can restart your computer and normally you can now run programs with your Nvidia video card by launching them using optirun32 or optirun64, depending on the program's architecture.
Then, you need - of course - the binaries released by Adrien. And now let's launch firefox using your Nvidia video card :
optirun64 ./firefox
Then in about:config, we need to change two values :
- webcl.force_enabled must be set to true
- webcl.opencllib must point to the OpenCL library, which can be found here if you use optirun64 : /usr/lib/nvidia-current/libOpenCL.so; and here if you use optirun32 : /usr/lib32/nvidia-current/libOpenCL.so.
That's it, WebCL will use your Nvidia video card for computation.
PS : Please note that kernel updates can be a problem with bumblebee, as you will need to apply it again after each new version. If you use apt, you have to purge bumblebee and nvidia-current packages, and then re-install them.