ROCm / HIP

HIP: C++ Heterogeneous-Compute Interface for Portability
https://rocmdocs.amd.com/projects/HIP/
MIT License
3.69k stars 528 forks source link

How to build HIP >= 4.0 from source in ROCm's official docker environment? #2210

Closed ghostplant closed 6 months ago

ghostplant commented 3 years ago

The legacy method is build HIP 4.0 is no longer working:

root@23b8165d1927:/root/HIP# mkdir build && cd build
root@23b8165d1927:/root/HIP/build# cmake ..
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Git: /usr/bin/git (found version "2.17.1")
Using CPACK_DEBIAN_PACKAGE_RELEASE local
CPACK_RPM_PACKAGE_RELEASE: local
-- HIP Platform: hcc
-- HIP Compiler: hcc
CMake Error at CMakeLists.txt:224 (message):
  Don't know where to find HCC.  Please specify abolute path using -DHCC_HOME

-- Configuring incomplete, errors occurred!
See also "/root/HIP/build/CMakeFiles/CMakeOutput.log".

Since HIP has dropped support for HCC, so how should I set -DHCC_HOME?

xuhuisheng commented 3 years ago

@ghostplant It recommend switch hcc to clang, after ROCm-3.3. Please refer here : https://github.com/xuhuisheng/rocm-build/blob/master/19.hip.sh

ghostplant commented 3 years ago

@xuhuisheng It ends up with:

Found Static rocclr lib:LIBROCclr_STATIC_DIR-NOTFOUND and rocclr includes: ROCclr_DIR-NOTFOUND
-- Profiling API: /opt/rocm/roctracer/include/ext
-- Code Object Manager found at /opt/rocm/lib/cmake/amd_comgr.
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE
CMake Error at rocclr/CMakeLists.txt:160 (include):
  include could not find load file:

    LIBROCclr_STATIC_DIR-NOTFOUND/amdrocclr_staticTargets.cmake

How should I install this cmake file? Is it possible not to build all ROCm components from start?

xuhuisheng commented 3 years ago

hip required install rocclr first. https://github.com/xuhuisheng/rocm-build/blob/master/18.rocclr.sh

my suggest is getting sources code by repo, and build component one by one.

ppanchad-amd commented 6 months ago

@ghostplant Please check if you are still having trouble building with latest ROCm 6.0.2 (HIP 6.0.32831)? If not, please close the ticket. Thanks.