Search - User list
Full Version: OpenCL Wrangle SOP: Geometry Manipulation on the GPU using OpenCL
Root » Work in Progress » OpenCL Wrangle SOP: Geometry Manipulation on the GPU using OpenCL
animatrix_
This operator allows you to run an OpenCL kernel as part of your SOP network. Depending on the GPU, some operators can be orders of magnitude faster than even VEX.

In this case the OpenCL code is 144 times faster than VEX on GTX 970.

mestela
Cool! How do the opencl geometry functions compare to vex? Is there a library of things to play with, or is it pretty much access points, that's it? Can it create/destroy geo, or is it closer in style to the old vopsop, ie modify only?

animatrix_
OpenCL library functions are pretty slim compared to VEX, i.e. no point clouds, etc. You can access point/prim/vertex/detail attributes of int/float/int array/float array, scalar/vector/matrix fields, etc. So the code is more convoluted compared to VEX, but speed bonus is always nice

You can't create new geometry without using geometry shaders which are not supported by Houdini AFAIK. So you can only modify what you have.

Hope SESI adds an OpenCL Wrangle SOP to H16.
Nima
Awesome!
How did you import that in Houdini? by API?
Cheers.
animatrix_
No, Houdini has OpenCL support out of the box.
Nima
So how can we use OpenCL in Houdini?
cheers.
animatrix_
Gas OpenCL DOP

The only missing thing is to be able to run OpenCL on the CPU which should still be faster than C++.

I submitted an RFE for this.
Nima
Great!
Thanks.
Solitude
pusat
Gas OpenCL DOP

The only missing thing is to be able to run OpenCL on the CPU which should still be faster than C++.

I submitted an RFE for this.

http://archive.sidefx.com/docs/houdini15.0/news/13/opencl [archive.sidefx.com] << you mean this?
animatrix_
Thanks Ian I didn't know that. It would be nice to be able to do this directly inside Houdini using a toggle though, so it's useable in a studio environment.
animatrix_
You can download the operator here:
OpenCL Wrangle SOP [dropbox.com]

Relax geometry OpenCL kernel shown in the video is included as a preset inside the HDA.

Time to put those Titans to use
animatrix_
I added another preset for accurate smoothing of meshes. It's the same code I use in my Smooth SOP which now works in real time even for 100 iterations.
l0op1ng
Thx a lot Pusat to share this !
animatrix_
Np man, enjoy it
Javid Pack
pusat
I added another preset for accurate smoothing of meshes. It's the same code I use in my Smooth SOP which now works in real time even for 100 iterations.
I have some questions.

I noticed that as I scrub back and forth on the timeline and watch the Geometry Spreadsheet window, position values change ever so slightly in both the Smooth and Relax preset examples. From my limited knowledge in this area, my understanding is that this is the nature of GPU programming and the fact that the order of kernels isn't guaranteed. Are there any precautions I'd need to take for this concurrent modification of data values? In this case it is fine given the nature of the problem, but I am just curious for things I might need to look out for as I attempt my own programming.

The point of this otl is for facilitating general purpose opencl in Houdini, correct?

What is the point of the “barrier ( CLK_LOCAL_MEM_FENCE );” in the Smooth code?

There is a “Recompile Kernel” check box, but intuitively I'd assume this should be a button. Is this doing something I'm not understanding?

Is copying memory back and forth between the device and the GPU handled automatically in opencl? I was learning a bit of CUDA and I had to handle that myself.

I hope you can shed some light on these issues. I'm not a Houdini expert but my current area of research requires the power of the GPU to show promising results.
animatrix_
I noticed that as I scrub back and forth on the timeline and watch the Geometry Spreadsheet window, position values change ever so slightly in both the Smooth and Relax preset examples. From my limited knowledge in this area, my understanding is that this is the nature of GPU programming and the fact that the order of kernels isn't guaranteed. Are there any precautions I'd need to take for this concurrent modification of data values? In this case it is fine given the nature of the problem, but I am just curious for things I might need to look out for as I attempt my own programming.

That's because right now there is no way to have a true timeless DOPnet as a SOP node. Hopefully H16 will address this issue. So if this node was time-independent, then the results would not change from frame to frame.

Currently your best bet is to use a TimeShift SOP afterwards.


The point of this otl is for facilitating general purpose opencl in Houdini, correct?

- Yes

What is the point of the “barrier ( CLK_LOCAL_MEM_FENCE );” in the Smooth code?

https://www.khronos.org/registry/cl/specs/opencl-2.0-openclc.pdf#page=99 [khronos.org]

There is a “Recompile Kernel” check box, but intuitively I'd assume this should be a button. Is this doing something I'm not understanding?

“When loading kernels from disk the kernel is cached to avoid regenerating it every solve. Turning this on forces the re-loading and recompiling of the kernel. This is useful if #include files refer to code that has changed, or the kernel file is changed in an external text editor.

It should always be disabled when protoyping is complete.”


Is copying memory back and forth between the device and the GPU handled automatically in opencl? I was learning a bit of CUDA and I had to handle that myself.

Yes.

I hope you can shed some light on these issues. I'm not a Houdini expert but my current area of research requires the power of the GPU to show promising results.
Javid Pack
pusat
I hope you can shed some light on these issues. I'm not a Houdini expert but my current area of research requires the power of the GPU to show promising results.
Thank you for your answers, they helped me get started.

One last thing, I'm having trouble getting a scalar field to work. It may just be my inexperience with houdini, but I created a volume node and added it's name as a parameter to the OpenCL wrangle node, but I get this error on the gasopencl solver.



Can you show/explain a simple setup for this? I tried merging the volume with the points, but houdini didn't like that. The field is passed in as a float array. Do I need to pass in the width/height/depth separately? If so, what would the order of the values be?

In the end, I want the node to run a calculation on each point in a set against both a volume and another set of points. In my HDK implmentation, I had 3 inputs, so I was able to do this, but I can't figure out how I would go about this with only 1 input. Merging the points seems like a bad idea because I'd need to figure out which are which and the mismatched attributes worries me.

Hopefully you can help, I understand if what I'm trying to do is complicated.
fatak
Hey guys,

Now that we have the OpenCL SOP, I've been playing around a bit, and I'd like to create a work buffer in local memory. Is there anyway to do this? More specifically, I want to process my P attribute (which I can access as global float *) in a local work buffer , which I would like to be a local float * of size get_local_size(0). Is there any way for me to create/allocate this local work buffer using the OpenCL SOP? It seems like the OpenCL bindings only allow me to create bindings to attributes, and kernel arguments (of int, float, float3, float4 types, and not arrays)

Thanks!
vinyvince
Did you say Attribut blur and point relax in OpenCL???

Where where ? Tell me boy please
The link are broken @animatrix_ ...
tamte
vinyvince
Did you say Attribut blur and point relax in OpenCL???
Attribute Blur has always been OpenCL, dive inside if you are interested in code itself
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB