Newton 2.0x Archemedia Open Beta

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Re: Newton 2.0 Archemedia Open Beta

Postby Julio Jerez » Thu Feb 26, 2009 5:44 pm

I apologize for the delay, I thought that I was going to get the GPU Newton in a weekend and it is taking me three weekend just to get the solver bug free instead.
Ther are some git you in eth Cuda language that are quite very nastry, and quiet franly leave a lot to be desired.
I beleive I have in a very stable face that I can now rebuild the engine and post it wi teh Cuda stuff disale onet it is more finish

viewtopic.php?f=9&t=5003

Again I am very sorry abput that and I will put the new build this saturday.

Julio
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Newton 2.0 Archemedia Open Beta

Postby Aphex » Fri Feb 27, 2009 6:23 am

Hey no probs - whenever you're ready! :)
Aphex
 
Posts: 144
Joined: Fri Jun 18, 2004 6:08 am
Location: UK

Re: Newton 2.0 Archemedia Open Beta

Postby VeT » Sat Feb 28, 2009 4:13 pm

so, Julio, can can you find a method that would let us know that the new version is uploaded?
1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy
LiteC+Newton2 download: http://hosted.filefront.com/NeArGa
LiteC+Newton2 discussion: http://tinyurl.com/6l7y9v
VeT
 
Posts: 84
Joined: Thu Jul 31, 2008 11:31 am

Re: Newton 2.0 Archemedia Open Beta

Postby kallaspriit » Mon Mar 02, 2009 3:59 pm

mfdesigner wrote:agi_shi is correct. The original OgreNewt's transform callback updates the 3D world in a separate thread.
This turns out is not threadsafe in Ogre.

void Body::standardTransformCallback( OgreNewt::Body* me, const Ogre::Quaternion& orient, const Ogre::Vector3& pos, int threadIndex )
{
me->m_node->setOrientation( orient );
me->m_node->setPosition( pos );
}

I changed it to merely issuing a transform request and let the main loop does the actual transfrom.

void Body::standardTransformCallback( OgreNewt::Body* me, const Ogre::Quaternion& orient, const Ogre::Vector3& pos, int threadIndex )
{
OgreNewt::World* world = (OgreNewt::World*)me->getWorld();
if (world)
{
transformRequest req(pos, orient);
world->addTransformRequest(me, req);
}
}

And all is fine now.
There is nothing wrong with Newton 2.0.

Thanks,
Steve


Could you clarify a bit how did you implement this exactly, having the same problem. Where and how is the request carried out? Do you pile the requests into a vector or something and then apply them in the main loop?
kallaspriit
 
Posts: 216
Joined: Sun Aug 14, 2005 6:31 pm

Re: Newton 2.0 Archemedia Open Beta

Postby mfdesigner » Thu Mar 05, 2009 1:28 pm

yes... I put the transformRequests in a stl::map<bodyID, transformRequests> and let Ogre's main transform callback does the update. The map will not accumulate all the requests as a vector does, it would only keep the latest transform request. The crash happens inside Ogre not OgreNewt when different threads apply transform to the same object.
mfdesigner
 
Posts: 7
Joined: Sun Feb 08, 2009 7:07 pm

Re: Newton 2.0 Archemedia Open Beta

Postby mfdesigner » Thu Mar 05, 2009 1:31 pm

By "Ogre's main transform callback", I mean the Ogre's main frame listener.
mfdesigner
 
Posts: 7
Joined: Sun Feb 08, 2009 7:07 pm

Re: Newton 2.0 Archemedia Open Beta

Postby Beauty » Tue Mar 31, 2009 12:09 pm

Bugreport:

There is a bug in the function NewtonCollisionUpdate(World).

For my application I use the collision detection functionality, but no physics.
Sometimes the application freezes.
This happens at the code line where NewtonCollisionUpdate() is called.
One CPU kernel is fully streched, but the dead lock stays.

* Objects are moved by NewtonBodySetMatrix(...)
* For collision detection I use the iterator method instead of callback function. ( NewtonBodyGetFirstContactJoint(...) etc.)

It seems so that the dead lock doesn't happen when I only change the body orientations.
Orientation AND position have to be changed to get the dead lock (I suppose).
Julio, do you have an idea what cause the problem?
If you need more information, tell me what you need to know.

Maybe you have a special Newton.dll which creates a logfile with useful information?
(e.g. name of all called functions with its parameters)
Then I could add it to my application and give you the logfile.
Mogre user
User avatar
Beauty
 
Posts: 30
Joined: Tue Apr 29, 2008 7:37 am
Location: Germany

Re: Newton 2.0 Archemedia Open Beta

Postby Dave Gravel » Tue Mar 31, 2009 1:57 pm

Do you use any callback somewhere ?
Maybe you execute a command not threads safe in a callback and it make the app freeze.

Maybe you need to use NewtonWorldCriticalSectionLock and NewtonWorldCriticalSectionUnlock somewhere in one of your callback.
Exemple it is needed to display some debug lines or if you make some system log test debug you surely need this commands too.
I think it is needed with any commands that resqueted system use in callback.
You search a nice physics solution, if you can read this message you're at the good place :wink:
OrionX3D Projects & Demos:
https://orionx3d.sytes.net
https://www.facebook.com/dave.gravel1
https://www.youtube.com/user/EvadLevarg/videos
User avatar
Dave Gravel
 
Posts: 800
Joined: Sat Apr 01, 2006 9:31 pm
Location: Quebec in Canada.

Re: Newton 2.0 Archemedia Open Beta

Postby Beauty » Tue Mar 31, 2009 3:03 pm

Thanks for suggestions.
I don't use a callback function.
Instead I check only a few objects for collision by iterator method.
An example code is here.
Mogre user
User avatar
Beauty
 
Posts: 30
Joined: Tue Apr 29, 2008 7:37 am
Location: Germany

Re: Newton 2.0 Archemedia Open Beta

Postby Julio Jerez » Tue Mar 31, 2009 11:35 pm

I did noi tes teh collision update loop much, it could be theat the is a bug.
The first step is setting the thread count to 1 and see if it does not hang.
can you do that and see what happens?
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Newton 2.0 Archemedia Open Beta

Postby Beauty » Wed Apr 01, 2009 9:27 am

Code: Select all
nworld->setThreadCount(1);

I set this, but there is still the dead lock problem.

If it's a help for you, I can add a position/orientation logging to my main application.
Then I extend my second application (just for Newton tests) so that it repeats this movings (like a playback). This I can give you for debugging.
If you need it, just tell me.
(Is it important to use the same models for collision creation or is it enough for you if I use boxes instead?)

Alternatively - maybe you also get the dead lock when you just use random values.

If it's important for you:
* for my world I set the AABB from (0 / 0 / 0) to (10,000 / 1,000 / 10,000)
* my collisions I create by ConvexHull
Mogre user
User avatar
Beauty
 
Posts: 30
Joined: Tue Apr 29, 2008 7:37 am
Location: Germany

Re: Newton 2.0 Archemedia Open Beta

Postby Julio Jerez » Wed Apr 01, 2009 9:39 am

Ok ist is not because of multithreading.
you said you have a sampel code, but I do no see anythoing.
do you have a running sample that reproduce teh bub and that I can test?
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Newton 2.0 Archemedia Open Beta

Postby Beauty » Wed Apr 01, 2009 11:43 am

I just linked your code that shows how to use the iterator method.
http://newtondynamics.com/forum/viewtop ... 334#p33334

Also I started to write a logging extension to my main application.
Can you give me your e-mail adress (per pm)?
So I can send you the test application when it's ready (and reproduces the problem).

update
If you like you can move the posts (related to this bug) to a new forum thread.
Mogre user
User avatar
Beauty
 
Posts: 30
Joined: Tue Apr 29, 2008 7:37 am
Location: Germany

Re: Newton 2.0 Archemedia Open Beta

Postby Julio Jerez » Thu Apr 02, 2009 9:37 am

Yes I saw the post and the function but how do I use it to reproduce the bug.

Tha funtion is used to show the contaats in he demos, but it is use when using physics update, are you saying that if I use a Collison Update the demo will freeze?
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Newton 2.0 Archemedia Open Beta

Postby Beauty » Thu Apr 02, 2009 10:49 am

Yes, the freeze is at the call of NewtonCollisionUpdate().

I logged the position/orientation inputs of my main application and the collisionUpdate calls.
Now I'll add this to my test application and see if the freeze happens there, too.
(I hope it will happen when I use simple boxes instead of the convex hulls)
When the test application reproduces the problem then I'll send it to you.
(If I don't finish today, then I can resume foremost in a few days)

The linked code was only to show which functions are used for the iterator method.
Mogre user
User avatar
Beauty
 
Posts: 30
Joined: Tue Apr 29, 2008 7:37 am
Location: Germany

PreviousNext

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 11 guests

cron