Skip to content

Conversation

ScottTodd
Copy link
Member

See ROCm/TheRock#526 and ROCm/TheRock#583. Together, these changes help get the CMake configure + build steps for PyTorch on Windows further along.

Fix find_path search in the case where hipconfig with no suffix is not present

When using find_path, CMake searches for "a directory containing the named file". On Windows, hipconfig has three extensions: .bat, .exe, and .pl. None of these match the unsuffixed search pattern, so this adds a ${CMAKE_EXECUTABLE_SUFFIX} there.

Remove .bat suffix appending in favor of using the .exe discovered by find_program

The find_program(HIP_HIPCC_EXECUTABLE NAMES hipcc ...) and find_program(HIP_HIPCONFIG_EXECUTABLE NAMES hipconfig ...) commands should both find programs with the .exe suffix. Per the docs, they will not find programs with .bat or .sh suffixes unless those suffixes are explicitly requested: https://cmake.org/cmake/help/latest/command/find_program.html.

To search for scripts, specify an extension explicitly:

if(WIN32)
  set(_script_suffix .bat)
else()
  set(_script_suffix .sh)
endif()

find_program(MY_SCRIPT NAMES my_script${_script_suffix})

The code from 73b520a and 952028a appended a .bat suffix onto discovered file names where I believe the original names should just be used instead. I might be missing some edge case where .bat is needed, but I don't see any other context on those commits.

adeljo-amd and others added 30 commits April 10, 2025 14:59
Bumps [rocm-docs-core[api_reference]](https://github.com/ROCm/rocm-docs-core) from 1.15.0 to 1.17.0.
- [Release notes](https://github.com/ROCm/rocm-docs-core/releases)
- [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md)
- [Commits](ROCm/rocm-docs-core@v1.15.0...v1.17.0)

---
updated-dependencies:
- dependency-name: rocm-docs-core[api_reference]
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [sphinxcontrib-doxylink](https://github.com/sphinx-contrib/doxylink) from 1.12.4 to 1.13.0.
- [Release notes](https://github.com/sphinx-contrib/doxylink/releases)
- [Changelog](https://github.com/sphinx-contrib/doxylink/blob/master/CHANGELOG.md)
- [Commits](sphinx-contrib/doxylink@1.12.4...1.13.0)

---
updated-dependencies:
- dependency-name: sphinxcontrib-doxylink
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [rocm-docs-core[api_reference]](https://github.com/ROCm/rocm-docs-core) from 1.17.0 to 1.17.1.
- [Release notes](https://github.com/ROCm/rocm-docs-core/releases)
- [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md)
- [Commits](ROCm/rocm-docs-core@v1.17.0...v1.17.1)

---
updated-dependencies:
- dependency-name: rocm-docs-core[api_reference]
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [rocm-docs-core[api_reference]](https://github.com/ROCm/rocm-docs-core) from 1.17.1 to 1.18.1.
- [Release notes](https://github.com/ROCm/rocm-docs-core/releases)
- [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md)
- [Commits](ROCm/rocm-docs-core@v1.17.1...v1.18.1)

---
updated-dependencies:
- dependency-name: rocm-docs-core[api_reference]
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [rocm-docs-core[api_reference]](https://github.com/ROCm/rocm-docs-core) from 1.18.1 to 1.18.2.
- [Release notes](https://github.com/ROCm/rocm-docs-core/releases)
- [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md)
- [Commits](ROCm/rocm-docs-core@v1.18.1...v1.18.2)

---
updated-dependencies:
- dependency-name: rocm-docs-core[api_reference]
  dependency-version: 1.18.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
There is no effect on warpSize
neon60 and others added 2 commits May 9, 2025 14:57
* Fix find_path search in the case where `hipconfig` with no suffix is not present
* Remove `.bat` suffix appending in favor of using the `.exe` discovered by `find_program`
ScottTodd added a commit to ROCm/TheRock that referenced this pull request May 13, 2025
Fixes #526. Upstream PR:
ROCm/hip#3789.

* The `find_path` here is looking for the directory containing
`hipconfig`. On Windows, `hipconfig` has the `.exe` suffix.
* The `_EXECUTABLE` code has the option of `.bat` or `exe` suffixes for
`hipcc` and `hipconfig` as both versions exist. CMake's `find_program`
only finds the `.exe` versions, so that code should not append `.bat`
onto the `.exe` (e.g. `hipconfig.exe.bat`).

---------

Co-authored-by: Aaryaman Vasishta <[email protected]>
@neon60 neon60 force-pushed the docs/develop branch 2 times, most recently from 4570cbe to c90f039 Compare June 7, 2025 14:50
@marbre
Copy link
Member

marbre commented Jun 24, 2025

Whereas this should only upstream https://github.com/ROCm/TheRock/blob/46251085731276a9cef9be2a074e4ed9a4f77900/patches/amd-mainline/HIP/0001-Fix-FindHIP.cmake-search-for-hipconfig.patch I think it targets the wrong branch ROCM:docs/develop and therefore got into a weird state.

@ScottTodd do you prefer to update the target branch or should we reopen a PR?

@ScottTodd
Copy link
Member Author

Whereas this should only upstream https://github.com/ROCm/TheRock/blob/46251085731276a9cef9be2a074e4ed9a4f77900/patches/amd-mainline/HIP/0001-Fix-FindHIP.cmake-search-for-hipconfig.patch I think it targets the wrong branch ROCM:docs/develop and therefore got into a weird state.

@ScottTodd do you prefer to update the target branch or should we reopen a PR?

The last time I sent a similarly simple change (#3785), I was informed privately to redirect to the docs/develop branch since that is the only branch that accepts contributions from public GitHub. Looks like the docs/develop branch was force pushed to since I opened this PR and no maintainers reviewed it. I can rebase or redirect as needed, but I can't do so without some guidance.

@ScottTodd
Copy link
Member Author

Closing in favor of ROCm/rocm-systems#421

@ScottTodd ScottTodd closed this Sep 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants