Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 790164 - dev-util/hip-4.3.0-r1 - /.../command.hpp: error: CL_COMMAND_GL_FENCE_SYNC_OBJECT_KHR was not declared in this scope
Summary: dev-util/hip-4.3.0-r1 - /.../command.hpp: error: CL_COMMAND_GL_FENCE_SYNC_OBJ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Science Related Packages
URL:
Whiteboard:
Keywords:
: 829515 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-05-14 10:30 UTC by Toralf Förster
Modified: 2022-03-05 20:51 UTC (History)
8 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge-info.txt (emerge-info.txt,17.42 KB, text/plain)
2021-05-14 10:30 UTC, Toralf Förster
Details
dev-util:hip-4.1.0:20210514-085345.log (dev-util:hip-4.1.0:20210514-085345.log,32.33 KB, text/plain)
2021-05-14 10:30 UTC, Toralf Förster
Details
emerge-history.txt (emerge-history.txt,304.26 KB, text/plain)
2021-05-14 10:30 UTC, Toralf Förster
Details
environment (environment,94.07 KB, text/plain)
2021-05-14 10:30 UTC, Toralf Förster
Details
etc.portage.tar.bz2 (etc.portage.tar.bz2,20.90 KB, application/x-bzip)
2021-05-14 10:30 UTC, Toralf Förster
Details
logs.tar.bz2 (logs.tar.bz2,5.06 KB, application/x-bzip)
2021-05-14 10:30 UTC, Toralf Förster
Details
temp.tar.bz2 (temp.tar.bz2,28.97 KB, application/x-bzip)
2021-05-14 10:30 UTC, Toralf Förster
Details
fix-opencl-headers-2021.04.29-compat.patch (0001-Fix-OpenCL-headers-2021.04.29-compatibility.patch,906 bytes, patch)
2021-09-06 10:13 UTC, Dennis Schridde
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2021-05-14 10:30:15 UTC
                 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"
Comment 1 Toralf Förster gentoo-dev 2021-05-14 10:30:16 UTC
Created attachment 708357 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2021-05-14 10:30:18 UTC
Created attachment 708360 [details]
dev-util:hip-4.1.0:20210514-085345.log
Comment 3 Toralf Förster gentoo-dev 2021-05-14 10:30:19 UTC
Created attachment 708363 [details]
emerge-history.txt
Comment 4 Toralf Förster gentoo-dev 2021-05-14 10:30:21 UTC
Created attachment 708366 [details]
environment
Comment 5 Toralf Förster gentoo-dev 2021-05-14 10:30:22 UTC
Created attachment 708369 [details]
etc.portage.tar.bz2
Comment 6 Toralf Förster gentoo-dev 2021-05-14 10:30:23 UTC
Created attachment 708372 [details]
logs.tar.bz2
Comment 7 Toralf Förster gentoo-dev 2021-05-14 10:30:24 UTC
Created attachment 708375 [details]
temp.tar.bz2
Comment 8 Ionen Wolkens gentoo-dev 2021-05-14 18:24:28 UTC
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.
Comment 9 Benda Xu gentoo-dev 2021-05-17 12:28:56 UTC
(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.
Comment 10 Dennis Schridde 2021-08-27 14:03:36 UTC
Issue persists in dev-util/hip-4.3.0.
Comment 11 Dennis Schridde 2021-09-06 10:13:42 UTC
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
Comment 12 Dennis Schridde 2021-09-06 11:55:19 UTC
(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
```
Comment 13 Paul Preney 2021-09-12 05:13:50 UTC
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.
Comment 14 Andrew Ammerlaan gentoo-dev 2022-03-05 13:47:29 UTC
*** Bug 829515 has been marked as a duplicate of this bug. ***
Comment 15 Larry the Git Cow gentoo-dev 2022-03-05 20:51:58 UTC
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(+)