from /var/tmp/portage/dev-util/hip-4.1.0/work/HIP-rocm-4.1.0/rocclr/hip_rtc.cpp:22: /usr/include/rocclr/platform/command.hpp: In constructor ‘amd::ClGlEvent::ClGlEvent(amd::Context&)’: /usr/include/rocclr/platform/command.hpp:327:41: error: ‘CL_COMMAND_GL_FENCE_SYNC_OBJECT_KHR’ was not declared in this scope 327 | ClGlEvent(Context& context) : Command(CL_COMMAND_GL_FENCE_SYNC_OBJECT_KHR), context_(context) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /var/tmp/portage/dev-util/hip-4.1.0/work/HIP-rocm-4.1.0/rocclr/hip_internal.hpp:25, from /var/tmp/portage/dev-util/hip-4.1.0/work/HIP-rocm-4.1.0/rocclr/hiprtc_internal.hpp:24, ------------------------------------------------------------------- This is an unstable amd64 chroot image at a tinderbox (==build bot) name: 17.1_developer-j2-20210510-220140 ------------------------------------------------------------------- gcc-config -l: [1] x86_64-pc-linux-gnu-7.3.1 [2] x86_64-pc-linux-gnu-9.3.1 [3] x86_64-pc-linux-gnu-11.1.0 * clang version 12.0.0 Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/lib/llvm/12/bin /usr/lib/llvm/12 12.0.0 Python 3.8.10 Available Ruby profiles: [1] ruby26 (with Rubygems) [2] ruby30 (with Rubygems) * Available Rust versions: [1] rust-bin-1.52.1 [2] rust-1.52.1 * The following VMs are available for generation-2: 1) IcedTea JDK 3.18.0 [icedtea-8] 2) JamVM JDK 2.0.0 [jamvm] *) AdoptOpenJDK 8.292_p10 [openjdk-bin-8] Available Java Virtual Machines: [1] icedtea-8 [2] jamvm [3] openjdk-bin-8 system-vm The Glorious Glasgow Haskell Compilation System, version 8.10.4 [1] php7.3 [2] php7.4 [3] php8.0 * timestamp(s) of HEAD at this tinderbox image: /var/db/repos/gentoo Fri May 14 06:50:36 UTC 2021 emerge -qpvO dev-util/hip [ebuild N ] dev-util/hip-4.1.0 USE="-debug -profile"
Created attachment 708357 [details] emerge-info.txt
Created attachment 708360 [details] dev-util:hip-4.1.0:20210514-085345.log
Created attachment 708363 [details] emerge-history.txt
Created attachment 708366 [details] environment
Created attachment 708369 [details] etc.portage.tar.bz2
Created attachment 708372 [details] logs.tar.bz2
Created attachment 708375 [details] temp.tar.bz2
2021-05-14T08:05:53 >>> dev-util/opencl-headers-2021.04.29 It uses the system's if available and it's incompatible with 2021.04.29 If missing, builds fine using bundled headers.
(In reply to Ionen Wolkens from comment #8) > 2021-05-14T08:05:53 >>> dev-util/opencl-headers-2021.04.29 > > It uses the system's if available and it's incompatible with 2021.04.29 > > If missing, builds fine using bundled headers. Very interesting discovery. We need to file an upstream bug to hip to update it to be compatible with the newest opencl headers.
Issue persists in dev-util/hip-4.3.0.
Created attachment 737860 [details, diff] fix-opencl-headers-2021.04.29-compat.patch (In reply to Benda Xu from comment #9) > (In reply to Ionen Wolkens from comment #8) > > 2021-05-14T08:05:53 >>> dev-util/opencl-headers-2021.04.29 > > > > It uses the system's if available and it's incompatible with 2021.04.29 > > > > If missing, builds fine using bundled headers. > > Very interesting discovery. We need to file an upstream bug to hip to > update it to be compatible with the newest opencl headers. https://github.com/ROCm-Developer-Tools/ROCclr/pull/25
(In reply to Dennis Schridde from comment #11) > Created attachment 737860 [details, diff] [details, diff] > fix-opencl-headers-2021.04.29-compat.patch > > (In reply to Benda Xu from comment #9) > > (In reply to Ionen Wolkens from comment #8) > > > 2021-05-14T08:05:53 >>> dev-util/opencl-headers-2021.04.29 > > > > > > It uses the system's if available and it's incompatible with 2021.04.29 > > > > > > If missing, builds fine using bundled headers. > > > > Very interesting discovery. We need to file an upstream bug to hip to > > update it to be compatible with the newest opencl headers. > > https://github.com/ROCm-Developer-Tools/ROCclr/pull/25 This also needs an addition to `src_prepare` of dev-util/hip-4.3.0, since different source code files appear to use different OpenCL headers (system or bundled) and we need to force it to use the system OpenCL headers, except for the AMD extensions in `CL/cl_ext.h`: ``` rm amdocl/CL/cl{,_icd,_gl,_gl_ext,_platform}.h sed -i 's/CL_EXT_SUFFIX/CL_API_SUFFIX/' \ amdocl/CL/cl_icd_amd.h \ amdocl/CL/cl_ext.h \ rocclr/cl_lqdflash_amd.h ```
FOREWORD NOTE... The identical errors as this issue also occurs with dev-util/hip-4.3.0::gentoo --which I have resolved after reading this bug report and exploring lines + looking at code, thus, I am posting my resolution in this comment here instead of creating a new issue. While I believe this fix will fix both versions, I did not test dev-util/hip-4.1.0 so please accept my apologies if it doesn't completely resolve the issues with v4.1.0. 1) A side note: I have been able to compile dev-libs/rocclr-4.3.0 without any fix-opencl-headers-2021.04.29-compat.patch. That said, I have dev-util/opencl-headers-2021.06.30::gentoo installed not the 2021.04.29 version. (To me it appears this patch is not required at all.) 2) dev-util/hip-4.3.0 will compile without issues by adding the following to the dev-util/hip-4.3.0::gentoo ebuild: $ diff /var/db/repos/gentoo/dev-util/hip/hip-4.3.0.ebuild /var/db/repos/local/dev-util/hip/hip-4.3.0.ebuild 54a55,58 > rm amdocl/CL/cl{,_icd,_gl,_gl_ext,_platform}.h > sed -i 's/CL_EXT_SUFFIX/CL_API_SUFFIX/' amdocl/cl_icd_amd.h amdocl/cl_ext.h rocclr/cl_lqdflash_amd.h > sed -i 's/CL_EXT_SUFFIX/CL_API_SUFFIX/' amdocl/CL/cl_icd_amd.h amdocl/CL/cl_ext.h in src_prepare(). Essentially I added one more sed line to the rm and sed lines presented in Comment 12 since I was still getting the same compilation errors. (Looking at the errors and the code, I realized I needed to add an identical sed line that does not have "CL/" in it.) This fixed all compilation issues leading to a successful installation of dev-util/hip-4.3.0 and dependent packages. Along with my ::local dev-util/hip, I now have these ::gentoo v4.3.0 ROCm-related packages installed: dev-util/hip-4.3.0::local -debug -profile dev-util/opencl-headers-2021.06.30::gentoo dev-libs/rocr-runtime-4.3.0::gentoo dev-libs/roct-thunk-interface-4.3.0::gentoo dev-util/rocm-cmake-4.3.0::gentoo dev-util/rocminfo-4.3.0::gentoo sys-devel/llvm-roc-4.3.0-r1::gentoo -debug runtime dev-libs/rocclr-4.3.0::gentoo dev-libs/rocm-device-libs-4.3.0::gentoo dev-libs/rocm-opencl-runtime-4.3.0::gentoo dev-libs/rocm-comgr-4.3.0::gentoo dev-util/roctracer-4.3.0::gentoo sci-libs/rocBLAS-4.3.0::gentoo -benchmark -test sci-libs/rocSPARSE-4.3.0::gentoo -benchmark -test sci-libs/rocPRIM-4.3.0::gentoo -benchmark -test I did not try the patching the dev-util/hip-4.1.0 ebuild since I don't want to remove/downgrade the above packages but hopefully such also works for others.
*** Bug 829515 has been marked as a duplicate of this bug. ***
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cadd3e208390316e2bfb03345cfb922eb67555a1 commit cadd3e208390316e2bfb03345cfb922eb67555a1 Author: Andrew Ammerlaan <andrewammerlaan@gentoo.org> AuthorDate: 2022-03-05 14:03:17 +0000 Commit: Andrew Ammerlaan <andrewammerlaan@gentoo.org> CommitDate: 2022-03-05 20:51:51 +0000 dev-util/hip: fix compile, add missing dep Co-authored-by: Dennis Schridde <devurandom@gmx.net> Co-authored-by: Paul Preney <paul@preney.ca> Closes: https://bugs.gentoo.org/790164 Package-Manager: Portage-3.0.30, Repoman-3.0.3 Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org> dev-util/hip/hip-4.3.0-r2.ebuild | 112 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+)