ROCm / MIOpen

AMD's Machine Intelligence Library
https://rocm.docs.amd.com/projects/MIOpen/en/latest/
Other
1.03k stars 216 forks source link

Unable to builld MIOpen from source on SLES #2939

Open Zakhrov opened 2 months ago

Zakhrov commented 2 months ago

When trying to build MIOpen from source, the compilation fails with the following error:

MIOpen/src/include/miopen/handle.hpp:242:17: error: no member named 'has_value' in 'boost::optional<miopen::AlgorithmName>'
  242 |         if(algo.has_value())

I have confirmed that Boost is installed and can be found by MIOpen during the CMAKE configuration step:

-- The C compiler identification is GNU 13.2.1
-- The CXX compiler identification is Clang 18.1.4
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found SQLite3: /usr/include (found version "3.44.0") 
-- Found BZip2: /usr/lib64/libbz2.so (found version "1.0.8") 
-- Looking for BZ2_bzCompressInit
-- Looking for BZ2_bzCompressInit - found
-- Found nlohmann_json: /usr/lib64/cmake/nlohmann_json/nlohmann_jsonConfig.cmake (found suitable version "3.11.2", minimum required is "3.9.1") 
-- Performing Test HAS_HIP
-- Performing Test HAS_HIP - Success
-- Performing Test _result
-- Performing Test _result - Success
-- MIOPEN_OFFLINE_COMPILER_PATHS_V2: OFF
-- MIOPEN_BUILD_DRIVER: ON
-- Performing Test HIP_CLANG_SUPPORTS_PARALLEL_JOBS
-- Performing Test HIP_CLANG_SUPPORTS_PARALLEL_JOBS - Failed
-- Build with HIP 6.1.40091
-- Enable Composable Kernels: ON
-- Performing Test MIOPEN_HIP_COMPILER_HAS_OPTION_OFFLOAD_UNIFORM_BLOCK
-- Performing Test MIOPEN_HIP_COMPILER_HAS_OPTION_OFFLOAD_UNIFORM_BLOCK - Success
-- Hip compiler flags:  -mllvm=-amdgpu-early-inline-all=true -mllvm=-amdgpu-function-calls=false -x hip    -D__HIP_PLATFORM_AMD__=1  -DUSE_PROF_API=1 --hip-link    -fno-offload-uniform-block 
-- OpenCL compiler: /opt/rocm/bin/amdclang
-- Build with rocblas 4.3.0
-- HIP backend selected.
-- clang-offload-bundler found: /opt/rocm/llvm/bin/clang-offload-bundler
-- Build with rocMLIR::rockCompiler 2.0.0
-- AMDGCN assembler: /opt/rocm/llvm/bin/clang
-- Build with comgr 2.7.0
-- Build with HIPRTC 6.1.40091
-- Found Boost: /usr/local/lib/cmake/Boost-1.85.0/BoostConfig.cmake (found version "1.85.0") found components: filesystem 
-- HALF_INCLUDE_DIR: /opt/rocm/include
-- Found nlohmann_json: /usr/lib64/cmake/nlohmann_json/nlohmann_jsonConfig.cmake (found version "3.11.2") 
-- Build with rocTracer: /opt/rocm/lib/libroctx64.so
-- rocrand_VERSION=3.0.1

What am I doing wrong?

junliume commented 2 months ago

@Zakhrov it might be a Boost version issue, are you following the build guide closely to build MIOpen dependencies?

export LC_ALL=C.UTF-8 && \
export LANG=C.UTF-8 && \
apt-get update -y && \
apt-get install -y sudo && \
sudo apt-get -y install git git-lfs unzip lbzip2 python3.9-venv pkg-config vim ninja-build half && \
sudo apt update && \
cd /root && git clone -b develop https://github.com/ROCmSoftwarePlatform/MIOpen && cd MIOpen && \
mkdir -p install_dir && cmake -P install_deps.cmake --minimum --prefix /root/MIOpen/install_dir && \
mkdir -p build && \
cd build && \
CXX=/opt/rocm/bin/amdclang++ CC=/opt/rocm/bin/amdclang cmake -DMIOPEN_BACKEND=HIP -DCMAKE_PREFIX_PATH="/root/MIOpen/install_dir;/opt/rocm" \
-DMIOPEN_TEST_ALL=On -DMIOPEN_TEST_HALF=On .. && \
make -j$(nproc) install