You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hipconfig --version prints a spurious -9999 build-number suffix when the
HIP runtime's version file (<HIP_PATH>/share/hip/version) contains an
empty HIP_VERSION_GITHASH= line. -9999 is HIP_BASE_VERSION_DEFAULT
leaking into user-visible output, not a real value.
This trips downstream consumers that parse hipconfig --version — e.g.
rocBLAS's Tensile version-check aborts on the resulting string (see ROCm/rocm-libraries#7945).
libamdhip64-dev (src:rocm-hipamd) installs /usr/share/hip/version with HIP_VERSION_GITHASH= (empty), because CMake
couldn't populate it — the source tarball has no .git/. hipcc then falls
back to the "9999" sentinel.
hipBin_util.h:170-174 (parseConfigFile): after splitting on =, std::getline(is_line, value) fails on a line with an empty tail
(HIP_VERSION_GITHASH=), so the key is not inserted into the map.
hipBin_base.h:418-422 (readHipVersion): the missing key then falls
back to HIP_BASE_VERSION_DEFAULT ("9999", defined at hipBin_base.h:55), and the string is unconditionally concatenated as MAJOR.MINOR.PATCH-GITHASH.
Net effect: an empty githash — which is a legitimate "not a git build"
answer from the runtime's CMake — becomes the string "-9999" in hipconfig output.
Impact
Any environment where the HIP runtime is packaged from a tarball (no .git/ at build time) ships an empty HIP_VERSION_GITHASH. That
includes Debian/Ubuntu, and likely other distros doing tarball builds.
Cosmetic-but-misleading for anyone reading hipconfig --version output
directly.
Suggested fix
Treat an absent/empty HIP_VERSION_GITHASH as "no build hash" rather than
falling back to the shared "9999" sentinel. Keep the sentinel for
MAJOR/MINOR/PATCH, where a missing value really is an installation error
and the visible 9999.9999.9999 is a useful signal.
Verified with both repro shapes above: output degrades to 7.1.52801 when the hash is unavailable, and remains 7.1.52801-abc1234 when the runtime file has a real hash. Happy to open a
PR against amd-staging if the direction is acceptable.
Summary
hipconfig --versionprints a spurious-9999build-number suffix when theHIP runtime's version file (
<HIP_PATH>/share/hip/version) contains anempty
HIP_VERSION_GITHASH=line.-9999isHIP_BASE_VERSION_DEFAULTleaking into user-visible output, not a real value.
This trips downstream consumers that parse
hipconfig --version— e.g.rocBLAS's Tensile version-check aborts on the resulting string (see
ROCm/rocm-libraries#7945).
Reproduction
Shape 1 — via distro packages (Ubuntu)
libamdhip64-dev(src:rocm-hipamd) installs/usr/share/hip/versionwithHIP_VERSION_GITHASH=(empty), because CMakecouldn't populate it — the source tarball has no
.git/. hipcc then fallsback to the
"9999"sentinel.Shape 2 — portable (any distro)
Expected:
7.1.52801(no bogus suffix).Root cause
Two interacting behaviours in
amd/hipcc/src/:hipBin_util.h:170-174(parseConfigFile): after splitting on=,std::getline(is_line, value)fails on a line with an empty tail(
HIP_VERSION_GITHASH=), so the key is not inserted into the map.hipBin_base.h:418-422(readHipVersion): the missing key then fallsback to
HIP_BASE_VERSION_DEFAULT("9999", defined athipBin_base.h:55), and the string is unconditionally concatenated asMAJOR.MINOR.PATCH-GITHASH.Net effect: an empty githash — which is a legitimate "not a git build"
answer from the runtime's CMake — becomes the string
"-9999"inhipconfigoutput.Impact
.git/at build time) ships an emptyHIP_VERSION_GITHASH. Thatincludes Debian/Ubuntu, and likely other distros doing tarball builds.
MAJOR.MINOR.PATCH[-hash]with a real hash break. Concrete case:rocBLAS's
TensileCreateLibrary(shared/tensile/Tensile/Common.py)aborts with
ValueError: invalid literal for int() with base 10: '9999'when trying to convert the version components. See
[rocBLAS][Bug]: TensileCreateLibrary fails to parse hipconfig --version output starting with "HIP version:" prefix rocm-libraries#7945 for the failing build path.
hipconfig --versionoutputdirectly.
Suggested fix
Treat an absent/empty
HIP_VERSION_GITHASHas "no build hash" rather thanfalling back to the shared
"9999"sentinel. Keep the sentinel forMAJOR/MINOR/PATCH, where a missing value really is an installation error
and the visible
9999.9999.9999is a useful signal.Verified with both repro shapes above: output degrades to
7.1.52801when the hash is unavailable, and remains7.1.52801-abc1234when the runtime file has a real hash. Happy to open aPR against
amd-stagingif the direction is acceptable.Environment
hipcc-rocm: 7.2.14~git20260701.cd7668d75d+dfsg2-0ubuntu2libamdhip64-dev: 7.1.0-0ubuntu2ROCm/llvm-projectreference:amd-stagingHEAD as of filingRelated
the Tensile-side workaround there and this hipconfig-side fix are
complementary (Tensile becomes robust to any label, hipconfig stops
emitting the misleading suffix in the first place).
Reported while packaging
llvm-toolchain-rocmfor Debian/Ubuntu.