-
Notifications
You must be signed in to change notification settings - Fork 305
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 1 commit
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,84 @@ | ||
| # 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). | ||
| * Turn off visualization when you do not need it. | ||
| * For lidar, reduce the number of samples or resolution before increasing scene | ||
| complexity. | ||
| * If a GPU-backed lidar fits your use case, consider `gpu_lidar` in | ||
|
ammaarrahmed marked this conversation as resolved.
Outdated
|
||
| [Sensors](sensors). It requires Ogre 2. | ||
|
ammaarrahmed marked this conversation as resolved.
Outdated
|
||
|
|
||
| ### Reduce rendering work | ||
|
|
||
| * Jetty uses Ogre 2 by default. If you are forcing Ogre 1, compare it with the | ||
|
ammaarrahmed marked this conversation as resolved.
Outdated
|
||
| 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 `<cast_shadows>false</cast_shadows>` and prefer | ||
|
ammaarrahmed marked this conversation as resolved.
Outdated
|
||
| simpler materials if rendering is the bottleneck. | ||
| * If your scene uses PBR materials and rendering is the bottleneck, test simpler | ||
|
ammaarrahmed marked this conversation as resolved.
Outdated
|
||
| materials or Ogre 1 as a comparison point. PBR is supported by render engines | ||
| such as Ogre 2, but it is not free. | ||
|
|
||
| ### Use simpler models | ||
|
|
||
| * Reduce triangle counts in imported meshes. | ||
|
ammaarrahmed marked this conversation as resolved.
|
||
| * 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 Intel / Nvidia systems, Gazebo may start on the integrated GPU. | ||
|
ammaarrahmed marked this conversation as resolved.
Outdated
|
||
| [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){.external} | ||
| 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){.external} | ||
| or [gz_wgpu_rt_lidar](https://github.com/arjo129/gz_wgpu_rt_lidar/){.external} | ||
|
ammaarrahmed marked this conversation as resolved.
Outdated
|
||
| 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. | ||
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
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.