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

build fails in 4.5.2 #133

Closed
gggh000 opened this issue Feb 7, 2022 · 6 comments
Closed

build fails in 4.5.2 #133

gggh000 opened this issue Feb 7, 2022 · 6 comments

Comments

@gggh000
Copy link

gggh000 commented Feb 7, 2022

Followed the instruction but cmake .. fails (below)

root@nonroot-SYS-7049GP-TRT:~/ROCm-4.5/rocALUTION/build# cmake .. -DSUPPORT_HIP=ON
-- hip::amdhip64 is SHARED_LIBRARY
-- hip::amdhip64 is SHARED_LIBRARY
-- hip::amdhip64 is SHARED_LIBRARY
-- hip::amdhip64 is SHARED_LIBRARY
CMake Error at src/CMakeLists.txt:138 (hip_add_library):
  Unknown CMake command "hip_add_library".


-- Configuring incomplete, errors occurred!
See also "/root/ROCm-4.5/rocALUTION/build/CMakeFiles/CMakeOutput.log".
See also "/root/ROCm-4.5/rocALUTION/build/CMakeFiles/CMakeError.log".
root@nonroot-SYS-7049GP-TRT:~/ROCm-4.5/rocALUTION/build# make
make: *** No targets specified and no makefile found.  Stop.
root@nonroot-SYS-7049GP-TRT:~/ROCm-4.5/rocALUTION/build# git branch
* (no branch)
root@nonroot-SYS-7049GP-TRT:~/ROCm-4.5/rocALUTION/build# git remote -v
rocm-swplat	https://github.com/ROCmSoftwarePlatform/rocALUTION (fetch)
rocm-swplat	https://github.com/ROCmSoftwarePlatform/rocALUTION (push)

@ntrost57
Copy link
Contributor

ntrost57 commented Feb 8, 2022

Can you please add the path to rocm to your cmake call, e.g.
cmake .. -DROCM_PATH=<dir>
Alternatively, you can also use the install.sh script.

@gggh000
Copy link
Author

gggh000 commented Feb 8, 2022

DROCM_PATH worked but make fails now:

root@nonroot-SYS-7049GP-TRT:~/ROCm-4.5/rocALUTION/build# cmake .. -DROCM_PATH=/opt/rocm-4.5.2/ -DSUPPORT_HIP=ON
-- Setting build type to 'Release' as none was specified.
-- The CXX compiler identification is GNU 7.5.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Git: /usr/bin/git (found version "2.17.1") 
-- Found OpenMP_CXX: -fopenmp (found version "4.5") 
-- Found OpenMP: TRUE (found version "4.5")  
-- Found MPI_CXX: /opt/ompi/lib/libmpi.so (found version "3.1") 
-- Found MPI: TRUE (found version "3.1")  
Can't exec "/opt/rocm/llvm/bin/clang++": No such file or directory at /opt/rocm-4.5.2/hip/bin/hipconfig line 72.
Use of uninitialized value $HIP_CLANG_VERSION in pattern match (m//) at /opt/rocm-4.5.2/hip/bin/hipconfig line 74.
Use of uninitialized value $HIP_CLANG_VERSION in concatenation (.) or string at /opt/rocm-4.5.2/hip/bin/hipconfig line 80.
Can't exec "/opt/rocm/llvm/bin/clang++": No such file or directory at /opt/rocm-4.5.2/hip/bin/hipconfig line 72.
Use of uninitialized value $HIP_CLANG_VERSION in pattern match (m//) at /opt/rocm-4.5.2/hip/bin/hipconfig line 74.
Use of uninitialized value $HIP_CLANG_VERSION in concatenation (.) or string at /opt/rocm-4.5.2/hip/bin/hipconfig line 80.
Can't exec "/opt/rocm/llvm/bin/clang++": No such file or directory at /opt/rocm-4.5.2/hip/bin/hipconfig line 72.
Use of uninitialized value $HIP_CLANG_VERSION in pattern match (m//) at /opt/rocm-4.5.2/hip/bin/hipconfig line 74.
Use of uninitialized value $HIP_CLANG_VERSION in concatenation (.) or string at /opt/rocm-4.5.2/hip/bin/hipconfig line 80.
-- Found HIP: /opt/rocm-4.5.2/hip (found version "0.0.0") 
-- Looking for C++ include pthread.h
-- Looking for C++ include 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  
-- hip::amdhip64 is SHARED_LIBRARY
-- hip::amdhip64 is SHARED_LIBRARY
-- hip::amdhip64 is SHARED_LIBRARY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
-- Configuring done
-- Generating done
-- Build files have been written to: /root/ROCm-4.5/rocALUTION/build


oot@nonroot-SYS-7049GP-TRT:~/ROCm-4.5/rocALUTION/build# make
[  1%] Building HIPCC object src/CMakeFiles/rocalution_hip.dir/base/hip/rocalution_hip_generated_hip_vector.cpp.o
Can't exec "/opt/rocm/llvm/bin/clang++": No such file or directory at /opt/rocm-4.5.2/bin/hipconfig line 72.
Use of uninitialized value $HIP_CLANG_VERSION in pattern match (m//) at /opt/rocm-4.5.2/bin/hipconfig line 74.
Use of uninitialized value $HIP_CLANG_VERSION in concatenation (.) or string at /opt/rocm-4.5.2/bin/hipconfig line 80.
Can't exec "/opt/rocm/llvm/bin/clang++": No such file or directory at /opt/rocm-4.5.2/bin/hipconfig line 72.
Use of uninitialized value $HIP_CLANG_VERSION in pattern match (m//) at /opt/rocm-4.5.2/bin/hipconfig line 74.
Use of uninitialized value $HIP_CLANG_VERSION in concatenation (.) or string at /opt/rocm-4.5.2/bin/hipconfig line 80.
Can't exec "/opt/rocm/llvm/bin/clang++": No such file or directory at /opt/rocm-4.5.2/bin/hipconfig line 72.
Use of uninitialized value $HIP_CLANG_VERSION in pattern match (m//) at /opt/rocm-4.5.2/bin/hipconfig line 74.
Use of uninitialized value $HIP_CLANG_VERSION in concatenation (.) or string at /opt/rocm-4.5.2/bin/hipconfig line 80.
sh: 1: /opt/rocm/llvm/bin/clang: not found
Use of uninitialized value $HIP_CLANG_VERSION in concatenation (.) or string at /opt/rocm-4.5.2/bin/hipcc line 162.
Use of uninitialized value $HIP_CLANG_INCLUDE_PATH in concatenation (.) or string at /opt/rocm-4.5.2/bin/hipcc line 187.
Use of uninitialized value $HIP_CLANG_INCLUDE_PATH in concatenation (.) or string at /opt/rocm-4.5.2/bin/hipcc line 188.
sh: 1: /opt/rocm/llvm/bin/clang: not found
CMake Error at rocalution_hip_generated_hip_vector.cpp.o.cmake:146 (message):
  Error generating
  /root/ROCm-4.5/rocALUTION/build/src/CMakeFiles/rocalution_hip.dir/base/hip/./rocalution_hip_generated_hip_vector.cpp.o


src/CMakeFiles/rocalution_hip.dir/build.make:117: recipe for target 'src/CMakeFiles/rocalution_hip.dir/base/hip/rocalution_hip_generated_hip_vector.cpp.o' failed
make[2]: *** [src/CMakeFiles/rocalution_hip.dir/base/hip/rocalution_hip_generated_hip_vector.cpp.o] Error 1
CMakeFiles/Makefile2:202: recipe for target 'src/CMakeFiles/rocalution_hip.dir/all' failed
make[1]: *** [src/CMakeFiles/rocalution_hip.dir/all] Error 2
Makefile:170: recipe for target 'all' failed
make: *** [all] Error 2

@gggh000
Copy link
Author

gggh000 commented Feb 8, 2022

install.sh fails as well (rocblas, hip all pre-isntalled):

root@nonroot-SYS-7049GP-TRT:~/ROCm-4.5/rocALUTION# ./install.sh 
Creating project build directory in: ./build
~/ROCm-4.5/rocALUTION ~/ROCm-4.5/rocALUTION
-- The CXX compiler identification is GNU 7.5.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Git: /usr/bin/git (found version "2.17.1") 
-- Found OpenMP_CXX: -fopenmp (found version "4.5") 
-- Found OpenMP: TRUE (found version "4.5")  
-- Found MPI_CXX: /opt/ompi/lib/libmpi.so (found version "3.1") 
-- Found MPI: TRUE (found version "3.1")  
CMake Warning at CMakeLists.txt:86 (find_package):
  By not providing "FindHIP.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "HIP", but
  CMake did not find one.

  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.


-- HIP not found. Compiling WITHOUT HIP support.
CMake Error at CMakeLists.txt:96 (find_package):
  By not providing "Findrocblas.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "rocblas", but
  CMake did not find one.

  Could not find a package configuration file provided by "rocblas" with any
  of the following names:

    rocblasConfig.cmake
    rocblas-config.cmake

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


-- Configuring incomplete, errors occurred!
See also "/root/ROCm-4.5/rocALUTION/build/release/CMakeFiles/CMakeOutput.log".
root@nonroot-SYS-7049GP-TRT:~/ROCm-4.5/rocALUTION# 
root@nonroot-SYS-7049GP-TRT:~/ROCm-4.5/rocALUTION# dpkg -l | grep -i rocblas
ii  rocblas                                2.41.0.40502-164                    amd64        rocBLAS is AMD's library for BLAS on ROCm. It is implemented in HIP and optimized for AMD GPUs.
ii  rocblas-dev                            2.41.0.40502-164                    amd64        rocBLAS is AMD's library for BLAS on ROCm. It is implemented in HIP and optimized for AMD GPUs.
root@nonroot-SYS-7049GP-TRT:~/ROCm-4.5/rocALUTION# dpkg -l | grep -i hip
ii  hip-dev                                4.4.21432.40502-164                 amd64        HIP Heterogenous-computing Interface for Portability [DEVELOPMENT]
ii  hip-doc                                4.4.21432.40502-164                 amd64        HIP: Heterogenous-computing Interface for Portability [DOCUMENTATION]
ii  hip-runtime-amd                        4.4.21432.40502-164                 amd64        HIP: Heterogenous-computing Interface for Portability [RUNTIME - AMD]
ii  hip-samples                            4.4.21432.40502-164                 amd64        HIP: Heterogenous-computing Interface for Portability [SAMPLES]
ii  hipblas                                0.48.0.40502-164                    amd64        Radeon Open Compute BLAS marshalling library
ii  hipblas-dev                            0.48.0.40502-164                    amd64        Radeon Open Compute BLAS marshalling library
ii  hipcub-dev                             2.10.12.40502-164                   amd64        hipCUB (rocPRIM backend)
ii  hipfft                                 1.0.5.40502-164                     amd64        ROCm FFT marshalling library
ii  hipfft-dev                             1.0.5.40502-164                     amd64        ROCm FFT marshalling library
ii  hipsolver                              1.1.0.40502-164                     amd64        Radeon Open Compute LAPACK marshalling library
ii  hipsolver-dev                          1.1.0.40502-164                     amd64        Radeon Open Compute LAPACK marshalling library
ii  hipsparse                              1.11.2-08df64b                      amd64        Radeon Open Compute SPARSE library
ii  hipsparse-dev                          1.11.2-08df64b                      amd64        Radeon Open Compute SPARSE library
ii  miopen-hip                             2.14.0.40502-164                    amd64        AMD's DNN Library
ii  miopen-hip-dev                         2.14.0.40502-164                    amd64        AMD's DNN Library
ii  rocblas                                2.41.0.40502-164                    amd64        rocBLAS is AMD's library for BLAS on ROCm. It is implemented in HIP and optimized for AMD GPUs.
ii  rocblas-dev                            2.41.0.40502-164                    amd64        rocBLAS is AMD's library for BLAS on ROCm. It is implemented in HIP and optimized for AMD GPUs.
root@nonroot-SYS-7049GP-TRT:~/ROCm-4.5/rocALUTION# 
root@nonroot-SYS-7049GP-TRT:~/ROCm-4.5/rocALUTION# 

@ntrost57
Copy link
Contributor

ntrost57 commented Feb 8, 2022

There seem to be an issue with your rocm/hip installation. Can you make sure you can compile and run one of the hip examples?

@gggh000
Copy link
Author

gggh000 commented Feb 8, 2022

hip-examples build fine on same setup. partial log below:

root@nonroot-SYS-7049GP-TRT:~/ROCm-4.5/HIP-Examples# nano -w ../build-rocm.sh 
root@nonroot-SYS-7049GP-TRT:~/ROCm-4.5/HIP-Examples# ./test_all.sh 

==== vectorAdd ====
rm -f ./vectoradd_hip.exe
rm -f vectoradd_hip.o
rm -f /opt/rocm/hip/src/*.o
/opt/rocm/hip/bin/hipcc -g   -c -o vectoradd_hip.o vectoradd_hip.cpp
/opt/rocm/hip/bin/hipcc vectoradd_hip.o -o vectoradd_hip.exe
./vectoradd_hip.exe
 System minor 0
 System major 9
 agent prop name 
hip Device prop succeeded 
PASSED!

==== gpu-burn ====
rm -rf build
mkdir -p build
/opt/rocm/hip/bin/hipcc -I/opt/rocm/hip/include -I/opt/rocm/hcc/include -O3 -c -o build/BurnKernel.o BurnKernel.cpp  
mkdir -p build
/opt/rocm/hip/bin/hipcc -I/opt/rocm/hip/include -I/opt/rocm/hcc/include -O3 -c -o build/common.o common.cpp  
mkdir -p build
/opt/rocm/hip/bin/hipcc -I/opt/rocm/hip/include -I/opt/rocm/hcc/include -O3 -c -o build/AmdGpuMonitor.o AmdGpuMonitor.cpp  
mkdir -p build
/opt/rocm/hip/bin/hipcc -I/opt/rocm/hip/include -I/opt/rocm/hcc/include -O3 -c -o build/gpuburn.o gpuburn.cpp  
/opt/rocm/hip/bin/hipcc -lm -lpthread -o build/gpuburn-hip build/BurnKernel.o build/common.o build/AmdGpuMonitor.o build/gpuburn.o
Total no. of GPUs found: 1
Init Burn Thread for device (0)
Temps: [GPU0: 38 C] 5s
Burn Thread using device (0)
Temps: [GPU0: 40 C] 4s
Temps: [GPU0: 41 C] 3s
Temps: [GPU0: 42 C] 2s
Temps: [GPU0: 42 C] 1s
Stopping burn thread on device (0)

==== strided-access ====
rm -f strided-access *.o
/opt/rocm/hip/bin/hipcc -std=c++11 -O3 -o strided-access benchmark-hip.cpp 
# Using device: 
# stride     time       GB/sec
   0        0.000365        657.534
   1        0.000408        588.235
   2        0.00078        307.692
   3        0.001137        211.082
   4        0.001479        162.272
   5        0.001847        129.94
   6        0.002211        108.548
   7        0.002568        93.4579
   8        0.00293        81.9113
   9        0.003255        73.7327
   10        0.00357        67.2269
   11        0.003875        61.9355
   12        0.004199        57.1565
   13        0.004517        53.1326
   14        0.00485        49.4845
   15        0.005179        46.341
   16        0.005617        42.7274
   17        0.005698        42.12
   18        0.005834        41.1382
   19        0.005931        40.4654
...

executing: ../../test/lud/run0.cmd...      PASSED!
--TESTING: pathfinder
executing: ../../test/pathfinder/run0.cmd...      PASSED!
--TESTING: srad
executing: ../../test/srad/run0.cmd...      PASSED!
--TESTING: bfs
executing: ../../test/bfs/run0.cmd...      PASSED!
executing: ../../test/bfs/run1.cmd...      PASSED!
--TESTING: lavaMD
executing: ../../test/lavaMD/run3.cmd...      PASSED!
executing: ../../test/lavaMD/run0.cmd...      PASSED!
executing: ../../test/lavaMD/run4.cmd...      PASSED!
executing: ../../test/lavaMD/run1.cmd...      PASSED!
executing: ../../test/lavaMD/run2.cmd...      PASSED!
--TESTING: cfd
executing: ../../test/cfd/run0.cmd...      PASSED!
executing: ../../test/cfd/run1.cmd...      PASSED!
--TESTING: gaussian
executing: ../../test/gaussian/run3.cmd...      PASSED!
executing: ../../test/gaussian/run0.cmd...      PASSED!
executing: ../../test/gaussian/run4.cmd...      PASSED!
executing: ../../test/gaussian/run1.cmd...      PASSED!
executing: ../../test/gaussian/run2.cmd...      PASSED!

@gggh000
Copy link
Author

gggh000 commented Feb 8, 2022

after setting the path for clang++, build finally works, it may be beneficial to update the doc for:
cmake .. -DROCM_PATH=

. After that I think this issue can be closed.

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