Is there a solution to the buffer overflow?

Hello everyone,

I am trying to use Isaac Lab to apply reinforcement learning to an original Hexapod Robot. However, I am encountering the following error.

2024-07-11 06:56:38 [26,663ms] [Error] [omni.physx.plugin] PhysX error: Patch buffer overflow detected, please increase its size to at least 372736 in the scene desc!
, FILE /builds/omniverse/physics/physx/source/gpunarrowphase/src/PxgNarrowphaseCore.cpp, LINE 1272
2024-07-11 06:58:10 [118,262ms] [Error] [omni.physx.plugin] PhysX error: Patch buffer overflow detected, please increase its size to at least 351088 in the scene desc!
, FILE /builds/omniverse/physics/physx/source/gpunarrowphase/src/PxgNarrowphaseCore.cpp, LINE 1272
2024-07-11 06:58:10 [118,380ms] [Error] [omni.physx.plugin] PhysX error: Patch buffer overflow detected, please increase its size to at least 320646 in the scene desc!
, FILE /builds/omniverse/physics/physx/source/gpunarrowphase/src/PxgNarrowphaseCore.cpp, LINE 1272
2024-07-11 06:58:10 [118,774ms] [Warning] [omni.kit.notification_manager.manager] PhysX error: Patch buffer overflow detected, please increase its size to at least 351088 in the scene desc!

From this conversation, I understand that I need to manually extend the buffer. However, I am unsure where to implement this in the code.
Does anyone have a solution?
Also, are there any examples besides those in the official Isaac Lab documentation that you would recommend for reference?

Under whatever environment name that inherits from ManagerBasedRLEnvCfg you can set this parameter via:

self.sim.physx.gpu_max_rigid_patch_count = 1024 * 1024 * 4

For isaac reach you can find this under lift_env_cfg.py at the bottom of the file.

See line 218 +:

Hi. The answer of @kevinjoseph774 is instructive. U can set those parameters below in the env u create, which inherits from ManagerBasedRLEnvCfg.

At the front of the file (for example, velocity_env_cfg.py), u need to import:
from omni.isaac.lab.envs import ManagerBasedRLEnvCfg

At the class (env) u create, u need to add (for example):
class LocomotionVelocityRoughEnvCfg(ManagerBasedRLEnvCfg):
def post_init(self):
self.sim.physx.gpu_temp_buffer_capacity = 16777216
self.sim.physx.gpu_max_rigid_patch_count = 327680

Note the number needs to be changed according to ur GPU capacity.

By the way, PhysCfg lists the details of the parameters.

Thank you all.
I’m using Direct Workflow, can I extend the buffer in the same way?

You can always increase the buffer in the USD file you are trying to simulate, the parameters are on a physicsScene primitive, one can change them like this:

from pxr import PhysxSchema

physxSceneAPI = PhysxSchema.PhysxSceneAPI.Apply(physics_scene_prim)
physxSceneAPI.CreateGpuTempBufferCapacityAttr(16 * 1024 * 1024 * 2)        
physxSceneAPI.CreateGpuHeapCapacityAttr(64 * 1024 * 1024 * 2)

Regards,
Ales

Thank you @AlesBorovicka .
I’ll give it a try.