Jump to content

Converting VEX to OpenCL


Recommended Posts


My understanding is that VEX runs entirely on the CPU. But with the right hardware (ie latest Pascal based GPU)  the same functionality in OpenCl could be magnitudes faster.

Is anyone aware of any OTL or other project which have converted VEX code to OpenCL?


Link to comment
Share on other sites

Much of VEX functionality is actually implemented as C++ code interacting with Houdini's and Mantra libraries and most importantly data structures. Reimplementing them so they can be called from OpenCL wouldn't be trivial and most probably would ruin OpenCL performance. Compiling VEX code without calls to built-in functions other than math expression, so that it can be evaluated on OCL device would't be hard at all AFAIK - thanks to LLVM, which compiles code to intermediate format anyway, but the functionality would be very very limited and I doubt in any benefits. 

There are rare cases, like filter like kernels when OCL has big advantage. It's like 2% of all use cases. 

Are you really so advanced in using VEX so that VEX performance slows you down?  There is always C++ waiting. 

  • Like 1
Link to comment
Share on other sites

That is an interesting example but I get errors on my system and it does not work. It even converted my desktop into a basic color scheme, for some reason..? The Gas OpenCL node is in an error state. If I click Generate Kernel I do see some cooking message but then it returns to an error state.


Edited by Atom
Link to comment
Share on other sites

@Atom,  Generate Kernel button simply makes template based on parameter setup. Normally, it pops window with text for copy-pasting. Well, I can't do much there, since I also have no idea how the whole thing works. Hope to see more comprehensive examples of utilizing Gas OpenCL in future Houdini builds.

Edited by f1480187
Link to comment
Share on other sites

  • 3 weeks later...
  • 3 months later...
On 12/21/2016 at 8:33 PM, f1480187 said:

hey, thanks for sharing this file, I was having trouble with my implementation and good to see yours.

Plus that openCL approach is amazing!!!



Here is 2D reaction diffusion in VEX (from "VEX in Houdini") and OpenCL. Also check "Grains" masterclass and it's OpenCL ripples example.



Link to comment
Share on other sites

  • 6 months later...
  • 2 weeks later...
12 hours ago, Daryl Dunlap said:

Thanks for that sample file, it took me a few hours, but I finally understand the OpenCL SOP and the data I/O between Houdini and the GPU

Maybe 3 scene files(in comments) from this video will be useful too(sadly russian,very good quick start).

It will also be useful to look inside Attribute Blur(principle of organization of variables with various input data types) and HeightFiledErode(principle of operation with volumes via openCL)nodes.And inside files in /opt/hfs16.0/houdini/ocl/


Edited by Iskander
  • Like 1
Link to comment
Share on other sites

  • 3 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...