Home › Forum › SOFA › Using SOFA › [SOLVED] CUDA Collisions
Tagged: Collisions, Sofa + CUDA
- This topic has 8 replies, 4 voices, and was last updated 9 years ago by Guillaume.
-
AuthorPosts
-
30 September 2015 at 19:05 #3716JasonBlocked
Hi Everyone,
I’m encountering an error when I try to implement collisions using CUDA. I have successfully compiled SOFA and the SofaCUDA plugin from source using the latest commit from the git repository.
In my scene, I drop a humanoid mesh on a floor, and when they contact, I obtain the following error:
ERROR: Element Intersector TTriangleModel<CudaVectorTypes<Vec<3, float>, Vec<3, float>, float> >-TTriangleModel<CudaVectorTypes<Vec<3, float>, Vec<3, float>, float> > NOT FOUND within :
And it then lists several model interaction pairs. I’ve included the scene xml below:
<?xml version=”1.0″?>
<Node name=”root” gravity=”0 -9.81 0″ dt=”0.01″ >
<RequiredPlugin name=”CUDA computing” pluginName=”SofaCUDA” />
<VisualStyle name=”VisualStyle” displayFlags=”showAll” />
<CollisionPipeline name=”Pipeline” />
<BruteForceDetection name=”BruteForceDetection” />
<DefaultContactManager name=”ContactManager” response=”default” />
<CudaProximityIntersection name=”ProximityIntersection” alarmDistance=”0.05″ contactDistance=”0.01″ /><EulerImplicitSolver name=”cg_odesolver” />
<CGLinearSolver name=”linear solver” iterations=”10″ tolerance=”1e-09″ threshold=”1e-09″/>
<Node name=”Floor”>
<RegularGrid
nx=”20″ ny=”2″ nz=”20″
xmin=”-100″ xmax=”100″
ymin=”-1″ ymax=”0″
zmin=”-100″ zmax=”100″ />
<MechanicalObject template=”CudaVec3f” />
<TTriangleModel template=”CudaVec3f”/>
<Node name=”Visu”>
<OglModel name=”Visual” color=”blue”/>
<IdentityMapping input=”@..” output=”@Visual”/>
</Node>
</Node>
<Node name=”Model” >
<MeshObjLoader name=”modelMesh” filename=”obj/model.obj” />
<MeshTopology src=”@modelMesh” />
<MechanicalObject src=”@modelMesh” name=”Model” template=”CudaVec3f” translation=”0 10 0″ />
<UniformMass totalmass=”50″ />
<TTriangleModel template=”CudaVec3f”/>
<OglModel name=”VisualModel” template=”ExtVec3f” color=”grey” />
<IdentityMapping name=”Mapping” template=”CudaVec3f,ExtVec3f” input=”@.” output=”@VisualModel” />
</Node>Is there something simple I’m doing wrong?
Thanks so much for your help,
Jason
1 October 2015 at 04:53 #3720François FaureBlockedHi, have you tried the available examples ? Do they work ?
1 October 2015 at 16:33 #3722JasonBlockedHi Faure,
Yes, the examples work. However, I didn’t find an example that does collisions on the GPU. Did I miss one somewhere?
3 October 2015 at 12:58 #3732François FaureBlockedHi,
did you try the examples of the plugin ?
The simplest are:
sofa-dev/applications-dev/plugins/SofaCUDALDI/examples/cube/cube_penality.scn
for a penalty reaction,and
sofa-dev/applications-dev/plugins/SofaCUDALDI/examples/cube/cube_lilleConstraint.scn
or
sofa-dev/applications-dev/plugins/SofaCUDALDI/examples/cube/cube_LMConstraint.scn
for a constraint-based reaction.Starting from this, you should be able to create your own scene,
best,
François Faure.5 October 2015 at 15:51 #3736JasonBlockedHi Francois,
I didn’t try those two examples because I couldn’t find them in the git repository. I’m running off of origin/master. Are they in a different branch?
Cheers,
-Jason
5 October 2015 at 16:58 #3737HugoKeymasterDear Jason,
The examples are currently available on the git master branch.
It seems strange that you do not have them.Best,
Hugo
5 October 2015 at 20:30 #3738JasonBlockedHi Everyone,
Clearly I am missing something. I don’t find the SofaCUDALDI plugin in the repository at all. I’m using the repository at https://gforge.inria.fr/scm/sofa/sofa.git/ and I don’t find either a sofa-dev or applications-dev directory anywhere in the tree. Where can I find this plugin?
Cheers,
-Jason
6 October 2015 at 05:40 #3739François FaureBlockedDear Jason,
Your example does not work because it tries to apply CPU detection on GPU points. To make it work, use Vec3f, instead of CudaVec3f.
SofaCudaLDI is a private plugin, therefore it is not located in the master branch, sorry about the confusion ! As far as I know, there is currently no other implementation of collision detection on the GPU.
Best,9 December 2015 at 16:09 #4818GuillaumeKeymasterDear Jason,
If you need further information about the SofaCudaLDI plugin, you can let us know. We could provide you the appropriate contact.
Cheers,
Guillaume
-
AuthorPosts
- You must be logged in to reply to this topic.