Debian Patches

Status for rocm-hipamd/5.2.3-13

Patch Description Author Forwarded Bugs Origin Last update
0001-Clang-version-munging.patch Clang version munging Maxime Chambonnet <maxzor@maxzor.eu> yes 2022-02-11
0002-fix-cmake-library-notfound-check.patch fix cmake library notfound check
If find_library does not find the library, the given variable is
set with a value that has a -NOTFOUND suffix. For example, the
CLANGRT_BUILTINS variable will be set with the value
CLANGRT_BUILTINS-NOTFOUND.
Cordell Bloor <cgmb@slerp.xyz> no 2022-10-24
0003-hip-config.cmake.patch hip-config.cmake Maxime Chambonnet <maxzor@maxzor.eu> no 2022-01-27
0004-hip-cmake-install.patch hip cmake install Maxime Chambonnet <maxzor@maxzor.eu> no 2022-02-08
0005-clang-15.patch cram clang-15 into build paths tienne Mollier <emollier@debian.org> yes 2022-07-03
0007-isystem-removal.patch -isystem breaks proper order of C and C++ include paths The addition of |-isystem "$HIP_CLANG_INCLUDE_PATH/.."| to HIPCXXFLAGS and
HIPCFLAGS needs to be removed from hipcc [1]. Once HIP is installed in /usr,
hipcc ends up passing -isystem /usr/include, which breakes the proper order of
C and C++ include paths. If I understand correctly, it's unnecessary for hipcc
to pass these flags anyway. A patch to remove them will eventually be made
upstream.
Cordell Bloor <cgmb-deb@slerp.xyz> yes 2022-06-01
0008-dotdots.patch adjust dotdots directories around _IMPORT_PREFIX Note the patch has been partially applied around ROCm 5.2, so there could be a
consistency issue if the below code were to not be necessary anymore.
Cordell Bloor <cgmb-deb@slerp.xyz> yes 2022-06-02
0009-devicelib-searchpath.patch remove check on amdgcn/bitcode The device libraries are not found correctly by default and the if (NOT
EXISTS ${AMD_DEVICE_LIBS_PREFIX}/amdgcn/bitcode) check is triggered [6]. I
think the goal upstream is to eventually remove this from the hip::device
interface entirely, but for now just correcting the search paths would be a
good step.
Cordell Bloor <cgmb-deb@slerp.xyz> yes 2022-06-04
0010-gnuinstalldirs.patch hipamd is not consistently using GNUInstallDirs Quoting the exchange:
.
the PACKAGE_PREFIX_DIR defined on line 27 of hip-config.cmake needs one
more "../". Though, that seems to come from CMakePackageConfigHelpers [3],
so I'm not sure why it's inaccurate.
.
I now believe the problem is that hipamd is not consistently using
GNUInstallDirs. Jeremy Newton has proposed a more complete patch upstream, but
a small change is sufficient to fix this particular issue:
Cordell Bloor <cgmb-deb@slerp.xyz> not-needed upstream, https://lists.debian.org/debian-ai/2022/06/msg00002.html 2022-06-14
0011-enable-prevega.patch enable support for pre-Vega GPU. This eases testing of unsupported cards upstream; may be kept around in case
the debian project were to want to support those cards.
tienne Mollier <emollier@debian.org> not-needed 2022-06-15
0012-typo.patch fix typo caught by lintian. tienne Mollier <emollier@debian.org> yes 2022-06-18
0013-hipcc-hip-version.patch enforce --hip-version option within hipcc call. This change is needed since the normal mechanism in ROCm relies on
reading a .hipVersion hidden configuration file which has no proper
equivalent in a FHS compliant tree, as of ROCm 5.0.
Cordell Bloor <cgmb-deb@slerp.xyz> not-needed upstream 2022-07-04
0014-gcc-12.patch fix ftbfs with gcc-12 This is a, quite possibly ugly, hack to fix a failure to build from source
due to the missing definition of `noinline`, which is supposed to be a
compiler specific __attribute__ flag (for some reason it isn't recognized).
tienne Mollier <emollier@debian.org> yes upstream 2022-07-23
0015-default-hip-clang-path.patch HIP_CLANG_PATH: add check for clang in /usr/bin Cordell Bloor <cgmb@slerp.xyz> not-needed 2022-09-18
0016-default-device-lib-path.patch DEVICE_LIB_PATH: add check for multiarch dirs Cordell Bloor <cgmb@slerp.xyz> no 2022-09-18
0017-default-rocm-path.patch ROCM_PATH: use /usr as default Cordell Bloor <cgmb@slerp.xyz> not-needed 2022-09-18
0018-rocm-path-flag.patch pass rocm_path as flag Cordell Bloor <cgmb@slerp.xyz> not-needed 2022-09-19
0019-fix-git-version-info.patch [PATCH] SWDEV-335902 - Fix HIP when Git info unavailable
Prior to this change, when Git_FOUND was false, HIP_VERSION_BUILD_ID
would be undefined in the CMake code. The value of HIP_VERSION_BUILD_ID
in <hip/hip_version.h> is taken from the CMake variable, so it was being
defined as nothing in those cases. That would cause compilation failures,
as src/hip_global.cpp contains the function:

size_t amd_dbgapi_get_build_id() {
return HIP_VERSION_BUILD_ID;
}

which would become

size_t amd_dbgapi_get_build_id() {
return ;
}

after preprocessing. To prevent this, we can define the version
information to a default value when Git is not found.

A related problem was reported by Harmen Stoppels in
https://github.com/ROCm-Developer-Tools/HIP/pull/2218. When Git
is not available (or if the library is being built from a tarball),
the HIP_VERSION_GITHASH is not defined. This causes trouble because
HIP_LIB_VERSION_STRING is defined as "X.Y.Z-${HIP_VERSION_GITHASH}"
and therefore becomes "X.Y.Z-".

The incomplete version string becomes a problem when it is appended
to the shared library file name. File names that end with '-' confuse
the linker. They cause strange errors when attempting to link to the
HIP library. This problem can be prevented by dropping the trailing
dash and using "X.Y.Z" as the version string when HIP_VERSION_GITHASH
is not defined.
Cordell Bloor <Cordell.Bloor@amd.com> no 2022-05-06
0020-hipcc-remove-rpath-flags.patch hipcc remove rpath flags Cordell Bloor <cgmb@slerp.xyz> not-needed 2022-10-21
0020-replace-x86_64-with-variables.patch replace x86_64 with variables
The changes to hipcc.pl and hip_embed_pch won't allow cross-compiling,
but they will enable the build to proceed on other architectures.
Cordell Bloor <cgmb@slerp.xyz> yes upstream 2023-02-14
0021-fix-default-cmake-build-on-unsupported-gpus.patch fix default cmake build on unsupported gpus
If AMDGPU_TARGETS is not set (or is set to nothing), then hipcc and
clang will autodetect the installed hardware. This default, however,
prevents that autodetection by setting it to a specific set of values.
Cordell Bloor <cgmb@slerp.xyz> not-needed 2023-02-17
0022-fix-hip-config-for-c-projects.patch fix hip-config for c projects
When the CXX language is not enabled, then CMAKE_CXX_COMPILER_ID will
not be defined and (if unquoted) the left side of the comparison will
evaluate to nothing and therefore be a syntax error. Quoting the
variable ensures that even if the variable is undefined, the left side
of the comparison will be the empty string and therefore avoid a syntax
error.
Cordell Bloor <cgmb@slerp.xyz> no debian 2023-05-22
0023-make-hipcc-and-hipconfig-optional.patch make hipcc and hipconfig optional
The set_and_check macro is essentially just

set(var "${file}")
if(NOT EXISTS "${file}")
message(FATAL_ERROR ...)
endif()

so it can be made optional by first doing the exists check and only
doing the set if the file does exist.
Cordell Bloor <cgmb@slerp.xyz> no debian 2023-05-22
0024-fix-hipconfig-check.patch fix hsa path Cordell Bloor <cgmb@slerp.xyz> not-needed debian 2023-05-22
0025-improve-rocclr-isa-compatibility-check.patch improve rocclr isa compatibility check
There are a number of ISAs that are identical to each other, but are
not being treated as compatible by the upstream project. This more
sophisticated ISA compatibility check significantly reduces the number
of code objects that must be included in a binary in order to support
a wide variety of processors.

This change to rocclr is useless on its own because there are multiple
places in the ROCm stack where kernels are checked for compatibility.
However, when combined with matching changes within rocr and hipamd,
this patch should allow HIP to load compatible kernels even when the
GFX ISA number is not an exact match.
Cordell Bloor <cgmb@slerp.xyz> no 2022-07-13
0026-extend-hip-isa-compatibility-check.patch extend hip isa compatibility check
There are a number of ISAs that are identical to each other, but are
not being treated as compatible by the upstream project. This more
sophisticated ISA compatibility check significantly reduces the number
of code objects that must be included in a binary in order to support
a wide variety of processors.

This change to hipamd is useless on its own because there are multiple
places in the ROCm stack where kernels are checked for compatibility.
However, when combined with matching changes within rocr and rocclr,
this patch should allow HIP to load compatible kernels even when the
GFX ISA number is not an exact match. This should make it unnecessary
to use the HSA_OVERRIDE_GFX_VERSION variable.

The HIP runtime needed to be adjusted such that it considered all
compatible kernels and so that it could choose to load the best one,
rather than the original behaviour in which it was only possible for
there to be a single compatible kernel.

For binaries that are built for gfx900, gfx1010 and gfx1030, these
changes will enable compatibility with gfx902, gfx909, gfx90c, gfx1012,
gfx1031, gfx1032, gfx1033, gfx1034, gfx1035, and gfx1036.

I began working on this set of patches a week or two before my daughter
was born. In fact, I was working on them when I was interrupted by a
phone call from my wife informing me that it was time. My very patient
wife gave me a couple hours to wrap things up, but I did not quite
finalize the patch set before we had to leave for the hospital. The
days, weeks, and months that followed were a whirlwind of life changes
and it took me a very long time to get back to finish what I started.

This patch is dedicated to Adeline Bloor. Many people have been waiting
for this functionality, but nobody else had to wait for these patches
before they were born.
Cordell Bloor <cgmb@slerp.xyz> no 2022-07-25
0027-device-Add-missing-include.patch device: Add missing include
Newer GCC's seem to require this.
Jeremy Newton <Jeremy.Newton@amd.com> no https://github.com/ROCm-Developer-Tools/clr/commit/70bdb7a5970d0c518c4ed494ea8cbb129ed3c598 2023-06-16
0028-reduce-clangrt-error-to-warning.patch reduce clangrt error to warning
clangrt builtins doesn't exist for all architectures and I think
it's only needed for programs using FP16 anyway, so it's not a strictly
necessary component.
Cordell Bloor <cgmb@slerp.xyz> no 2023-06-23
0029-restrict-hiprtc-cmake-search-to-clang-15.patch restrict hiprtc cmake search to clang-15
Restrict the LLVM find_package search to clang-15 and ensure that the
search for clang prefers the same package found for LLVM. This is not
a problem for the upstream project, as it only ships one version of
clang.
Cordell Bloor <cgmb@slerp.xyz> not-needed 2023-06-27
0030-fix-hip-graph-nullptr-deref.patch fix hip graph nullptr deref
This fixes a FTBFS with gcc-13 due to -Werror=nonnull. GCC refused to
compile this branch of the function because it would always dereference
a null pointer if it were executed.

This function was deleted entirely in ROCm 5.6.0, so the problem will
be fully resolved once the library is updated to the latest upstream
version.
Cordell Bloor <cgmb@slerp.xyz> not-needed 2023-07-22

All known versions for source package 'rocm-hipamd'

Links