xuhuisheng / rocm-build

build scripts for ROCm
Apache License 2.0
181 stars 35 forks source link

Build error on rocSPARSE fork following gfx803 instructions #6

Closed staticdev closed 3 years ago

staticdev commented 3 years ago

I have installed 3.9.1 rocm-dev, rocm-libs. cmake and libc6-dev on my Ubuntu 20.10, using a Radeon RX680.

But when I bash install.sh -di on xuhuisheng/rocSPARSE, I get:

Creating project build directory in: ./build
Get:1 file:/var/opt/amdgpu-pro-local ./ InRelease
Ign:1 file:/var/opt/amdgpu-pro-local ./ InRelease
Get:2 file:/var/opt/amdgpu-pro-local ./ Release [816 B]
Get:2 file:/var/opt/amdgpu-pro-local ./ Release [816 B]
Get:3 file:/var/opt/amdgpu-pro-local ./ Release.gpg
Ign:3 file:/var/opt/amdgpu-pro-local ./ Release.gpg
Hit:4 http://nl.archive.ubuntu.com/ubuntu groovy InRelease
Hit:5 http://dl.google.com/linux/chrome/deb stable InRelease                                                                            
Hit:6 https://download.docker.com/linux/ubuntu groovy InRelease                                                                         
Hit:7 http://nl.archive.ubuntu.com/ubuntu groovy-updates InRelease                                                                      
Hit:8 http://nl.archive.ubuntu.com/ubuntu groovy-backports InRelease                                                                    
Hit:9 https://packages.microsoft.com/repos/ms-teams stable InRelease                                                                    
Hit:10 https://updates.signal.org/desktop/apt xenial InRelease                                                                          
Hit:11 https://packages.microsoft.com/repos/vscode stable InRelease                                               
Hit:12 https://repo.nordvpn.com/deb/nordvpn/debian stable InRelease                                               
Hit:13 http://security.ubuntu.com/ubuntu groovy-security InRelease                          
Hit:14 https://repo.radeon.com/rocm/apt/3.9.1 xenial InRelease        
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.
~/workspace/rocSPARSE ~/workspace/rocSPARSE
Building googletest from source; installing into /usr/local
-- Configuring gtest external dependency
-- ExternalGmock using ( 13 ) cores to build with
CMake Deprecation Warning at CMakeLists.txt:63 (cmake_policy):
  The OLD behavior for policy CMP0037 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.

-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/rocSPARSE/build/deps
make[1]: Entering directory '/home/user/rocSPARSE/build/deps'
make[2]: Entering directory '/home/user/rocSPARSE/build/deps'
make[2]: Leaving directory '/home/user/rocSPARSE/build/deps'
make[2]: Entering directory '/home/user/rocSPARSE/build/deps'
[ 12%] Performing update step for 'googletest'
[ 25%] Performing configure step for 'googletest'
-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/rocSPARSE/build/deps/gtest/src/googletest-build
[ 37%] Performing build step for 'googletest'
-- googletest build command succeeded.  See also /home/user/rocSPARSE/build/deps/gtest/src/googletest-stamp/googletest-build-*.log
[ 50%] No install step for 'googletest'
[ 62%] Completed 'googletest'
make[2]: Leaving directory '/home/user/rocSPARSE/build/deps'
[100%] Built target googletest
make[1]: Leaving directory '/home/user/rocSPARSE/build/deps'
make[1]: Entering directory '/home/user/rocSPARSE/build/deps'
make[2]: Entering directory '/home/user/rocSPARSE/build/deps'
make[3]: Entering directory '/home/user/rocSPARSE/build/deps'
make[3]: Leaving directory '/home/user/rocSPARSE/build/deps'
make[3]: Entering directory '/home/user/rocSPARSE/build/deps'
[ 12%] Performing update step for 'googletest'
[ 25%] Performing configure step for 'googletest'
-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/rocSPARSE/build/deps/gtest/src/googletest-build
[ 37%] Performing build step for 'googletest'
-- googletest build command succeeded.  See also /home/user/rocSPARSE/build/deps/gtest/src/googletest-stamp/googletest-build-*.log
[ 50%] No install step for 'googletest'
[ 62%] Completed 'googletest'
make[3]: Leaving directory '/home/user/rocSPARSE/build/deps'
[100%] Built target googletest
make[3]: Entering directory '/home/user/rocSPARSE/build/deps'
make[3]: Leaving directory '/home/user/rocSPARSE/build/deps'
make[3]: Entering directory '/home/user/rocSPARSE/build/deps'
gmake[4]: Entering directory '/home/user/rocSPARSE/build/deps/gtest/src/googletest-build'
gmake[5]: Entering directory '/home/user/rocSPARSE/build/deps/gtest/src/googletest-build'
gmake[6]: Entering directory '/home/user/rocSPARSE/build/deps/gtest/src/googletest-build'
gmake[6]: Leaving directory '/home/user/rocSPARSE/build/deps/gtest/src/googletest-build'
[ 25%] Built target gtest
gmake[6]: Entering directory '/home/user/rocSPARSE/build/deps/gtest/src/googletest-build'
gmake[6]: Leaving directory '/home/user/rocSPARSE/build/deps/gtest/src/googletest-build'
[ 50%] Built target gmock
gmake[6]: Entering directory '/home/user/rocSPARSE/build/deps/gtest/src/googletest-build'
gmake[6]: Leaving directory '/home/user/rocSPARSE/build/deps/gtest/src/googletest-build'
[ 75%] Built target gmock_main
gmake[6]: Entering directory '/home/user/rocSPARSE/build/deps/gtest/src/googletest-build'
gmake[6]: Leaving directory '/home/user/rocSPARSE/build/deps/gtest/src/googletest-build'
[100%] Built target gtest_main
gmake[5]: Leaving directory '/home/user/rocSPARSE/build/deps/gtest/src/googletest-build'
Install the project...
-- Install configuration: ""
-- Up-to-date: /usr/local/include
-- Up-to-date: /usr/local/include/gmock
-- Up-to-date: /usr/local/include/gmock/gmock-more-actions.h
-- Up-to-date: /usr/local/include/gmock/gmock-actions.h
-- Up-to-date: /usr/local/include/gmock/gmock-generated-actions.h.pump
-- Up-to-date: /usr/local/include/gmock/gmock-more-matchers.h
-- Up-to-date: /usr/local/include/gmock/gmock.h
-- Up-to-date: /usr/local/include/gmock/gmock-generated-function-mockers.h
-- Up-to-date: /usr/local/include/gmock/gmock-generated-matchers.h.pump
-- Up-to-date: /usr/local/include/gmock/gmock-generated-actions.h
-- Up-to-date: /usr/local/include/gmock/gmock-generated-matchers.h
-- Up-to-date: /usr/local/include/gmock/gmock-generated-nice-strict.h
-- Up-to-date: /usr/local/include/gmock/gmock-matchers.h
-- Up-to-date: /usr/local/include/gmock/internal
-- Up-to-date: /usr/local/include/gmock/internal/gmock-generated-internal-utils.h.pump
-- Up-to-date: /usr/local/include/gmock/internal/gmock-generated-internal-utils.h
-- Up-to-date: /usr/local/include/gmock/internal/gmock-port.h
-- Up-to-date: /usr/local/include/gmock/internal/gmock-internal-utils.h
-- Up-to-date: /usr/local/include/gmock/internal/custom
-- Up-to-date: /usr/local/include/gmock/internal/custom/gmock-generated-actions.h.pump
-- Up-to-date: /usr/local/include/gmock/internal/custom/README.md
-- Up-to-date: /usr/local/include/gmock/internal/custom/gmock-generated-actions.h
-- Up-to-date: /usr/local/include/gmock/internal/custom/gmock-matchers.h
-- Up-to-date: /usr/local/include/gmock/internal/custom/gmock-port.h
-- Up-to-date: /usr/local/include/gmock/gmock-generated-function-mockers.h.pump
-- Up-to-date: /usr/local/include/gmock/gmock-cardinalities.h
-- Up-to-date: /usr/local/include/gmock/gmock-generated-nice-strict.h.pump
-- Up-to-date: /usr/local/include/gmock/gmock-spec-builders.h
-- Up-to-date: /usr/local/lib/libgmock.a
-- Up-to-date: /usr/local/lib/libgmock_main.a
-- Up-to-date: /usr/local/lib/pkgconfig/gmock.pc
-- Up-to-date: /usr/local/lib/pkgconfig/gmock_main.pc
-- Up-to-date: /usr/local/lib/cmake/GTest/GTestTargets.cmake
-- Installing: /usr/local/lib/cmake/GTest/GTestTargets-noconfig.cmake
-- Up-to-date: /usr/local/lib/cmake/GTest/GTestConfigVersion.cmake
-- Up-to-date: /usr/local/lib/cmake/GTest/GTestConfig.cmake
-- Up-to-date: /usr/local/include
-- Up-to-date: /usr/local/include/gtest
-- Up-to-date: /usr/local/include/gtest/gtest.h
-- Up-to-date: /usr/local/include/gtest/gtest-death-test.h
-- Up-to-date: /usr/local/include/gtest/gtest-spi.h
-- Up-to-date: /usr/local/include/gtest/gtest-param-test.h
-- Up-to-date: /usr/local/include/gtest/gtest_pred_impl.h
-- Up-to-date: /usr/local/include/gtest/gtest-message.h
-- Up-to-date: /usr/local/include/gtest/internal
-- Up-to-date: /usr/local/include/gtest/internal/gtest-string.h
-- Up-to-date: /usr/local/include/gtest/internal/gtest-param-util.h
-- Up-to-date: /usr/local/include/gtest/internal/gtest-filepath.h
-- Up-to-date: /usr/local/include/gtest/internal/gtest-param-util-generated.h
-- Up-to-date: /usr/local/include/gtest/internal/gtest-tuple.h.pump
-- Up-to-date: /usr/local/include/gtest/internal/gtest-port-arch.h
-- Up-to-date: /usr/local/include/gtest/internal/gtest-port.h
-- Up-to-date: /usr/local/include/gtest/internal/gtest-type-util.h.pump
-- Up-to-date: /usr/local/include/gtest/internal/gtest-internal.h
-- Up-to-date: /usr/local/include/gtest/internal/gtest-tuple.h
-- Up-to-date: /usr/local/include/gtest/internal/gtest-type-util.h
-- Up-to-date: /usr/local/include/gtest/internal/custom
-- Up-to-date: /usr/local/include/gtest/internal/custom/gtest.h
-- Up-to-date: /usr/local/include/gtest/internal/custom/README.md
-- Up-to-date: /usr/local/include/gtest/internal/custom/gtest-port.h
-- Up-to-date: /usr/local/include/gtest/internal/custom/gtest-printers.h
-- Up-to-date: /usr/local/include/gtest/internal/gtest-linked_ptr.h
-- Up-to-date: /usr/local/include/gtest/internal/gtest-death-test-internal.h
-- Up-to-date: /usr/local/include/gtest/internal/gtest-param-util-generated.h.pump
-- Up-to-date: /usr/local/include/gtest/gtest-test-part.h
-- Up-to-date: /usr/local/include/gtest/gtest-printers.h
-- Up-to-date: /usr/local/include/gtest/gtest_prod.h
-- Up-to-date: /usr/local/include/gtest/gtest-typed-test.h
-- Up-to-date: /usr/local/include/gtest/gtest-param-test.h.pump
-- Up-to-date: /usr/local/lib/libgtest.a
-- Up-to-date: /usr/local/lib/libgtest_main.a
-- Up-to-date: /usr/local/lib/pkgconfig/gtest.pc
-- Up-to-date: /usr/local/lib/pkgconfig/gtest_main.pc
gmake[4]: Leaving directory '/home/user/rocSPARSE/build/deps/gtest/src/googletest-build'
make[3]: Leaving directory '/home/user/rocSPARSE/build/deps'
[100%] Built target install
make[2]: Leaving directory '/home/user/rocSPARSE/build/deps'
make[1]: Leaving directory '/home/user/rocSPARSE/build/deps'
~/workspace/rocSPARSE
~/workspace/rocSPARSE ~/workspace/rocSPARSE
-- The CXX compiler identification is unknown
-- The Fortran compiler identification is GNU 10.2.0
-- Check for working CXX compiler: /opt/rocm/bin/hipcc
-- Check for working CXX compiler: /opt/rocm/bin/hipcc -- broken
CMake Error at /usr/share/cmake-3.16/Modules/CMakeTestCXXCompiler.cmake:53 (message):
  The C++ compiler

    "/opt/rocm/bin/hipcc"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /home/user/rocSPARSE/build/release/CMakeFiles/CMakeTmp

    Run Build Command(s):/usr/bin/gmake cmTC_9346b/fast && /usr/bin/gmake -f CMakeFiles/cmTC_9346b.dir/build.make CMakeFiles/cmTC_9346b.dir/build
    gmake[1]: Entering directory '/home/user/rocSPARSE/build/release/CMakeFiles/CMakeTmp'
    Building CXX object CMakeFiles/cmTC_9346b.dir/testCXXCompiler.cxx.o
    /opt/rocm/bin/hipcc     -o CMakeFiles/cmTC_9346b.dir/testCXXCompiler.cxx.o -c /home/user/rocSPARSE/build/release/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
    Can't exec "/opt/rocm/llvm/bin/clang++": No such file or directory at /opt/rocm-3.9.1/hip/bin/hipconfig line 141.
    Use of uninitialized value $HIP_CLANG_VERSION in pattern match (m//) at /opt/rocm-3.9.1/hip/bin/hipconfig line 142.
    Use of uninitialized value $HIP_CLANG_VERSION in concatenation (.) or string at /opt/rocm-3.9.1/hip/bin/hipconfig line 145.
    Can't exec "/opt/rocm/llvm/bin/clang++": No such file or directory at /opt/rocm-3.9.1/hip/bin/hipconfig line 141.
    Use of uninitialized value $HIP_CLANG_VERSION in pattern match (m//) at /opt/rocm-3.9.1/hip/bin/hipconfig line 142.
    Use of uninitialized value $HIP_CLANG_VERSION in concatenation (.) or string at /opt/rocm-3.9.1/hip/bin/hipconfig line 145.
    Can't exec "/opt/rocm/llvm/bin/clang++": No such file or directory at /opt/rocm-3.9.1/hip/bin/hipconfig line 141.
    Use of uninitialized value $HIP_CLANG_VERSION in pattern match (m//) at /opt/rocm-3.9.1/hip/bin/hipconfig line 142.
    Use of uninitialized value $HIP_CLANG_VERSION in concatenation (.) or string at /opt/rocm-3.9.1/hip/bin/hipconfig line 145.
    Can't exec "/opt/rocm/llvm/bin/clang++": No such file or directory at /opt/rocm-3.9.1/hip/bin/hipconfig line 141.
    Use of uninitialized value $HIP_CLANG_VERSION in pattern match (m//) at /opt/rocm-3.9.1/hip/bin/hipconfig line 142.
    Use of uninitialized value $HIP_CLANG_VERSION in concatenation (.) or string at /opt/rocm-3.9.1/hip/bin/hipconfig line 145.
    Can't exec "/opt/rocm-3.9.1/llvm/bin/clang": No such file or directory at /opt/rocm/bin/hipcc line 203.
    Use of uninitialized value $HIP_CLANG_VERSION in pattern match (m//) at /opt/rocm/bin/hipcc line 204.
    Use of uninitialized value $HIP_CLANG_VERSION in concatenation (.) or string at /opt/rocm/bin/hipcc line 208.
    Can't exec "/opt/rocm-3.9.1/llvm/bin/clang": No such file or directory at /opt/rocm/bin/hipcc line 897.
    failed to execute: No such file or directory
    gmake[1]: *** [CMakeFiles/cmTC_9346b.dir/build.make:66: CMakeFiles/cmTC_9346b.dir/testCXXCompiler.cxx.o] Error 255
    gmake[1]: Leaving directory '/home/user/rocSPARSE/build/release/CMakeFiles/CMakeTmp'
    gmake: *** [Makefile:121: cmTC_9346b/fast] Error 2

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

-- Configuring incomplete, errors occurred!
See also "/home/user/rocSPARSE/build/release/CMakeFiles/CMakeOutput.log".
See also "/home/user/rocSPARSE/build/release/CMakeFiles/CMakeError.log".

Also my CMakeError.log might be useful.

Any idea?

xuhuisheng commented 3 years ago

The hipcc is from hip-rocclr. Please install rocm-dev and rocm-libs using sudo apt install rocm-dev rocm-libs

staticdev commented 3 years ago

@xuhuisheng I already had rocm-dev rocm-libs installed using apt as in the description.

% sudo apt install rocm-dev rocm-libs
Reading package lists... Done
Building dependency tree       
Reading state information... Done
rocm-dev is already the newest version (3.9.1.30901-19).
rocm-libs is already the newest version (3.9.1.30901-19).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Also hip-rocclr was installed (I think it came together with these two, not really sure).

% sudo apt install hip-rocclr
Reading package lists... Done
Building dependency tree       
Reading state information... Done
hip-rocclr is already the newest version (3.9.20412-6d111f85).
hip-rocclr set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
xuhuisheng commented 3 years ago

Next step export PATH=/opt/rocm/bin:/opt/rocm/llvm/bin:PATH Please refer https://github.com/xuhuisheng/rocm-build/blob/master/env.sh

staticdev commented 3 years ago

@xuhuisheng I also exported all variables, no difference:

 % sh env.sh
 % echo $PATH
/opt/rocm/bin:/opt/rocm/llvm/bin:/opt/rocm/hip/bin:/opt/rocm/bin:/opt/rocm/llvm/bin:/opt/rocm/hip/bin:/opt/rocm/bin:/opt/rocm/llvm/bin:/opt/rocm/hip/bin:/home/user/.poetry/bin:/home/user/pyenv/shims:/home/user/pyenv/bin:/home/user/.poetry/bin:/home/user/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/rocm/bin:/opt/rocm/profiler/bin:/opt/rocm/opencl/bin
~/workspace/rocSPARSE
 % bash install.sh -di
Creating project build directory in: ./build
Get:1 file:/var/opt/amdgpu-pro-local ./ InRelease
Ign:1 file:/var/opt/amdgpu-pro-local ./ InRelease
Get:2 file:/var/opt/amdgpu-pro-local ./ Release [816 B]
Get:2 file:/var/opt/amdgpu-pro-local ./ Release [816 B]
Get:3 file:/var/opt/amdgpu-pro-local ./ Release.gpg
Ign:3 file:/var/opt/amdgpu-pro-local ./ Release.gpg
Hit:4 http://dl.google.com/linux/chrome/deb stable InRelease
Get:5 http://security.ubuntu.com/ubuntu groovy-security InRelease [110 kB]                                                              
Hit:6 http://nl.archive.ubuntu.com/ubuntu groovy InRelease                                                                              
Hit:7 https://download.docker.com/linux/ubuntu groovy InRelease                                                                         
Hit:8 http://nl.archive.ubuntu.com/ubuntu groovy-updates InRelease                                                                      
Hit:9 https://updates.signal.org/desktop/apt xenial InRelease                                                                           
Hit:10 https://packages.microsoft.com/repos/ms-teams stable InRelease                                                                   
Hit:11 https://packages.microsoft.com/repos/vscode stable InRelease                                                                     
Hit:12 http://nl.archive.ubuntu.com/ubuntu groovy-backports InRelease                                                                   
Hit:13 https://repo.nordvpn.com/deb/nordvpn/debian stable InRelease                                                                     
Hit:14 https://repo.radeon.com/rocm/apt/3.9.1 xenial InRelease
Get:15 http://security.ubuntu.com/ubuntu groovy-security/main amd64 DEP-11 Metadata [4.688 B]
Get:16 http://security.ubuntu.com/ubuntu groovy-security/universe amd64 DEP-11 Metadata [4.564 B]
Fetched 120 kB in 1s (149 kB/s)                
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.
~/workspace/rocSPARSE ~/workspace/rocSPARSE
Building googletest from source; installing into /usr/local
-- Configuring gtest external dependency
-- ExternalGmock using ( 13 ) cores to build with
CMake Deprecation Warning at CMakeLists.txt:63 (cmake_policy):
  The OLD behavior for policy CMP0037 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.

-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/rocSPARSE/build/deps
make[1]: Entering directory '/home/user/rocSPARSE/build/deps'
make[2]: Entering directory '/home/user/rocSPARSE/build/deps'
make[2]: Leaving directory '/home/user/rocSPARSE/build/deps'
make[2]: Entering directory '/home/user/rocSPARSE/build/deps'
[ 12%] Performing update step for 'googletest'
[ 25%] Performing configure step for 'googletest'
-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/rocSPARSE/build/deps/gtest/src/googletest-build
[ 37%] Performing build step for 'googletest'
-- googletest build command succeeded.  See also /home/user/rocSPARSE/build/deps/gtest/src/googletest-stamp/googletest-build-*.log
[ 50%] No install step for 'googletest'
[ 62%] Completed 'googletest'
make[2]: Leaving directory '/home/user/rocSPARSE/build/deps'
[100%] Built target googletest
make[1]: Leaving directory '/home/user/rocSPARSE/build/deps'
make[1]: Entering directory '/home/user/rocSPARSE/build/deps'
make[2]: Entering directory '/home/user/rocSPARSE/build/deps'
make[3]: Entering directory '/home/user/rocSPARSE/build/deps'
make[3]: Leaving directory '/home/user/rocSPARSE/build/deps'
make[3]: Entering directory '/home/user/rocSPARSE/build/deps'
[ 12%] Performing update step for 'googletest'
[ 25%] Performing configure step for 'googletest'
-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/rocSPARSE/build/deps/gtest/src/googletest-build
[ 37%] Performing build step for 'googletest'
-- googletest build command succeeded.  See also /home/user/rocSPARSE/build/deps/gtest/src/googletest-stamp/googletest-build-*.log
[ 50%] No install step for 'googletest'
[ 62%] Completed 'googletest'
make[3]: Leaving directory '/home/user/rocSPARSE/build/deps'
[100%] Built target googletest
make[3]: Entering directory '/home/user/rocSPARSE/build/deps'
make[3]: Leaving directory '/home/user/rocSPARSE/build/deps'
make[3]: Entering directory '/home/user/rocSPARSE/build/deps'
gmake[4]: Entering directory '/home/user/rocSPARSE/build/deps/gtest/src/googletest-build'
gmake[5]: Entering directory '/home/user/rocSPARSE/build/deps/gtest/src/googletest-build'
gmake[6]: Entering directory '/home/user/rocSPARSE/build/deps/gtest/src/googletest-build'
gmake[6]: Leaving directory '/home/user/rocSPARSE/build/deps/gtest/src/googletest-build'
[ 25%] Built target gtest
gmake[6]: Entering directory '/home/user/rocSPARSE/build/deps/gtest/src/googletest-build'
gmake[6]: Leaving directory '/home/user/rocSPARSE/build/deps/gtest/src/googletest-build'
[ 50%] Built target gmock
gmake[6]: Entering directory '/home/user/rocSPARSE/build/deps/gtest/src/googletest-build'
gmake[6]: Leaving directory '/home/user/rocSPARSE/build/deps/gtest/src/googletest-build'
[ 75%] Built target gmock_main
gmake[6]: Entering directory '/home/user/rocSPARSE/build/deps/gtest/src/googletest-build'
gmake[6]: Leaving directory '/home/user/rocSPARSE/build/deps/gtest/src/googletest-build'
[100%] Built target gtest_main
gmake[5]: Leaving directory '/home/user/rocSPARSE/build/deps/gtest/src/googletest-build'
Install the project...
-- Install configuration: ""
-- Up-to-date: /usr/local/include
-- Up-to-date: /usr/local/include/gmock
-- Up-to-date: /usr/local/include/gmock/gmock-more-actions.h
-- Up-to-date: /usr/local/include/gmock/gmock-actions.h
-- Up-to-date: /usr/local/include/gmock/gmock-generated-actions.h.pump
-- Up-to-date: /usr/local/include/gmock/gmock-more-matchers.h
-- Up-to-date: /usr/local/include/gmock/gmock.h
-- Up-to-date: /usr/local/include/gmock/gmock-generated-function-mockers.h
-- Up-to-date: /usr/local/include/gmock/gmock-generated-matchers.h.pump
-- Up-to-date: /usr/local/include/gmock/gmock-generated-actions.h
-- Up-to-date: /usr/local/include/gmock/gmock-generated-matchers.h
-- Up-to-date: /usr/local/include/gmock/gmock-generated-nice-strict.h
-- Up-to-date: /usr/local/include/gmock/gmock-matchers.h
-- Up-to-date: /usr/local/include/gmock/internal
-- Up-to-date: /usr/local/include/gmock/internal/gmock-generated-internal-utils.h.pump
-- Up-to-date: /usr/local/include/gmock/internal/gmock-generated-internal-utils.h
-- Up-to-date: /usr/local/include/gmock/internal/gmock-port.h
-- Up-to-date: /usr/local/include/gmock/internal/gmock-internal-utils.h
-- Up-to-date: /usr/local/include/gmock/internal/custom
-- Up-to-date: /usr/local/include/gmock/internal/custom/gmock-generated-actions.h.pump
-- Up-to-date: /usr/local/include/gmock/internal/custom/README.md
-- Up-to-date: /usr/local/include/gmock/internal/custom/gmock-generated-actions.h
-- Up-to-date: /usr/local/include/gmock/internal/custom/gmock-matchers.h
-- Up-to-date: /usr/local/include/gmock/internal/custom/gmock-port.h
-- Up-to-date: /usr/local/include/gmock/gmock-generated-function-mockers.h.pump
-- Up-to-date: /usr/local/include/gmock/gmock-cardinalities.h
-- Up-to-date: /usr/local/include/gmock/gmock-generated-nice-strict.h.pump
-- Up-to-date: /usr/local/include/gmock/gmock-spec-builders.h
-- Up-to-date: /usr/local/lib/libgmock.a
-- Up-to-date: /usr/local/lib/libgmock_main.a
-- Up-to-date: /usr/local/lib/pkgconfig/gmock.pc
-- Up-to-date: /usr/local/lib/pkgconfig/gmock_main.pc
-- Up-to-date: /usr/local/lib/cmake/GTest/GTestTargets.cmake
-- Installing: /usr/local/lib/cmake/GTest/GTestTargets-noconfig.cmake
-- Up-to-date: /usr/local/lib/cmake/GTest/GTestConfigVersion.cmake
-- Up-to-date: /usr/local/lib/cmake/GTest/GTestConfig.cmake
-- Up-to-date: /usr/local/include
-- Up-to-date: /usr/local/include/gtest
-- Up-to-date: /usr/local/include/gtest/gtest.h
-- Up-to-date: /usr/local/include/gtest/gtest-death-test.h
-- Up-to-date: /usr/local/include/gtest/gtest-spi.h
-- Up-to-date: /usr/local/include/gtest/gtest-param-test.h
-- Up-to-date: /usr/local/include/gtest/gtest_pred_impl.h
-- Up-to-date: /usr/local/include/gtest/gtest-message.h
-- Up-to-date: /usr/local/include/gtest/internal
-- Up-to-date: /usr/local/include/gtest/internal/gtest-string.h
-- Up-to-date: /usr/local/include/gtest/internal/gtest-param-util.h
-- Up-to-date: /usr/local/include/gtest/internal/gtest-filepath.h
-- Up-to-date: /usr/local/include/gtest/internal/gtest-param-util-generated.h
-- Up-to-date: /usr/local/include/gtest/internal/gtest-tuple.h.pump
-- Up-to-date: /usr/local/include/gtest/internal/gtest-port-arch.h
-- Up-to-date: /usr/local/include/gtest/internal/gtest-port.h
-- Up-to-date: /usr/local/include/gtest/internal/gtest-type-util.h.pump
-- Up-to-date: /usr/local/include/gtest/internal/gtest-internal.h
-- Up-to-date: /usr/local/include/gtest/internal/gtest-tuple.h
-- Up-to-date: /usr/local/include/gtest/internal/gtest-type-util.h
-- Up-to-date: /usr/local/include/gtest/internal/custom
-- Up-to-date: /usr/local/include/gtest/internal/custom/gtest.h
-- Up-to-date: /usr/local/include/gtest/internal/custom/README.md
-- Up-to-date: /usr/local/include/gtest/internal/custom/gtest-port.h
-- Up-to-date: /usr/local/include/gtest/internal/custom/gtest-printers.h
-- Up-to-date: /usr/local/include/gtest/internal/gtest-linked_ptr.h
-- Up-to-date: /usr/local/include/gtest/internal/gtest-death-test-internal.h
-- Up-to-date: /usr/local/include/gtest/internal/gtest-param-util-generated.h.pump
-- Up-to-date: /usr/local/include/gtest/gtest-test-part.h
-- Up-to-date: /usr/local/include/gtest/gtest-printers.h
-- Up-to-date: /usr/local/include/gtest/gtest_prod.h
-- Up-to-date: /usr/local/include/gtest/gtest-typed-test.h
-- Up-to-date: /usr/local/include/gtest/gtest-param-test.h.pump
-- Up-to-date: /usr/local/lib/libgtest.a
-- Up-to-date: /usr/local/lib/libgtest_main.a
-- Up-to-date: /usr/local/lib/pkgconfig/gtest.pc
-- Up-to-date: /usr/local/lib/pkgconfig/gtest_main.pc
gmake[4]: Leaving directory '/home/user/rocSPARSE/build/deps/gtest/src/googletest-build'
make[3]: Leaving directory '/home/user/rocSPARSE/build/deps'
[100%] Built target install
make[2]: Leaving directory '/home/user/rocSPARSE/build/deps'
make[1]: Leaving directory '/home/user/rocSPARSE/build/deps'
~/workspace/rocSPARSE
~/workspace/rocSPARSE ~/workspace/rocSPARSE
-- The CXX compiler identification is unknown
-- The Fortran compiler identification is GNU 10.2.0
-- Check for working CXX compiler: /opt/rocm/bin/hipcc
-- Check for working CXX compiler: /opt/rocm/bin/hipcc -- broken
CMake Error at /usr/share/cmake-3.16/Modules/CMakeTestCXXCompiler.cmake:53 (message):
  The C++ compiler

    "/opt/rocm/bin/hipcc"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /home/user/rocSPARSE/build/release/CMakeFiles/CMakeTmp

    Run Build Command(s):/usr/bin/gmake cmTC_a30c6/fast && /usr/bin/gmake -f CMakeFiles/cmTC_a30c6.dir/build.make CMakeFiles/cmTC_a30c6.dir/build
    gmake[1]: Entering directory '/home/user/rocSPARSE/build/release/CMakeFiles/CMakeTmp'
    Building CXX object CMakeFiles/cmTC_a30c6.dir/testCXXCompiler.cxx.o
    /opt/rocm/bin/hipcc     -o CMakeFiles/cmTC_a30c6.dir/testCXXCompiler.cxx.o -c /home/user/rocSPARSE/build/release/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
    Can't exec "/opt/rocm/llvm/bin/clang++": No such file or directory at /opt/rocm-3.9.1/hip/bin/hipconfig line 141.
    Use of uninitialized value $HIP_CLANG_VERSION in pattern match (m//) at /opt/rocm-3.9.1/hip/bin/hipconfig line 142.
    Use of uninitialized value $HIP_CLANG_VERSION in concatenation (.) or string at /opt/rocm-3.9.1/hip/bin/hipconfig line 145.
    Can't exec "/opt/rocm/llvm/bin/clang++": No such file or directory at /opt/rocm-3.9.1/hip/bin/hipconfig line 141.
    Use of uninitialized value $HIP_CLANG_VERSION in pattern match (m//) at /opt/rocm-3.9.1/hip/bin/hipconfig line 142.
    Use of uninitialized value $HIP_CLANG_VERSION in concatenation (.) or string at /opt/rocm-3.9.1/hip/bin/hipconfig line 145.
    Can't exec "/opt/rocm/llvm/bin/clang++": No such file or directory at /opt/rocm-3.9.1/hip/bin/hipconfig line 141.
    Use of uninitialized value $HIP_CLANG_VERSION in pattern match (m//) at /opt/rocm-3.9.1/hip/bin/hipconfig line 142.
    Use of uninitialized value $HIP_CLANG_VERSION in concatenation (.) or string at /opt/rocm-3.9.1/hip/bin/hipconfig line 145.
    Can't exec "/opt/rocm/llvm/bin/clang++": No such file or directory at /opt/rocm-3.9.1/hip/bin/hipconfig line 141.
    Use of uninitialized value $HIP_CLANG_VERSION in pattern match (m//) at /opt/rocm-3.9.1/hip/bin/hipconfig line 142.
    Use of uninitialized value $HIP_CLANG_VERSION in concatenation (.) or string at /opt/rocm-3.9.1/hip/bin/hipconfig line 145.
    Can't exec "/opt/rocm-3.9.1/llvm/bin/clang": No such file or directory at /opt/rocm/bin/hipcc line 203.
    Use of uninitialized value $HIP_CLANG_VERSION in pattern match (m//) at /opt/rocm/bin/hipcc line 204.
    Use of uninitialized value $HIP_CLANG_VERSION in concatenation (.) or string at /opt/rocm/bin/hipcc line 208.
    Can't exec "/opt/rocm-3.9.1/llvm/bin/clang": No such file or directory at /opt/rocm/bin/hipcc line 897.
    failed to execute: No such file or directory
    gmake[1]: *** [CMakeFiles/cmTC_a30c6.dir/build.make:66: CMakeFiles/cmTC_a30c6.dir/testCXXCompiler.cxx.o] Error 255
    gmake[1]: Leaving directory '/home/user/rocSPARSE/build/release/CMakeFiles/CMakeTmp'
    gmake: *** [Makefile:121: cmTC_a30c6/fast] Error 2

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

-- Configuring incomplete, errors occurred!
See also "/home/user/rocSPARSE/build/release/CMakeFiles/CMakeOutput.log".
See also "/home/user/rocSPARSE/build/release/CMakeFiles/CMakeError.log".
xuhuisheng commented 3 years ago

Looks like you are installed ROCm-3.9.1. But there is no /opt/rocm/llvm/bin/clang++, maybe the symbolic is wrong. You can check the /opt/rocm/llvm/bin directory manually.

staticdev commented 3 years ago

Strange, inside '/opt/rocm/llvm/bin' folder there is only flang1 and flang2. Same applies to '/opt/rocm-3.9.1/llvm/bin'. It seems it has something to do with kernel 5.10, what is the one you are using?

xuhuisheng commented 3 years ago

Rightnow, ROCm-4.0 cannot support kernel-5.10, event kernel-5.8 in ubuntu-20.04.2, rock-dkms will report a compile error. But other components like llvm can install properly. AMD said that the next version ROCm-4.1 will support kernel-5.8, and I will test ubuntu-20.10 when ROCm-4.1 released.

I suggest using ubuntu-20.04 with kernel-5.4 which we need uninstall kernel-5.8 and install kernel-5.4 manually.

And clang++ comes from llvm-amdgpu package. After installation it should looks like this:

work@22112c8b0ecc:/opt/rocm/llvm/bin$ ls
bugpoint                  clang-nvlink-wrapper   git-clang-format  llvm-cov                llvm-jitlink         llvm-pdbutil     llvm-xray
c-index-test              clang-offload-bundler  hmaptool          llvm-cvtres             llvm-lib             llvm-profdata    modularize
clang                     clang-offload-wrapper  ld.lld            llvm-cxxdump            llvm-libtool-darwin  llvm-ranlib      obj2yaml
clang++                   clang-query            ld64.lld          llvm-cxxfilt            llvm-link            llvm-rc          opt
clang-12                  clang-refactor         llc               llvm-cxxmap             llvm-lipo            llvm-readelf     pp-trace
clang-apply-replacements  clang-rename           lld               llvm-diff               llvm-lto             llvm-readobj     sancov
clang-build-select-link   clang-reorder-fields   lld-link          llvm-dis                llvm-lto2            llvm-reduce      sanstats
clang-change-namespace    clang-scan-deps        lli               llvm-dlltool            llvm-mc              llvm-rtdyld      scan-build
clang-check               clang-tidy             llvm-addr2line    llvm-dwarfdump          llvm-mca             llvm-size        scan-view
clang-cl                  clangd                 llvm-ar           llvm-dwp                llvm-ml              llvm-split       verify-uselistorder
clang-cpp                 diagtool               llvm-as           llvm-elfabi             llvm-modextract      llvm-stress      wasm-ld
clang-doc                 dsymutil               llvm-bcanalyzer   llvm-exegesis           llvm-mt              llvm-strings     yaml2obj
clang-extdef-mapping      find-all-symbols       llvm-c-test       llvm-extract            llvm-nm              llvm-strip
clang-format              flang                  llvm-cat          llvm-gsymutil           llvm-objcopy         llvm-symbolizer
clang-include-fixer       flang1                 llvm-cfi-verify   llvm-ifs                llvm-objdump         llvm-tblgen
clang-move                flang2                 llvm-config       llvm-install-name-tool  llvm-opt-report      llvm-undname

And I just install ROCm-4.0.1 on docker ubuntu-20.10 image. llvm-amdgpu is just fine. you can check whether llvm-amdgpu installation successful or not.

staticdev commented 3 years ago

I see.. my idea was merging your solution with the one from this article that uses Ubuntu 20.10 with Kernel 5.10 with yours since I couldn't make my RX580 work with ROCM 4.0. But it is getting very complex, for now I will simply try it then with Ubuntu 20.04.2 and Kernel 5.4 as you suggested.

xuhuisheng commented 3 years ago

The patch of rocSPARSE is very simple. You can see the diff is just 2 lines from pull request https://github.com/ROCmSoftwarePlatform/rocSPARSE/pull/213.

The rocBLAS is more complex. We need patch both tensile and rocBLAS.

But I think your problem is the installation of ROCm. Maybe you can check why llvm-amdgpu can't install correctly, later.

staticdev commented 3 years ago

Nice @xuhuisheng, don't you think they would accept your patch as a PR on rocSPARSE?

xuhuisheng commented 3 years ago

@staticdev The patch of rocSPARSE had already merged, it will be released on ROCm-4.1. ROCmSoftwarePlatform/rocSPARSE#213 .

Bad news is there is another exactly same issue on rocRAND, and AMD seems didn't want to merge the patch of rocRAND for gfx803. https://github.com/ROCmSoftwarePlatform/rocRAND/pull/159. So with ROCm-4.1 we needn't patch rocSPARSE ,but rocRAND.

AMD had drop official support on ROCm-4.0. I just want to find a way to make gfx803 live longer, maybe I can maintains a community version of ROCm for gfx803.

staticdev commented 3 years ago

Nice @xuhuisheng, I dropped a comment on your PR trying to help. Thanks for that, let's be hopeful.

xuhuisheng commented 3 years ago

Thanks. Let's waiting for AMD response.

staticdev commented 3 years ago

@xuhuisheng also, I installed Ubuntu 20.04.2 and tried to run everything in this repo, but I got an error on ./19.hip.sh:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
kmod is already the newest version (27-1ubuntu2).
libfile-which-perl is already the newest version (1.23-1).
libfile-which-perl set to manually installed.
The following additional packages will be installed:
  debugedit librpm8 librpmbuild8 librpmio8 librpmsign8 rpm-common rpm2cpio
Suggested packages:
  rpm-i18n doxygen-latex doxygen-doc doxygen-gui graphviz alien elfutils
  rpmlint rpm2html
The following NEW packages will be installed:
  debugedit doxygen librpm8 librpmbuild8 librpmio8 librpmsign8 rpm rpm-common
  rpm2cpio
0 upgraded, 9 newly installed, 0 to remove and 0 not upgraded.
Need to get 10,1 MB of archives.
After this operation, 45,5 MB of additional disk space will be used.
Get:1 http://br.archive.ubuntu.com/ubuntu focal/universe amd64 librpmio8 amd64 4.14.2.1+dfsg1-1build2 [75,2 kB]
Get:2 http://br.archive.ubuntu.com/ubuntu focal/universe amd64 debugedit amd64 4.14.2.1+dfsg1-1build2 [19,5 kB]
Get:3 http://br.archive.ubuntu.com/ubuntu focal/universe amd64 doxygen amd64 1.8.17-0ubuntu2 [9.630 kB]
Get:4 http://br.archive.ubuntu.com/ubuntu focal/universe amd64 librpm8 amd64 4.14.2.1+dfsg1-1build2 [174 kB]
Get:5 http://br.archive.ubuntu.com/ubuntu focal/universe amd64 librpmbuild8 amd64 4.14.2.1+dfsg1-1build2 [70,9 kB]
Get:6 http://br.archive.ubuntu.com/ubuntu focal/universe amd64 librpmsign8 amd64 4.14.2.1+dfsg1-1build2 [8.280 B]
Get:7 http://br.archive.ubuntu.com/ubuntu focal/universe amd64 rpm-common amd64 4.14.2.1+dfsg1-1build2 [28,8 kB]
Get:8 http://br.archive.ubuntu.com/ubuntu focal/universe amd64 rpm2cpio amd64 4.14.2.1+dfsg1-1build2 [8.096 B]
Get:9 http://br.archive.ubuntu.com/ubuntu focal/universe amd64 rpm amd64 4.14.2.1+dfsg1-1build2 [119 kB]
Fetched 10,1 MB in 18s (570 kB/s)                                              
Selecting previously unselected package librpmio8.
(Reading database ... 499861 files and directories currently installed.)
Preparing to unpack .../0-librpmio8_4.14.2.1+dfsg1-1build2_amd64.deb ...
Unpacking librpmio8 (4.14.2.1+dfsg1-1build2) ...
Selecting previously unselected package debugedit.
Preparing to unpack .../1-debugedit_4.14.2.1+dfsg1-1build2_amd64.deb ...
Unpacking debugedit (4.14.2.1+dfsg1-1build2) ...
Selecting previously unselected package doxygen.
Preparing to unpack .../2-doxygen_1.8.17-0ubuntu2_amd64.deb ...
Unpacking doxygen (1.8.17-0ubuntu2) ...
Selecting previously unselected package librpm8.
Preparing to unpack .../3-librpm8_4.14.2.1+dfsg1-1build2_amd64.deb ...
Unpacking librpm8 (4.14.2.1+dfsg1-1build2) ...
Selecting previously unselected package librpmbuild8.
Preparing to unpack .../4-librpmbuild8_4.14.2.1+dfsg1-1build2_amd64.deb ...
Unpacking librpmbuild8 (4.14.2.1+dfsg1-1build2) ...
Selecting previously unselected package librpmsign8.
Preparing to unpack .../5-librpmsign8_4.14.2.1+dfsg1-1build2_amd64.deb ...
Unpacking librpmsign8 (4.14.2.1+dfsg1-1build2) ...
Selecting previously unselected package rpm-common.
Preparing to unpack .../6-rpm-common_4.14.2.1+dfsg1-1build2_amd64.deb ...
Unpacking rpm-common (4.14.2.1+dfsg1-1build2) ...
Selecting previously unselected package rpm2cpio.
Preparing to unpack .../7-rpm2cpio_4.14.2.1+dfsg1-1build2_amd64.deb ...
Unpacking rpm2cpio (4.14.2.1+dfsg1-1build2) ...
Selecting previously unselected package rpm.
Preparing to unpack .../8-rpm_4.14.2.1+dfsg1-1build2_amd64.deb ...
Unpacking rpm (4.14.2.1+dfsg1-1build2) ...
Setting up librpmio8 (4.14.2.1+dfsg1-1build2) ...
Setting up librpm8 (4.14.2.1+dfsg1-1build2) ...
Setting up rpm-common (4.14.2.1+dfsg1-1build2) ...
Setting up doxygen (1.8.17-0ubuntu2) ...
Setting up librpmbuild8 (4.14.2.1+dfsg1-1build2) ...
Setting up librpmsign8 (4.14.2.1+dfsg1-1build2) ...
Setting up debugedit (4.14.2.1+dfsg1-1build2) ...
Setting up rpm2cpio (4.14.2.1+dfsg1-1build2) ...
Setting up rpm (4.14.2.1+dfsg1-1build2) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
Processing triggers for man-db (2.9.1-1) ...
~/workspace/rocm-build/build/hip ~/workspace/rocm-build/build/hip
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- 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/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Git: /usr/bin/git (found version "2.25.1") 
Using CPACK_DEBIAN_PACKAGE_RELEASE local
CPACK_RPM_PACKAGE_RELEASE: local
-- HIP Platform: rocclr
-- HIP Compiler: clang
-- HIP will be installed in: /opt/rocm/hip
-- ROCM Installation path(ROCM_PATH): /opt/rocm
-- Looking for HSA runtime in: /opt/rocm/hsa
-- Found PythonInterp: ~/.pyenv/versions/3.8.2/bin/python (found version "3.8.2") 
CMake Error at rocclr/CMakeLists.txt:44 (find_package):
  Could not find a package configuration file provided by "ROCclr" with any
  of the following names:

    ROCclrConfig.cmake
    rocclr-config.cmake

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

-- Configuring incomplete, errors occurred!
See also "~/workspace/rocm-build/build/hip/CMakeFiles/CMakeOutput.log".

Also the CMakeOutput.log

xuhuisheng commented 3 years ago

We need install rocclr before hip. Actually, we need follow the order of scripts. from 11 to 19.

staticdev commented 3 years ago

@xuhuisheng this is very strange. I did it in the right order and seems that rocclr were successfully compiled, even though I got this error on hip compilation.

xuhuisheng commented 3 years ago

In rocm-build, ROCclr need be installed to /opt/rocm, HIP will search the cmake of ROCClr from /opt/rocm. You can check whether there is /opt/rocm/rocclr or not.

staticdev commented 3 years ago

@xuhuisheng sorry for the late reply.. /opt/rocm/rocclr was not there even though the script succeeded. Meanwhile I saw that 4.1 version was released. So the need for these patches for rocSPARCE and rocRAND does not exist anymore right? Does that mean that default installation of 4.1.0 ROCm should work on gfx803?

xuhuisheng commented 3 years ago

@staticdev The rocSPARSE issue hadd been fixed on ROCm-4.1. We only need handle rocBLAS and rocRAND issues now. https://github.com/xuhuisheng/rocm-build/blob/master/gfx803/README.md

xuhuisheng commented 3 years ago

It's 31st May. I will close this issue. If you still have problems, please re-open it.

tallero commented 3 years ago

same problem on arch with kernel lts 5.10

xuhuisheng commented 3 years ago

@tallero I didn't use arch before. But It is really strange that llvm will meet the same problem when using kernel 5.10.

tallero commented 3 years ago

@xuhuisheng it was not (#614)