Repository navigation
Unify ROCM_INSTALL_DIR and ROCM_ROOT to ROCM_PATH - #440
Merged
Merged
Conversation
Standardize all ROCm installation path variables to use ROCM_PATH, aligning with TheRock infrastructure conventions. Changes: - Rename ROCM_ROOT to ROCM_PATH in all CMakeLists.txt files - Rename ROCM_INSTALL_DIR to ROCM_PATH in all Makefiles - Update build_packages.sh (variable, CLI flag --rocm-path) - Update CI workflow to pass -DROCM_PATH instead of -DROCM_ROOT - Update documentation references in README files - Rename ROCM_ROOT_PATH C++ macro to ROCM_DEFAULT_PATH in rocWMMA hiprtc_gemm example (both CMake definition and usage) Note: CMAKE_HIP_COMPILER_ROCM_ROOT in CMakePresets.json is a CMake built-in variable and is intentionally left unchanged. Addresses: ROCm#429 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Collaborator
|
For CMake I was hoping to not have to set
Would it be better if we extract this part of the CMake files into a separate file that we include to all the projects? Correct me if I'm wrong but I think it block is in every example. |
Replace the duplicated ~12-line ROCM_PATH setting block in 427
CMakeLists.txt files with a single include of a new shared module.
The new module resolves ROCM_PATH with proper priority:
1. Existing cache value (-DROCM_PATH=...)
2. $ENV{ROCM_PATH} (TheRock CI / standard ROCm)
3. $ENV{HIP_PATH} (Windows HIP SDK)
4. /opt/rocm (hardcoded fallback)
This eliminates duplication and lets CI pick up ROCM_PATH from the
environment automatically, removing the need for -DROCM_PATH on the
cmake command line.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Change include_guard(GLOBAL) to include_guard(DIRECTORY) so that each directory scope gets its own CMAKE_PREFIX_PATH update. With GLOBAL guard, only the first add_subdirectory() child to include ROCmPath.cmake would get ROCM_PATH appended to CMAKE_PREFIX_PATH — siblings would silently skip the include and their find_package() calls would fail. Also add ROCmPath.cmake include to all parent-level CMakeLists.txt files used as CI entry points (HIP-Doc, Applications, Libraries, Programming-Guide, Tutorials) so they set ROCM_PATH in parent scope before processing children. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
sshi-amd
added a commit
to sshi-amd/rocm-examples
that referenced
this pull request
Apr 23, 2026
Resolves 378 leaf-Makefile conflicts produced by upstream PR ROCm#440 which renamed ROCM_INSTALL_DIR -> ROCM_PATH and changed the assignment style from `:=` with `$(or ...)` to `?=`. Every conflict block was identical in shape, so the resolution is uniform: take upstream's ROCM_PATH form. Additional follow-up renames not covered by upstream's PR: - Common/require_deps.mk: rename internal ROCM_INSTALL_DIR -> ROCM_PATH in the amd_comgr fallback detection block. - Libraries/Makefile: same rename in the parent dispatch Makefile. - .github/workflows/build-rocm-examples-reusable.yml: drop redundant `ROCM_INSTALL_DIR=${ROCM_PATH}` env exports and the `make ROCM_INSTALL_DIR=...` argument; ROCM_PATH is already exported in the env and consumed directly by the leaf Makefiles. REQUIRED_DEPS / SKIP_BUILD wrappers added by this branch are preserved unchanged where they auto-merged cleanly. Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
sshi-amd
added a commit
to sshi-amd/rocm-examples
that referenced
this pull request
Apr 23, 2026
These leaf Makefiles were missed by upstream PR ROCm#440 (which renamed ROCM_INSTALL_DIR -> ROCM_PATH and switched := to ?= for env override support). They kept `ROCM_PATH := /opt/rocm` (hard assignment), so the CI's exported ROCM_PATH=/therock-tarball/install was overridden back to /opt/rocm and the build invoked /opt/rocm/bin/hipcc which doesn't exist in the runner container, surfacing as: make[2]: /opt/rocm/bin/hipcc: Command not found make[1]: *** [Makefile:39: ROCgdb] Error 2 Affected categories: HIP-Doc/Tutorials/Programming-Patterns (bfs, histogram_atomics, image_convolution, kmeans, matrix_multiplication), Libraries/{MIGraphX, MIVisionX, RCCL, RPP, rocAL, rocCV, rocJPEG, hipBLASLt/gemm_clamp_bias}, Tools/ROCgdb. Bulk-replaced with `?= /opt/rocm` so ROCM_PATH from env wins. Same fix that upstream PR ROCm#440 applied to the rest of the tree. Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
sshi-amd
added a commit
that referenced
this pull request
Apr 24, 2026
…n, build, and test (#442) Add Makefile build path to CI with configure-based dependency detection Adds a parallel Makefile build to CI alongside the existing CMake/CTest flow, so the standalone `make` workflow stays exercised on every commit. ## What's added - **`Scripts/configure.sh`** — autoconf-style probe for external dependencies (FFmpeg, OpenCV, GLFW3, Vulkan, libdw, amd_comgr, glslangValidator) via `pkg-config` + link tests. Writes `config.mk` at the repo root. - **`Common/require_deps.mk`** — leaf Makefiles declare `REQUIRED_DEPS := GLFW3` (etc.) and include this. If a dependency is missing, `SKIP_BUILD` is set and the leaf's main rules collapse to no-ops, so parent cascades don't error. - **`Common/find_filesystem.mk`** — probes whether `-lstdc++fs` is needed (older GCC like SLES 15.7's default) or whether `std::experimental::filesystem` is in libstdc++ proper (Ubuntu 22 / AlmaLinux 8 + gcc-toolset-13). Mirrors the existing `Common/FindFilesystem.cmake` for the Make path. ## Leaf Makefiles - ~390 leaf Makefiles updated. 28 examples with external deps gain `REQUIRED_DEPS := …` + the `ifneq ($(SKIP_BUILD),1) … else … endif` wrapper. Examples without external deps are unchanged in behavior. - All hard-coded `-lstdc++fs` (29 leaves total: 10 rocDecode + 19 others in Applications, HIP-Basic, HIP-Doc, rocJPEG, rocProfiler-SDK) converted to `$(CXX_FS_LIB)` from the new probe. - 48 leaves still using `ROCM_PATH := /opt/rocm` (hard `:=`) flipped to `?= /opt/rocm` so the env-provided path wins. Same fix that upstream PR #440 applied to the rest of the tree. - `Tools/ROCgdb/.gitignore` added; mismatched per-directory `.gitignore` entries fixed in two `warp_size_reduction` dirs. - Five previously committed binary artifacts removed. - One `EXAMPLE := <wrong>` typo fixed in `identifying_host_device_compilation_pass/Makefile`. ## CI workflow - Adds **Makefile build**, **Collect Makefile build artifacts**, and **Upload Makefile build artifacts** steps to the reusable workflow. - CMake configure / build are gated with `if: !cancelled()` so the CMake side still runs to completion when the Makefile build fails (for visibility). - AlmaLinux 8 Dockerfile picks up `pkgconf-pkg-config` (it was missing, which broke every `pkg-config` probe on AlmaLinux) and extends `PKG_CONFIG_PATH` to discover source-built FFmpeg / GLFW. ## Out of scope (deferred to follow-up PR) - Make-native `test` target (per-leaf `test:` depending on the build target, cascading from root via `make test`, with per-parent `SKIP_FROM_TEST` filter) — opened separately as a stacked PR. - Per-GPU-arch test skipping for the Make path. - Wiring up rocDecode's conditional test-data probing. Signed-off-by: zichguan-amd <zichuan.guan@amd.com> Co-authored-by: Claude (Anthropic) <noreply@anthropic.com>
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.
Standardize all ROCm installation path variables to use ROCM_PATH, aligning with TheRock infrastructure conventions.
Changes:
Note: CMAKE_HIP_COMPILER_ROCM_ROOT in CMakePresets.json is a CMake built-in variable and is intentionally left unchanged.
Addresses: #429
Test Plan
Tested through local CI
Test Result
Passed CI: https://github.com/sshi-amd/rocm-examples/actions/runs/23312401667
Added/Updated documentation?
Included Visual Studio files?
Submission Checklist