16 - Simulation on the GPU

  Рет қаралды 19,718

Ten Minute Physics

Ten Minute Physics

Күн бұрын

I teach you all you need to know to write your own physics simulations on the GPU! I use python in connection with the nvidia python extension warp as a simple way to write GPU simulations.
Links:
Ten Minute Physics Page:
matthias-research.github.io/p...
Nvidia Warp Documentation:
developer.nvidia.com/warp-python
Warp on GitHub:
github.com/NVIDIA/warp
Installing Python with Visual Studio Code:
code.visualstudio.com/docs/py...
Python extensions to get PyOpenGL:
www.lfd.uci.edu/~gohlke/pytho...

Пікірлер: 29
@sean_vikoren
@sean_vikoren 2 жыл бұрын
This is really incredible content. My deepest gratitude.
@imaginingPhysics
@imaginingPhysics Ай бұрын
Love it. Keep making more! Especially more stuff with shaders! Thanks.
@vn6174
@vn6174 2 жыл бұрын
This series is truely amazing! Thank you for your effort and content!
@aditya_a
@aditya_a Жыл бұрын
This is so great, thank you so much! Will be super helpful when I will self study physically based animation next semester
@7steelrainbow
@7steelrainbow 2 жыл бұрын
In some paper (and the presentation slide in Eurographics 17 by Macklin) I've seen the word 'tail' used accounting for a hybrid method but I had no clue what that tail meant without seeing the distribution graph, and thus couldn't understand what "process everything else with Jacobi" meant in the slide. Finally I found the answer! Your tutorial video is like a gift to who struggles to understand PBD by oneself outside the academic field. I've read someone saying that it's a great supplement to PBD papers and I totally agree. Not only for PBD, the tutorials help me learn implementing physics simulation nicely in general. I deeply appreciate your sharing the knowledge.
@fizixx
@fizixx Жыл бұрын
New subscriber here. I have to commend you for citing a previous video (#9), and then seeing that you number your videos so "#9" could actually be located! That's a great touch I wish other y-tbrs' did that. 😎
@sublucid
@sublucid 2 жыл бұрын
Awesome example! I just submitted a PR to the pages repo which improves the framerate by ~15fps on my 3080 (with a minor tweak to the targetFps timing code). Thank you for these informative examples!
@seeyouinthenextlifeprobably
@seeyouinthenextlifeprobably Жыл бұрын
looking forward to watching next videos
@zeyingxu9788
@zeyingxu9788 2 жыл бұрын
Thank you sir very much for this amazing tutorial.
@ilivethatway
@ilivethatway 2 жыл бұрын
Great content, as always :3
@adinesh7989
@adinesh7989 2 жыл бұрын
Thank you Mathias ❤
@PawelGrzelak
@PawelGrzelak 10 ай бұрын
Thank you, great info source
@JoshyLats
@JoshyLats 2 жыл бұрын
Thanks so much, this is so good
@johnpelitidis6297
@johnpelitidis6297 4 ай бұрын
You are amazing.
@okifunearl8511
@okifunearl8511 Жыл бұрын
soooooo Very looking forward to the next tutorial😶
@anomyymi0108
@anomyymi0108 2 жыл бұрын
What a timing, just yesterday left a comment about wondering how parallelization issues like these are solved by the pros. Okay so now how do you do self-collision? I feel like you doing the hashing only every N substeps was foreshadowing something ... But excellent stuff, thank you.
@TenMinutePhysics
@TenMinutePhysics 2 жыл бұрын
Thanks. Yes, I plan to do a tutorial on hashing on the GPU at some point. The algorithm is a bit different from the one for the CPU I explained in tutorial 11.
@ZioBlu
@ZioBlu 2 жыл бұрын
Really fantastic class. I've been following every new video. It's really generous of you, I've been learning a lot and I'm very grateful. I have a question: I see that colored graphs are used to be able to parallelize the springs solver without using "mutexes" (I'm not a GPU expert, so not sure this is the right terminology). When the Jacobi Solver is used instead (for stretch/bend springs, from what I can understand), constraints are not colored, and the result is written to a temporary delta corrections array right away. What I don't understand is, if we don't use colored constraints here, won't I still incur into racing conditions when writing to the temporary corrections array? I didn't see the use of any mutex in the code to avoid this for this specific case. Thank you again! EDIT: Sorry, after re-watching the video, I realized the the atomic add command takes care of thread synchronization.
@r.d.7575
@r.d.7575 Жыл бұрын
Great video! Warp sounds like a wonderful invention. But, the graph edge colouring sounds a bit unclear. Could you make a separate video on that ?
@samuelyigzaw
@samuelyigzaw 2 жыл бұрын
This is exactly what I've been looking for! I couldn't find anything on doing physics on GPUs. I think one of the reasons was that the constraints contain branching, which GPUs aren't good for. I'm not sure if that's correct, so please let me know if I'm wrong there. Also, I'm wondering why you move the positions out of the GPU in order to render them. Aren't they in the perfect spot to be rendered? The GPU is where the particle shaders are after all. If I'm confused, please let me know, thanks!
@theojonchier1554
@theojonchier1554 2 жыл бұрын
My understanding is that there is no direct translation from Warp to OpenGL buffer. Each has a separate context and thus reading a buffer created from warp would just be an access violation if read from OpenGL. If you do everything using GL or Vulkan compute this limitation would be gone.
@oostenjadenhtv
@oostenjadenhtv Жыл бұрын
It seems that scaling the correction vectors by 1/4 is prone to explosions in high detailed tetrahedral meshes. To compensate, I scale the correction vectors by 1/(num adjacent constraints) but as you state in the notes, this causes a violation of energy conservation (which I am observing in my implementation). Do you have any tips on how to recover from this while keeping the simulation stable?
@WinstonDodson
@WinstonDodson 2 жыл бұрын
Mathias - great video. I would like to run the code on a google colab runtime. Do you have any hints? Thanks!
@K31TH3R
@K31TH3R Жыл бұрын
I know this is a long shot, but do you by any chance still have the Novodex Physics Rocket tech demo? It has essentially vanished from the internet with no working mirrors. I think it would be amazing to compare the performance on modern CPU's. Sorry for the off topic comment, and thanks for any response!
@naztar4323
@naztar4323 7 ай бұрын
I am new to this but I just want to know why cant conjugate gradient be used to slove the constraints in parrarel
@robertoguerra5375
@robertoguerra5375 Ай бұрын
Can someone simulate a gearbox or a pulley system?
@robbie_
@robbie_ Жыл бұрын
How is collision detection performed?
@praveenkumar-tu1sj
@praveenkumar-tu1sj 7 ай бұрын
Can you tell in MATLAB code to sir
@perpetualrabbit
@perpetualrabbit 4 ай бұрын
Unfortunate that you use X for position and P also for position. This is very confusing for me because P usually is used for momentum in physics, which is vector velocity times mass for a particle.
18 - How to write a FLIP water / fluid simulation running in your browser
12:20
11 - Finding collisions among thousands of objects blazing fast
11:04
Ten Minute Physics
Рет қаралды 22 М.
World’s Largest Jello Pool
01:00
Mark Rober
Рет қаралды 116 МЛН
Schoolboy - Часть 2
00:12
⚡️КАН АНДРЕЙ⚡️
Рет қаралды 11 МЛН
Little brothers couldn't stay calm when they noticed a bin lorry #shorts
00:32
Fabiosa Best Lifehacks
Рет қаралды 8 МЛН
Slow motion boy #shorts by Tsuriki Show
00:14
Tsuriki Show
Рет қаралды 10 МЛН
Writing Code That Runs FAST on a GPU
15:32
Low Level Learning
Рет қаралды 550 М.
Modern Python logging
21:32
mCoding
Рет қаралды 171 М.
17 - How to write an Eulerian fluid simulator with 200 lines of code.
12:05
Ten Minute Physics
Рет қаралды 290 М.
A 1,000,000,000 Particle Simulation! 🌊
6:36
Two Minute Papers
Рет қаралды 691 М.
How do Video Game Graphics Work?
21:00
Branch Education
Рет қаралды 3,5 МЛН
Coding Adventure: Simulating Fluids
47:52
Sebastian Lague
Рет қаралды 1,7 МЛН
01 - Writing a physics simulation in 10 minutes
12:45
Ten Minute Physics
Рет қаралды 26 М.
I've been using Redis wrong this whole time...
20:53
Dreams of Code
Рет қаралды 348 М.
World’s Largest Jello Pool
01:00
Mark Rober
Рет қаралды 116 МЛН