[MAINTENANCE] Build and run CRM terrain demos without Chrono::VSG#758
Open
DanNegrut wants to merge 2 commits into
Open
[MAINTENANCE] Build and run CRM terrain demos without Chrono::VSG#758DanNegrut wants to merge 2 commits into
DanNegrut wants to merge 2 commits into
Conversation
The vehicle terrain demo directory returned early unless CH_ENABLE_MODULE_VSG was enabled, so the CRM terrain demos could not be built headless even though demo_VEH_CRMTerrain_WheeledVehicle and demo_VEH_CRMTerrain_TrackedVehicle have complete no-VSG code paths. Build those two whenever CH_ENABLE_MODULE_FSI_SPH is enabled. demo_VEH_CRMTerrain_MovingPatch includes VSG headers unconditionally and remains gated on VSG. With VSG enabled, the demo set is unchanged.
Both demo_VEH_CRMTerrain_WheeledVehicle and _TrackedVehicle dereferenced the null visualization system in their simulation loops when built and run without a run-time visualization module. Guard the Synchronize and Advance calls with if(vis), and include ChVehicleVisualSystem.h in the tracked demo (previously pulled in only transitively through the VSG headers). Verified headless on Windows 11 with an AMD Radeon 8060S (gfx1151, HIP backend); the null dereference is platform-independent.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
src/demos/vehicle/terrain/returned early unlessCH_ENABLE_MODULE_VSGwas enabled, so the CRM terrain demos could not be built headless even thoughdemo_VEH_CRMTerrain_WheeledVehicleanddemo_VEH_CRMTerrain_TrackedVehiclehave complete no-VSG code paths (guarded includes,render = falsefallback). In addition, both demos unconditionally dereferenced the (null) visualization system inside the simulation loop, so a headless build would have crashed at the first step.Changes:
CH_ENABLE_MODULE_FSI_SPHis enabled, with or without VSG. With VSG enabled, the built demo set is unchanged.demo_VEH_CRMTerrain_MovingPatchincludes VSG headers unconditionally and remains gated on VSG (possible follow-up).vis->Synchronize()/vis->Advance()calls withif (vis)in both demos, and includechrono_vehicle/ChVehicleVisualSystem.hdirectly in the tracked demo (previously reached only transitively through the VSG headers).Related Issue(s)
None open. The null dereference was unreachable before, precisely because the CMake gate made headless builds of these demos impossible.
Author(s)
Dan Negrut, University of Wisconsin-Madison ([email protected])
Licensing
By submitting this pull request, I agree, that my contribution will be included in Chrono and redistributed under the BSD-3-Clause License.
Backward Compatibility
None affected. With
CH_ENABLE_MODULE_VSG=ON, the demo list and runtime behavior are identical to before; theif (vis)guards are no-ops when a visualization system exists.Detailed Description
Verified headless (no VSG/Irrlicht/OpenGL modules) on Windows 11 building with the AMD HIP SDK 7.1.1 on a Radeon 8060S (gfx1151): both demos build and run; the wheeled demo drives the full CRM patch to completion, and the tracked demo advances with per-step RTF telemetry and CSV output. The underlying null dereference is platform-independent; any headless CUDA/Linux build of these demos would crash the same way.
Post Submission Checklist