<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://pybullet.org/Bullet/phpBB3/app.php/feed/topic/10232" />

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2018-11-22T11:12:20+00:00</updated>

	<author><name><![CDATA[Real-Time Physics Simulation Forum]]></name></author>
	<id>https://pybullet.org/Bullet/phpBB3/app.php/feed/topic/10232</id>

		<entry>
		<author><name><![CDATA[badyolk]]></name></author>
		<updated>2018-11-22T11:12:20+00:00</updated>

		<published>2018-11-22T11:12:20+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=41621#p41621</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=41621#p41621"/>
		<title type="html"><![CDATA[Re: CPU multithreading is working!]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=41621#p41621"><![CDATA[
Submitted an new issue I found with multithreading.<br><br><a href="https://github.com/bulletphysics/bullet3/issues/2002" class="postlink">https://github.com/bulletphysics/bullet3/issues/2002</a><p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=13096">badyolk</a> — Thu Nov 22, 2018 11:12 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[przemir]]></name></author>
		<updated>2018-05-05T10:40:05+00:00</updated>

		<published>2018-05-05T10:40:05+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=40615#p40615</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=40615#p40615"/>
		<title type="html"><![CDATA[Re: CPU multithreading is working!]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=40615#p40615"><![CDATA[
<blockquote class="uncited"><div>I am having trouble reproducing this crash. I have latest code from bullet main repo. Using Cmake and building with multithreading enabled. I applied the suggested change to MultiThreadedDemo::createStack function. Compiled on windows 10 with MSVC 2015, 64-bit, RelWithDebInfo configuration.</div></blockquote>I compiled with configuration you mentioned and this work without problems.<br>I encountered problems for 32-bit, Debug, Windows10.<br><br>Here is log (with assert):<div class="codebox"><p>Code: </p><pre><code>Version = 4.5.0 - Build 22.20.16.4836Vendor = IntelRenderer = Intel(R) HD Graphics 630starting thread 0started TaskScheduler thread 0 with threadHandle 00000378starting thread 1started TaskScheduler thread 1 with threadHandle 00000384starting thread 2started TaskScheduler thread 2 with threadHandle 00000390starting thread 3started TaskScheduler thread 3 with threadHandle 0000039Cstarting thread 4started TaskScheduler thread 4 with threadHandle 000003A8starting thread 5started TaskScheduler thread 5 with threadHandle 000003B4starting thread 6started TaskScheduler thread 6 with threadHandle 000003C0b3Printf: Selected demo: Multithreaded DemoAssert D:\Libraries\Bullet\bullet3-2018_05_03-modified\src\BulletDynamics\ConstraintSolver\btBatchedConstraints.cpp:215 (conInfo.numConstraintRows &lt;= 6)</code></pre></div><strong class="text-strong">Edit</strong><br><blockquote class="uncited"><div>Thanks for the reply. Can you report the issue in the Bullet <a href="https://github.com/bulletphysics/bullet3/issues" class="postlink">https://github.com/bulletphysics/bullet3/issues</a> tracker, so we can track progress on fixes?</div></blockquote>Issue added.<br><a href="https://github.com/bulletphysics/bullet3/issues/1673" class="postlink">https://github.com/bulletphysics/bullet3/issues/1673</a><p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=12701">przemir</a> — Sat May 05, 2018 10:40 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[lunkhound]]></name></author>
		<updated>2018-05-04T22:59:38+00:00</updated>

		<published>2018-05-04T22:59:38+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=40614#p40614</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=40614#p40614"/>
		<title type="html"><![CDATA[Re: CPU multithreading is working!]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=40614#p40614"><![CDATA[
<blockquote class="uncited"><div>To reproduce problem with a small amount of code, I modified your sample (MultiThreadedDemo) a bit, i.e replaced fragment of method MultiThreadedDemo::createStack <br><br>from:<div class="codebox"><p>Code: </p><pre><code>btRigidBody* body = localCreateRigidBody( mass, trans, boxShape );body-&gt;setFriction( 1.0f );body-&gt;setRollingFriction( gSliderRollingFriction );</code></pre></div>to:<div class="codebox"><p>Code: </p><pre><code>if(iX % 2 == 0) {btRigidBody* body = localCreateRigidBody( mass, trans, boxShape );body-&gt;setFriction( 1.0f );body-&gt;setRollingFriction( gSliderRollingFriction );}else {btCollisionObject* collisionObject = new btCollisionObject();collisionObject-&gt;setWorldTransform(trans);collisionObject-&gt;setCollisionShape(boxShape);m_dynamicsWorld-&gt;addCollisionObject(collisionObject);}</code></pre></div>Now it causes crash.</div></blockquote>I am having trouble reproducing this crash. I have latest code from bullet main repo. Using Cmake and building with multithreading enabled. I applied the suggested change to MultiThreadedDemo::createStack function. Compiled on windows 10 with MSVC 2015, 64-bit, RelWithDebInfo configuration.<br>When I run the MultiThreadedDemo it isn't crashing and half of the boxes are not dynamic as expected.<br>Am I missing a step?<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=10573">lunkhound</a> — Fri May 04, 2018 10:59 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[lunkhound]]></name></author>
		<updated>2018-05-04T21:14:00+00:00</updated>

		<published>2018-05-04T21:14:00+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=40613#p40613</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=40613#p40613"/>
		<title type="html"><![CDATA[Re: CPU multithreading is working!]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=40613#p40613"><![CDATA[
I'll investigate this crash shortly.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=10573">lunkhound</a> — Fri May 04, 2018 9:14 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Erwin Coumans]]></name></author>
		<updated>2018-05-03T14:56:03+00:00</updated>

		<published>2018-05-03T14:56:03+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=40608#p40608</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=40608#p40608"/>
		<title type="html"><![CDATA[Re: CPU multithreading is working!]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=40608#p40608"><![CDATA[
Thanks for the reply. Can you report the issue in the Bullet <a href="https://github.com/bulletphysics/bullet3/issues" class="postlink">https://github.com/bulletphysics/bullet3/issues</a> tracker, so we can track progress on fixes?<br><blockquote class="uncited"><div><br>1. My program using single-threaded btDiscreteDynamicsWorld crashed because of btSequentialImpulseConstraintSolver::getOrInitSolverBody method returned -1<br>It happened because of line:<div class="codebox"><p>Code: </p><pre><code>if ( btRigidBody* rb = btRigidBody::upcast( &amp;body ) )</code></pre></div>I use CollisionObjects aside from RigidBodies. After I commented line above, single-threaded simulation started to work again.<br>Similar line is in btSequentialImpulseConstraintSolverMt::getOrInitSolverBodyThreadsafe though.<br><br>2. After configuring btDiscreteDynamicsWorldMt with specified btSequentialImpulseConstraintSolverMt program crashes as well.<br>For btDiscreteDynamicsWorldMt without btSequentialImpulseConstraintSolverMt it works.<br>I guess (like in the case above) it may have problems when there are pure CollisionObjects inside dynamic world aside from RigidBodies.<br>To reproduce problem with a small amount of code, I modified your sample (MultiThreadedDemo) a bit, i.e replaced fragment of method MultiThreadedDemo::createStack <br><br>from:<div class="codebox"><p>Code: </p><pre><code>btRigidBody* body = localCreateRigidBody( mass, trans, boxShape );body-&gt;setFriction( 1.0f );body-&gt;setRollingFriction( gSliderRollingFriction );</code></pre></div>to:<div class="codebox"><p>Code: </p><pre><code>if(iX % 2 == 0) {btRigidBody* body = localCreateRigidBody( mass, trans, boxShape );body-&gt;setFriction( 1.0f );body-&gt;setRollingFriction( gSliderRollingFriction );}else {btCollisionObject* collisionObject = new btCollisionObject();collisionObject-&gt;setWorldTransform(trans);collisionObject-&gt;setCollisionShape(boxShape);m_dynamicsWorld-&gt;addCollisionObject(collisionObject);}</code></pre></div>Now it causes crash.</div></blockquote><p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=2">Erwin Coumans</a> — Thu May 03, 2018 2:56 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[przemir]]></name></author>
		<updated>2018-05-03T14:32:27+00:00</updated>

		<published>2018-05-03T14:32:27+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=40606#p40606</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=40606#p40606"/>
		<title type="html"><![CDATA[Re: CPU multithreading is working!]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=40606#p40606"><![CDATA[
<blockquote class="uncited"><div>Note that my pull-request for the multithreaded constraint solver has been accepted and merged (a couple of weeks ago). So this is now available in the main Bullet repo.</div></blockquote>Thanks for sharing your code.<br><br>1. My program using single-threaded btDiscreteDynamicsWorld crashed because of btSequentialImpulseConstraintSolver::getOrInitSolverBody method returned -1<br>It happened because of line:<div class="codebox"><p>Code: </p><pre><code>if ( btRigidBody* rb = btRigidBody::upcast( &amp;body ) )</code></pre></div>I use CollisionObjects aside from RigidBodies. After I commented line above, single-threaded simulation started to work again.<br>Similar line is in btSequentialImpulseConstraintSolverMt::getOrInitSolverBodyThreadsafe though.<br><br>2. After configuring btDiscreteDynamicsWorldMt with specified btSequentialImpulseConstraintSolverMt program crashes as well.<br>For btDiscreteDynamicsWorldMt without btSequentialImpulseConstraintSolverMt it works.<br>I guess (like in the case above) it may have problems when there are pure CollisionObjects inside dynamic world aside from RigidBodies.<br>To reproduce problem with a small amount of code, I modified your sample (MultiThreadedDemo) a bit, i.e replaced fragment of method MultiThreadedDemo::createStack <br><br>from:<div class="codebox"><p>Code: </p><pre><code>btRigidBody* body = localCreateRigidBody( mass, trans, boxShape );body-&gt;setFriction( 1.0f );body-&gt;setRollingFriction( gSliderRollingFriction );</code></pre></div>to:<div class="codebox"><p>Code: </p><pre><code>if(iX % 2 == 0) {btRigidBody* body = localCreateRigidBody( mass, trans, boxShape );body-&gt;setFriction( 1.0f );body-&gt;setRollingFriction( gSliderRollingFriction );}else {btCollisionObject* collisionObject = new btCollisionObject();collisionObject-&gt;setWorldTransform(trans);collisionObject-&gt;setCollisionShape(boxShape);m_dynamicsWorld-&gt;addCollisionObject(collisionObject);}</code></pre></div>Now it causes crash.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=12701">przemir</a> — Thu May 03, 2018 2:32 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[lunkhound]]></name></author>
		<updated>2018-04-15T20:40:10+00:00</updated>

		<published>2018-04-15T20:40:10+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=40563#p40563</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=40563#p40563"/>
		<title type="html"><![CDATA[Re: CPU multithreading is working!]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=40563#p40563"><![CDATA[
Note that my pull-request for the multithreaded constraint solver has been accepted and merged (a couple of weeks ago). So this is now available in the main Bullet repo.<br>Thanks Erwin!<br><br>With this latest PR, the task scheduler is now included in the core libs, which should make it easier than ever to get multithreading working in a standalone project. Feel free to post in this thread if you run into any trouble getting it set up.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=10573">lunkhound</a> — Sun Apr 15, 2018 8:40 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[lunkhound]]></name></author>
		<updated>2018-03-08T19:58:14+00:00</updated>

		<published>2018-03-08T19:58:14+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=40476#p40476</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=40476#p40476"/>
		<title type="html"><![CDATA[Re: CPU multithreading is working!]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=40476#p40476"><![CDATA[
<blockquote class="uncited"><div>Thanks.  I was using the wrong master, which doesn't have the btSequentialImpulseConstraintSolverMt source files.  I'll build it now and let you know what I think after a couple of days of testing.</div></blockquote>Sorry, that was my bad -- I had the wrong default branch on my repo. I fixed that now.<br><br>If you should run into any trouble, just post it here and I'll try to help. Also, for best results I recommend using the built-in task scheduler rather than the others. I haven't been testing the others much.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=10573">lunkhound</a> — Thu Mar 08, 2018 7:58 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rebirth]]></name></author>
		<updated>2018-03-08T19:16:44+00:00</updated>

		<published>2018-03-08T19:16:44+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=40475#p40475</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=40475#p40475"/>
		<title type="html"><![CDATA[Re: CPU multithreading is working!]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=40475#p40475"><![CDATA[
Thanks.  I was using the wrong master, which doesn't have the btSequentialImpulseConstraintSolverMt source files.  I'll build it now and let you know what I think after a couple of days of testing.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=10930">rebirth</a> — Thu Mar 08, 2018 7:16 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[lunkhound]]></name></author>
		<updated>2018-03-08T18:51:42+00:00</updated>

		<published>2018-03-08T18:51:42+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=40474#p40474</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=40474#p40474"/>
		<title type="html"><![CDATA[Re: CPU multithreading is working!]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=40474#p40474"><![CDATA[
<blockquote class="uncited"><div>I've tried getting this working, but VS is throwing an assert:<div class="codebox"><p>Code: </p><pre><code>btAssert( gBtTaskScheduler != NULL );  // call btSetTaskScheduler() with a valid task scheduler first! - line 444 of btThreads.cpp</code></pre></div>I chose PPL in cmake and I'm creating the world like so:<div class="codebox"><p>Code: </p><pre><code>broadPhase = new btDbvtBroadphase();collisionConfig = new btDefaultCollisionConfiguration();collisionDispatcher = new btCollisionDispatcherMt(collisionConfig, 40);solver = new btConstraintSolverPoolMt(BT_MAX_THREAD_COUNT);dynamicsWorld = new btDiscreteDynamicsWorldMt(collisionDispatcher, broadPhase, solver, collisionConfig);</code></pre></div>Am I missing something?</div></blockquote>It looks like you are not setting up a task scheduler. To use PPL you would add something like:<div class="codebox"><p>Code: </p><pre><code>btSetTaskScheduler( btGetPPLTaskScheduler() );</code></pre></div>Note that the version of bullet multithreading I just recently posted about, is still only a Pull Request -- it is not (yet) present in the main Bullet repo.<br>However you can get it here:<br><a href="https://github.com/lunkhound/bullet3" class="postlink">https://github.com/lunkhound/bullet3</a><br><br>Note the world setup is changed slightly to  allow for the new parallel solver:<div class="codebox"><p>Code: </p><pre><code>broadPhase = new btDbvtBroadphase();collisionConfig = new btDefaultCollisionConfiguration();collisionDispatcher = new btCollisionDispatcherMt(collisionConfig, 40);solverPool = new btConstraintSolverPoolMt(BT_MAX_THREAD_COUNT);parallelSolver = new btSequentialImpulseConstraintSolverMt();  // create parallel solverdynamicsWorld = new btDiscreteDynamicsWorldMt(collisionDispatcher, broadPhase, solverPool, parallelSolver, collisionConfig);btSetTaskScheduler( btCreateDefaultTaskScheduler() );  // use built-in task scheduler</code></pre></div><p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=10573">lunkhound</a> — Thu Mar 08, 2018 6:51 pm</p><hr />
]]></content>
	</entry>
	</feed>
