XPandora / PhysGaussian

[CVPR 2024 Highlight] PhysGaussian: Physics-Integrated 3D Gaussians for Generative Dynamics
1.07k stars 44 forks source link

Cuda error during simulation. What's the constraints on the physical parameters? #20

Open MultyXu opened 7 months ago

MultyXu commented 7 months ago

Great project! Thank you a lot for the amazing effort.

However, when I tried to play around with the values of the physical parameters, there were certain values that caused Cuda errors and the simulation fails.

Traceback (most recent call last):
  File "/home/logan/Desktop/Our_PhysGaussian/DiffPhysGaussian/gs_simulation.py", line 319, in <module>
    mpm_solver.p2g2p(frame, substep_dt, device=device)
  File "/home/logan/Desktop/Our_PhysGaussian/DiffPhysGaussian/mpm_solver_warp/mpm_solver_warp.py", line 445, in p2g2p
    wp.launch(
  File "/home/logan/miniconda3/envs/DiffPhysGaussian/lib/python3.9/site-packages/warp/context.py", line 4311, in launch
    raise e
  File "/home/logan/miniconda3/envs/DiffPhysGaussian/lib/python3.9/site-packages/warp/context.py", line 4308, in launch
    runtime.verify_cuda_device(device)
  File "/home/logan/miniconda3/envs/DiffPhysGaussian/lib/python3.9/site-packages/warp/context.py", line 3157, in verify_cuda_device
    raise RuntimeError(f"CUDA error detected: {err}")
RuntimeError: CUDA error detected: 700
Warp CUDA error 700: an illegal memory access was encountered (in function f
...
[E 04/12/24 13:56:38.429 339984] [cuda_driver.h:operator()@90] CUDA Error CUDA_ERROR_ILLEGAL_ADDRESS: an illegal memory access was encountered while calling stream_synchronize (cuStreamSynchronize)

Specifically, I'm simulating the ficus model and adjust the E, nu, and density as follows:

    "frame_num": 125,
    "nu": 2,
    "E": 1e1,
    "material": "jelly",
    "density": 20,
    "g": [0,0,0],

So, I'm wondering if there are any constraints on the physical parameters. Or there is a way to avoid this illegal memory access issue?

Thanks!

(By the way, nice profile pic from Sword Art Online haha :) )

XPandora commented 7 months ago

Hello,

Thanks for reporting this! Note that nu means the Poisson's Ratio, which has to be between 0.0 and 0.5.

RuihanGao commented 6 months ago

Hi, thanks for the great work!

I have a follow-up question about the CUDA error. If I change param E in ficus_configfrom 2e6 to 2e7, it also returns CUDA error.

CUDA Error CUDA_ERROR_ILLEGAL_ADDRESS: an illegal memory access was encountered while calling stream_synchronize (cuStreamSynchronize)

Similar problem happens to other object/scene. Do you have an overall idea what the limits of the params are?

ps: I saw other issues reporting the CUDA error, where object may deform too much and exceed the bounding box. While in my case, with increasing Young's modulus E, I would assume the deformation should be subtler, if I am getting it correctly.

XPandora commented 5 months ago

Hi Ruihan,

Thank you for your interest in our work! In this work, we utilize explicit MPM. An explicit time scheme requires smaller time steps for stiffer problems to maintain stability. If not properly managed, stability issues could cause the simulation to become unstable and potentially explode. In your case, where you increased Young's modulus E, you've made the material stiffer. To address this, I recommend reducing the substep_dt to something like 5e-5, which works in my end.

Best, Tianyi