16 - Simulation on the GPU
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
Love it. Keep making more! Especially more stuff with shaders! Thanks.
This is really incredible content. My deepest gratitude.
This series is truely amazing! Thank you for your effort and content!
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.
This is so great, thank you so much! Will be super helpful when I will self study physically based animation next semester
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. 😎
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!
Great content, as always :3
looking forward to watching next videos
Thank you sir very much for this amazing tutorial.
Thank you Mathias ❤
Thanks so much, this is so good
Thank you, great info source
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
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.
You are amazing.
soooooo Very looking forward to the next tutorial😶
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.
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 ?
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?
Mathias - great video. I would like to run the code on a google colab runtime. Do you have any hints? Thanks!
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
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.
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!
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.
I am new to this but I just want to know why cant conjugate gradient be used to slove the constraints in parrarel
How is collision detection performed?
Can someone simulate a gearbox or a pulley system?
Can you tell in MATLAB code to sir