Systems engineer Yacine builds a CUDA 2D particle simulation that models rigid body physics without traditional solvers
It draws just 66 watts on an RTX 4090.
Users are excited about GPU-accelerated CUDA particle simulations forming rigid bodies because they call the demos cool and promising for interactive educational tools at science centers.
No Digg Deeper questions have been answered for this story yet.
Most Activity
this is GPU accelerated, no circular dependency physics "solver" (there is nothing being solved)
each particle gets a cuda thread (not literally but you get what i mean). Then it gets reduced up to what it should resolve to regarding the rigid bodies
scales great! each rectangle here is a set of discs. running on cuda. now to painfully go through all of the weird collision bugs and figure out why they're happening and why it isn't settling
this is GPU accelerated, no circular dependency physics "solver" (there is nothing being solved)
each particle gets a cuda thread (not literally but you get what i mean). Then it gets reduced up to what it should resolve to regarding the rigid bodies
Why am I doing this: I'm trying to figure out alternative physics engine pathways that are highly parallelizable that I can use for training robots in ultra optimized sims. I got mujoco up to 500k sps across 4k worlds and it wasn't enough. I want 20m steps per second
fascinating emergent pulsating behavior
fascinating emergent pulsating behavior
scales great! each rectangle here is a set of discs. running on cuda. now to painfully go through all of the weird collision bugs and figure out why they're happening and why it isn't settling
this is GPU accelerated, no circular dependency physics "solver" (there is nothing being solved)
each particle gets a cuda thread (not literally but you get what i mean). Then it gets reduced up to what it should resolve to regarding the rigid bodies

To explain what is this video: It is about a physics simulation that's super useful for: Training robots Molecular simulations Fluids & liquids Emergent behaviors Industrial design Video games Real physics
How it actually works: The CPU you see in the video is only for drawing pretty pictures on the screen. All the heavy physics calculations happen on the GPU (the graphics card). The idea is not new @nvidia researchers were already doing particle-based rigid body simulations on GPUs back in 2007-2008. But this guy (Yassin) is building his own version from scratch, optimized to be extremely fast for training robots. Each particle (every tiny circle): Calculates its own movement every single frame .. where it is, where it’s going, who it’s colliding with, and how it should bounce. All in a tiny fraction of a second. “Separate thread on the GPU” means: The GPU has thousands of tiny brains inside it. Every single particle gets its own dedicated brain (thread) that works completely independently and at the exact same time as all the others. That’s the secret to the insane speed. Current simulators like MuJoCo are too slow for serious robot training. He reached 500,000 steps per second with it but said “not enough”. His goal is 20 million steps per second. To write this code he uses CUDA 🌪 a special advanced version of C++ made for GPUs. You need to be a real C++ expert to do this. Not beginner stuff at all. The colorful rectangles in the video are just the first test. Later he’ll add virtual robots inside this super-fast simulator so the AI can train them millions of times faster than before

@yacineMTB @MatthewBerman did something similar to this. So freaking cool gentlemen.

@yacineMTB The trouble with a lot of the techniques from game development is that they cut corners to make them fast. It just has to look right at a glance. If you want the sim to match reality you’re going to have a bad time.

اللي بشوف الفيديو بيستغرب من الهبل : كرات تتناثر و تعود .. بيطلع شغل متعوب عليه جدا : عن محاكاة فيزيائية مفيد جدا للتدريب : للروبوتات المحاكاة الجزيئات علوم سوائل سلوكيات تصميم صناعي العاب فيزياء شلون : ( اللي ظهر بالفيديو: هاد بس لعرض الرسوميات، يعني بس يرسم الشكل على الشاشة. كل الحسابات والفيزياء كلها شغالة على الـ GPU (الكرت الشاشة)..الفكرة مو جديدة. ناس كثير عملت محاكاة جسيمات للأجسام الصلبة على الـ GPU من سنين (من 2007-2008 في أبحاث NVIDIA). بس هو عم يبني طريقته الخاصة عشان تكون سريعة كفاية لتدريب روبوتات. كل جسيم؟ بيحسب له حركته كل إطار. يعني: وين موقعه؟ وين رايح؟ مين عم يصدمه؟ كيف بده يرتد؟ كل هالأسئلة بيجاوب عليها في جزء من الألف من الثانية. شو يعني "thread منفصل على الـ GPU"؟ الـ GPU مو زي الكمبيوتر العادي. هو عنده آلاف المخاخ الصغيرة جواته. كل جسيم بياخد مخ واحد لوحده thread منفصل..المحاكيات الموجودة حالياً زي MuJoCo بطيئة نسبياً لما بدك تدرب روبوتات ذكية. يعني هو وصل بـ MuJoCo لـ 500 ألف خطوة في الثانية، ومع ذلك قال "ما يكفيني". هو بدو 20 مليون خطوة في الثانية.يعني ياسين لازم يكون محترف بـ C++ عشان يقدر يكتب CUDA. مو شغلة أي مبرمج.

@yacineMTB two papers down the line

@yacineMTB Think about those science centers for kids. I am thinking something virtual and programmatically interactive are going to be amazing in this arena for education.

@yacineMTB Now lets see six of them stacked on top of one another.

@yacineMTB Box2D just forces the rigidbodies to sleep once they've been sitting still a while btw. Otherwise there's persistent jitter

@int_16h i know. i'm just solving in 2d before i go to more complex 3d envs

@yacineMTB 1/ I looked at the physics for this and the collision looks fantastic. The only problem is that its a common pattern when there is a collision (overlap) to apply a counteracting force, which causes the blocks to explode(?).

@yacineMTB people were doing it this fast on raw cpu in the 90s

@yacineMTB Very nice. Don’t limit this to 60 fps, you should have a concept of how far it can be pushed before breaking!

@yacineMTB Scale it up to 100,000 particles in a bathtub and see if it does acceptable fluid physics.

@yacineMTB Walk through the algorithm step by step. This part can be a little tricky.

@yacineMTB assimilative vortex!