Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure to build with hipcc support #218

Open
luyatshimbalanga opened this issue May 4, 2024 · 5 comments
Open

Failure to build with hipcc support #218

luyatshimbalanga opened this issue May 4, 2024 · 5 comments

Comments

@luyatshimbalanga
Copy link

When using HIPcc option to build OIDN, failure happened from the log extract:

-- Check for working CXX compiler: /usr/bin/hipcc - broken
CMake Error at /usr/share/cmake/Modules/CMakeTestCXXCompiler.cmake:60 (message):
  The C++ compiler

    "/usr/bin/hipcc"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: '/builddir/build/BUILD/oidn-2.3.0-beta/redhat-linux-build/devices/hip/build/CMakeFiles/CMakeScratch/TryCompile-mmYk8r'
    
    Run Build Command(s): /usr/bin/cmake -E env VERBOSE=1 /usr/bin/gmake -f Makefile cmTC_3837d/fast
    gmake[3]: Entering directory '/builddir/build/BUILD/oidn-2.3.0-beta/redhat-linux-build/devices/hip/build/CMakeFiles/CMakeScratch/TryCompile-mmYk8r'
    /usr/bin/gmake  -f CMakeFiles/cmTC_3837d.dir/build.make CMakeFiles/cmTC_3837d.dir/build
    gmake[4]: Entering directory '/builddir/build/BUILD/oidn-2.3.0-beta/redhat-linux-build/devices/hip/build/CMakeFiles/CMakeScratch/TryCompile-mmYk8r'
    Building CXX object CMakeFiles/cmTC_3837d.dir/testCXXCompiler.cxx.o
    /usr/bin/hipcc   -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer  -MD -MT CMakeFiles/cmTC_3837d.dir/testCXXCompiler.cxx.o -MF CMakeFiles/cmTC_3837d.dir/testCXXCompiler.cxx.o.d -o CMakeFiles/cmTC_3837d.dir/testCXXCompiler.cxx.o -c /builddir/build/BUILD/oidn-2.3.0-beta/redhat-linux-build/devices/hip/build/CMakeFiles/CMakeScratch/TryCompile-mmYk8r/testCXXCompiler.cxx
    clang: warning: optimization flag '-ffat-lto-objects' is not supported [-Wignored-optimization-argument]
    clang: warning: optimization flag '-ffat-lto-objects' is not supported [-Wignored-optimization-argument]
    clang: warning: argument unused during compilation: '-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1' [-Wunused-command-line-argument]
    clang: warning: argument unused during compilation: '-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1' [-Wunused-command-line-argument]
    error: option 'cf-protection=return' cannot be specified on this target
    error: option 'cf-protection=branch' cannot be specified on this target
    2 errors generated when compiling for gfx906.
    gmake[4]: *** [CMakeFiles/cmTC_3837d.dir/build.make:79: CMakeFiles/cmTC_3837d.dir/testCXXCompiler.cxx.o] Error 1
    gmake[4]: Leaving directory '/builddir/build/BUILD/oidn-2.3.0-beta/redhat-linux-build/devices/hip/build/CMakeFiles/CMakeScratch/TryCompile-mmYk8r'

    gmake[3]: *** [Makefile:127: cmTC_3837d/fast] Error 2
    gmake[3]: Leaving directory '/builddir/build/BUILD/oidn-2.3.0-beta/redhat-linux-build/devices/hip/build/CMakeFiles/CMakeScratch/TryCompile-mmYk8r'
    
    

  

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:13 (project)


-- Configuring incomplete, errors occurred!
gmake[2]: *** [devices/CMakeFiles/OpenImageDenoise_device_hip.dir/build.make:95: devices/hip/stamp/OpenImageDenoise_device_hip-configure] Error 1
gmake[2]: Leaving directory '/builddir/build/BUILD/oidn-2.3.0-beta/redhat-linux-build'
gmake[1]: *** [CMakeFiles/Makefile2:319: devices/CMakeFiles/OpenImageDenoise_device_hip.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....

Here is the system used for the test

Hardware Information:

  • Hardware Model: Dell Inc. Inspiron 14 7425 2-in-1
  • Memory: 32.0 GiB
  • Processor: AMD Ryzen™ 7 5825U with Radeon™ Graphics × 16
  • Graphics: AMD Radeon™ Graphics
  • Disk Capacity: 2.0 TB

Software Information:

  • Firmware Version: 1.15.0
  • OS Name: Fedora Linux 40 (Design Suite)
  • OS Build: (null)
  • OS Type: 64-bit
  • GNOME Version: 46
  • Windowing System: Wayland
  • Kernel Version: Linux 6.8.7-300.fc40.x86_64
@atafra
Copy link
Collaborator

atafra commented May 4, 2024

What exactly do you mean by "HIPcc option"? How exactly do you invoke CMake? What version of ROCm are you using?

@luyatshimbalanga
Copy link
Author

Adding -DOIDN_DEVICE_HIP_COMPILER=%{_bindir}/hipcc \ in supplement to -DOIDN_DEVICE_HIP=ON \ running on ROCm 6.0

@atafra
Copy link
Collaborator

atafra commented May 6, 2024

You shouldn't manually set OIDN_DEVICE_HIP_COMPILER. The ROCm path should be automatically detected. It isn't? If it's not detected, you should rather set ROCM_PATH instead. In any case, ROCm's clang++ should be used (which should be detected automatically) instead of hipcc.

@luyatshimbalanga
Copy link
Author

luyatshimbalanga commented May 8, 2024

Thanks for the pointer. After setting ROCM_PATH and had to manually apply OIDN_DEVICE_HIP_COMPILER to use clang++-17 (version 17 on Fedora which use version 18 by default), the build failed at the following line:

/builddir/build/BUILD/oidn-2.3.0-beta/devices/hip/ck_conv_wmma.cpp
clang++-17: warning: optimization flag '-ffat-lto-objects' is not supported [-Wignored-optimization-argument]
clang++-17: warning: optimization flag '-ffat-lto-objects' is not supported [-Wignored-optimization-argument]
clang++-17: warning: optimization flag '-ffat-lto-objects' is not supported [-Wignored-optimization-argument]
clang++-17: warning: optimization flag '-ffat-lto-objects' is not supported [-Wignored-optimization-argument]
clang++-17: warning: optimization flag '-ffat-lto-objects' is not supported [-Wignored-optimization-argument]
clang++-17: warning: optimization flag '-ffat-lto-objects' is not supported [-Wignored-optimization-argument]
clang++-17: warning: optimization flag '-ffat-lto-objects' is not supported [-Wignored-optimization-argument]
clang++-17: warning: optimization flag '-ffat-lto-objects' is not supported [-Wignored-optimization-argument]
clang++-17: warning: optimization flag '-ffat-lto-objects' is not supported [-Wignored-optimization-argument]
clang++-17: warning: optimization flag '-ffat-lto-objects' is not supported [-Wignored-optimization-argument]
clang++-17: warning: optimization flag '-ffat-lto-objects' is not supported [-Wignored-optimization-argument]
clang++-17: warning: optimization flag '-ffat-lto-objects' is not supported [-Wignored-optimization-argument]
clang++-17: warning: optimization flag '-ffat-lto-objects' is not supported [-Wignored-optimization-argument]
clang++-17: warning: optimization flag '-ffat-lto-objects' is not supported [-Wignored-optimization-argument]
clang++-17: warning: optimization flag '-ffat-lto-objects' is not supported [-Wignored-optimization-argument]
clang++-17: warning: argument unused during compilation: '-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1' [-Wunused-command-line-argument]
clang++-17: warning: argument unused during compilation: '-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1' [-Wunused-command-line-argument]
error: option 'cf-protection=return' cannot be specified on this target
error: option 'cf-protection=branch' cannot be specified on this target
2 errors generated when compiling for gfx1030.

It looks like the failure occurred for gfx1030 line.
I include the build.log for reference.

@atafra
Copy link
Collaborator

atafra commented May 24, 2024

Why did you have to set OIDN_DEVICE_HIP_COMPILER? This isn't necessary with a regular installation of ROCm (tested with versions between 5.5.0 and 6.1.0). Also, you set it to /usr/bin/clang++-17, which seems to be the system Clang instead of ROCm's own Clang. That won't work.

Please follow the ROCm install instructions at https://rocm.docs.amd.com/projects/install-on-linux/en/latest/
Currently this is the only supported ROCm installation method by OIDN.

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

No branches or pull requests

2 participants