CUDA + HDK ?

   11349   6   3
User Avatar
Member
110 posts
Joined:
Offline
Hey gang, I'm wondering if one can actually take advantage of cuda and it's processing in a custom hdk node, specially sops or pops.

So has anyone out there actually gotten something like this working, or is this something that you would need some deeper access in threading than what's available in the HDK?
User Avatar
Member
203 posts
Joined:
Offline
Oops, I just revived an old thread [sidefx.com] I had made on this topic….
I'm taking a Computer Science class, so at the end of this school year if it hasn't been done perhaps I can try.
Most of My Houdini Renders [flickr.com]
My System [evga.com]
User Avatar
Staff
5212 posts
Joined: July 2005
Offline
Ratmann
Hey gang, I'm wondering if one can actually take advantage of cuda and it's processing in a custom hdk node, specially sops or pops.

It's likely just a matter of linking your node with the CUDA libs. The main issue with using GPUs for SOPs and POPs currently is that the point data must be marshaled into and out of arrays for CUDA, which can have a significant overhead. Your CUDA code would need to be significantly faster than the CPU version to compensate for this.
User Avatar
Member
110 posts
Joined:
Offline
twod
Ratmann
Hey gang, I'm wondering if one can actually take advantage of cuda and it's processing in a custom hdk node, specially sops or pops.

It's likely just a matter of linking your node with the CUDA libs. The main issue with using GPUs for SOPs and POPs currently is that the point data must be marshaled into and out of arrays for CUDA, which can have a significant overhead. Your CUDA code would need to be significantly faster than the CPU version to compensate for this.

Hey Twod, thanks for the reply.

Yeah that's pretty much what I was thinking, right now I'm just going about trying to create a simple GPU particle system to work inside Houdini, nothing too crazy yet.

There's a grid based particle system example inside the CUDA SDK that I'm looking into that seems to be the most approachable method to look into first, and for the main part the main GPU code seems to be in the particle interaction side of things, which makes sense since it's a grid based so it's looking in it's surroundings for others.

But from what others have been telling me, the section that would not work so well inside of the GPU would be complex collisions of moving meshes and that type of stuff, which that would have to be done on the CPU.

Gonna be a fun little project :-D

Thanks again,
-Rick
User Avatar
Member
54 posts
Joined:
Offline
in case anyone is interested, i've been trying this out on the weekend and got really interesting results..

I changed around and compiled the particle demo that comes with the cuda sdk as a library, using the nvcc compiler

here's a video of the particle demo:

http://www.youtube.com/watch?v=Yb-C4CuvlXU [youtube.com]

then i wrote a sop node that links that library. I get 200.000 interacting particles at 20 frames per second… (32768, the default of the demo, at 125)

but, this is with the sop node running 500 frames in one go, so there's very little overhead, i just read back the final positions after 500 frames.

gonna have to test how slow it is to read back every frame etc.

oh… this is with a >very lowend< 9500 GT! the GTX 275 (150 uk pounds i think) should be over 10 times faster
User Avatar
Member
874 posts
Joined: Oct. 2008
Offline
Wow, very cool stuff!
--
Jobless
User Avatar
Member
9 posts
Joined: July 2014
Offline
Here's a working example if anyone bumps into this thread.

https://github.com/sergeneren/SOP_vpt [github.com]

And a demo video.

https://twitter.com/sergenern/status/1067945943063035904?s=19 [twitter.com]
https://sergeneren.com/ [sergeneren.com]
  • Quick Links