ROCm / HIP

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

HIP build from source, make install did insall hip-config.cmake? #569

Closed wormwang closed 6 years ago

wormwang commented 6 years ago

when I try build rocFFT form source, I meet ~/ROCm/rocFFT/release# CXX=/opt/rocm/bin/hcc cmake .. -- HCC compiler set; ROCm backend selected [ CXX=/opt/rocm/bin/hcc cmake ... ] -- Building with ROCm tools CMake Error at CMakeLists.txt:126 (find_package): Could not find a package configuration file provided by "hip" with any of the following names:

hipConfig.cmake
hip-config.cmake

Add the installation prefix of "hip" to CMAKE_PREFIX_PATH or set "hip_DIR" to a directory containing one of the above files. If "hip" provides a separate development package or SDK, be sure it has been installed.

-- Configuring incomplete, errors occurred! See also "/root/ROCm/rocFFT/release/CMakeFiles/CMakeOutput.log".

I find the build HIP from source code, make install did not install hip-config.cmake

mangupta commented 6 years ago

hip-config.cmake should be installed under /lib/cmake/hip. Can you verify the same?

rocFFT sets CMAKE_PREFIX_PATH @ https://github.com/ROCmSoftwarePlatform/rocFFT/blob/develop/CMakeLists.txt#L107. So unless your HIP is installed in a different location other than /opt/rocm/hip, it should work fine. In case you use an alternate HIP install location, you will need to readjust your CMAKE_PREFIX_PATH.

wormwang commented 6 years ago

I checked, build HIP from source code, make install did not install hip-config.cmake

wormwang commented 6 years ago

FYR

~/HIP/build# make install|grep cmake -- Up-to-date: /opt/rocm/hip/./bin/hipify-cmakefile -- Up-to-date: /opt/rocm/hip/./bin/hipcc_cmake_linker_helper -- Up-to-date: /opt/rocm/hip/./cmake -- Up-to-date: /opt/rocm/hip/./cmake/FindHIP.cmake -- Up-to-date: /opt/rocm/hip/./cmake/FindHIP -- Up-to-date: /opt/rocm/hip/./cmake/FindHIP/run_hipcc.cmake -- Up-to-date: /opt/rocm/hip/./cmake/FindHIP/run_make2cmake.cmake

mangupta commented 6 years ago

HIP cmake steps for installing hip-config.cmake are @ https://github.com/ROCm-Developer-Tools/HIP/blob/master/CMakeLists.txt#L284-L290. It does this step only if HIP_PLATFORM is hcc. So a possibility is that HIP build system identifies your setup as nvcc platform.

Can you run /opt/rocm/hip/bin/hipconfig --platform and check if the output is hcc? If it is nvcc, then it means that we are not able to detect that you have a valid ROCm installation.

To verify that you have a proper ROCm installation, do the following. Please ensure that you have followed all the steps listed in https://github.com/RadeonOpenCompute/ROCm#installing-from-amd-rocm-repositories. Executing rocminfo as specified in the instructions should show you the AMD GPU that it has identified. Additionally verify that you are able to run the hsa sample under /opt/rocm/hsa/sample correctly? The sample is also available @ https://github.com/RadeonOpenCompute/ROCR-Runtime/tree/master/sample.

wormwang commented 6 years ago

export HIP_PLATFORM=hcc cmake -DHSA_PATH=/opt/hsa-rocr-dev/hsa -DHCC_HOME=/opt/rocm/hcc -DCMAKE_INSTALL_PREFIX=/opt/rocm/hip -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS= "-v" ..

now can make as hcc platform