-
Notifications
You must be signed in to change notification settings - Fork 304
Add performance_tuning to jetty/tutorials #683
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ammaarrahmed
wants to merge
10
commits into
gazebosim:master
Choose a base branch
from
ammaarrahmed:jetty/tutorials/performancetuning
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
09a41ff
add performance_tuning to jetty/tutorials
ammaarrahmed 4cc73f7
Update jetty/performance_tuning.md
ammaarrahmed 6666b20
Update jetty/tutorials.md
ammaarrahmed a267372
Update jetty/performance_tuning.md
ammaarrahmed 31ddc22
Merge branch 'master' into jetty/tutorials/performancetuning
ammaarrahmed 55a7fef
Update jetty/performance_tuning.md
ammaarrahmed 4d1b450
Update jetty/performance_tuning.md
ammaarrahmed 457f83a
Addressed Performance tuning review feedback
ammaarrahmed c8de809
Merge remote-tracking branch 'origin/jetty/tutorials/performancetunin…
ammaarrahmed a9ebaeb
Remove conflict markers from performance tuning guide
ammaarrahmed File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| # Performance tuning | ||
|
|
||
| If your Jetty simulation is running below real time or the GUI feels slow, start | ||
| by identifying which part of the workload is expensive. A world with many | ||
| contacts is tuned differently from a world dominated by cameras, lidar, or | ||
| rendering. | ||
|
|
||
| ## Measure first | ||
|
|
||
| Before changing settings, enable the world statistics tools described in | ||
| [SDF Worlds](sdf_worlds). In particular, keep an eye on: | ||
|
|
||
| * real time factor (RTF) | ||
| * simulation time versus real time | ||
| * whether the slowdown appears when physics, sensors, or rendering load changes | ||
|
|
||
| This gives you a baseline before you start trading fidelity for speed. | ||
|
|
||
| ## Common performance tweaks | ||
|
|
||
| ### Reduce physics work | ||
|
|
||
| * Try less aggressive physics settings in [SDF Worlds](sdf_worlds). Larger | ||
| `<max_step_size>` values usually reduce computation, but they also reduce | ||
| accuracy and can change contact behavior. | ||
| * Use simpler collision geometry when possible. [Building your own robot](building_robot) | ||
| notes that collision geometry does not need to match the visual mesh exactly, | ||
| and simpler collisions often reduce computation time. | ||
|
|
||
| ### Reduce sensor work | ||
|
|
||
| * Lower `<update_rate>` for sensors that do not need high-frequency data. See | ||
| [Sensors](sensors). | ||
| * If you do not need the GUI, run only the server with | ||
| `gz sim -s <world.sdf>`. For individual sensors, set | ||
| `<visualize>false</visualize>` when the GUI view is not needed. | ||
| * For `gpu_lidar` sensors, reduce `<samples>` or `<resolution>` before | ||
| increasing scene complexity. See [Sensors](sensors). Lidar availability and | ||
| performance depend on rendering engine support and your GPU / driver setup. | ||
|
|
||
| ### Reduce rendering work | ||
|
|
||
| * Gazebo uses Ogre 2 by default. If you are forcing Ogre 1, compare it with the | ||
| default first. If Ogre 2 is unavailable on your machine, [Troubleshooting](troubleshooting) | ||
| explains the OpenGL requirements and how to fall back to `--render-engine ogre`. | ||
| * Reduce expensive visual effects when they are not needed. For example, disable | ||
| shadow casting on lights with | ||
| [`<light><cast_shadows>false</cast_shadows></light>`](http://sdformat.org/spec?ver=1.12&elem=light#light_cast_shadows) | ||
| or on visuals with | ||
| [`<visual><cast_shadows>false</cast_shadows></visual>`](http://sdformat.org/spec?ver=1.12&elem=visual#visual_cast_shadows). | ||
| * You can recognize PBR materials by a `<pbr>` block inside a visual's | ||
| [`<material>`](http://sdformat.org/spec?ver=1.12&elem=material#material_pbr), | ||
| often with `<metal>` or `<specular>` workflows and texture maps such as | ||
| `<albedo_map>`, `<normal_map>`, `<metalness_map>`, or `<roughness_map>`. If | ||
| rendering is the bottleneck, copy the model and replace the PBR block with | ||
| simpler `<ambient>`, `<diffuse>`, and `<specular>` colors like the examples in | ||
| [Building your own robot](building_robot), or temporarily remove | ||
| high-resolution texture maps. | ||
|
|
||
| ### Use simpler models | ||
|
|
||
| * Reduce triangle counts in imported meshes. | ||
| * Use primitive collision shapes such as boxes, spheres, and cylinders whenever | ||
| possible. If you need collision meshes, keep them convex and watertight. | ||
| * Keep visual meshes and collision meshes separate so collisions can stay simple | ||
|
ammaarrahmed marked this conversation as resolved.
|
||
| even when the visual model is detailed. | ||
| * Remove sensors, lights, or plugins from models that are not needed in a given | ||
| experiment. | ||
|
|
||
| ### Make sure Gazebo is using the right GPU | ||
|
|
||
| * On hybrid systems with both integrated and discrete GPUs, Gazebo may start on | ||
| the integrated GPU. Check the active OpenGL renderer with | ||
| `glxinfo | grep "OpenGL"`. [Troubleshooting](troubleshooting) shows how to | ||
| use PRIME render offload or Nvidia performance mode. | ||
| * If Ogre 2 fails to start, check OpenGL support and driver setup before | ||
|
ammaarrahmed marked this conversation as resolved.
|
||
| assuming the simulation itself is slow. | ||
|
|
||
| ## Advanced and external options | ||
|
|
||
| These are worth exploring for specialized workloads, but they are not part of a | ||
| small Jetty-only tuning guide: | ||
|
|
||
| * Alternative physics backends such as [Bullet Featherstone](https://github.com/gazebosim/gz-physics/issues/44) | ||
| may help some articulated systems, but they need workload-specific validation | ||
| and are not covered by a Jetty how-to yet. | ||
| * Third-party accelerators such as [RGLGazeboPlugin](https://github.com/RobotecAI/RGLGazeboPlugin) | ||
| or [gz_wgpu_rt_lidar](https://github.com/arjo129/gz_wgpu_rt_lidar/) | ||
| may be useful when GPU-accelerated sensing is the main bottleneck. Follow the | ||
| setup and support guidance in those projects. | ||
|
|
||
| Start with the documented knobs in Jetty first: physics step size, simpler | ||
| collisions, lower sensor rates, rendering settings, and correct GPU usage. | ||
| Those changes are usually easier to validate and easier to maintain across | ||
| releases. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.