ROCm / HIP-Examples

Examples for HIP
200 stars 90 forks source link

test_all.sh doesn't work by default #23

Closed baryluk closed 3 months ago

baryluk commented 3 years ago
$ /opt/rocm-3.10.0/bin/hipconfig 
HIP version  : 3.10.20465-f9876b8d

== hipconfig
HIP_PATH     : /opt/rocm-3.10.0/hip
ROCM_PATH    : /opt/rocm-3.10.0
HIP_COMPILER : clang
HIP_PLATFORM : hcc
HIP_RUNTIME  : ROCclr
CPP_CONFIG   :  -D__HIP_PLATFORM_HCC__=  -I/opt/rocm-3.10.0/hip/include -I/opt/rocm-3.10.0/llvm/bin/../lib/clang/12.0.0 -I/opt/rocm-3.10.0/hsa/include -D__HIP_ROCclr__

== hip-clang
HSA_PATH         : /opt/rocm-3.10.0/hsa
HIP_CLANG_PATH   : /opt/rocm-3.10.0/llvm/bin
clang version 12.0.0 (/src/external/llvm-project/clang 60f39e2924d51c1e8606f2135f95e9047fb1da5d)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/rocm-3.10.0/llvm/bin
LLVM (http://llvm.org/):
  LLVM version 12.0.0git
  Optimized build.
  Default target: x86_64-unknown-linux-gnu
  Host CPU: znver1

  Registered Targets:
    amdgcn - AMD GCN GPUs
    r600   - AMD GPUs HD2XXX-HD6XXX
    x86    - 32-bit X86: Pentium-Pro and above
    x86-64 - 64-bit X86: EM64T and AMD64
hip-clang-cxxflags : -D__HIP_ROCclr__ -std=c++11 -isystem /opt/rocm-3.10.0/llvm/lib/clang/12.0.0/include/.. -isystem /opt/rocm-3.10.0/hsa/include -D__HIP_ROCclr__ -isystem /opt/rocm-3.10.0/hip/include -O3
hip-clang-ldflags  :  -L/opt/rocm-3.10.0/hip/lib -O3 -lgcc_s -lgcc -lpthread -lm

=== Environment Variables
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games

== Linux Kernel
Hostname     : debian
Linux debian 5.9.0-3-amd64 #1 SMP Debian 5.9.9-1 (2020-11-19) x86_64 GNU/Linux
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux bullseye/sid
Release:    unstable
Codename:   sid
$

But the script and all makefiles fail:

user@debian:~/HIP-Examples$ ./test_all.sh 

==== vectorAdd ====
rm -f ./vectoradd_hip.exe
rm -f vectoradd_hip.o
rm -f ../../../src/*.o
../../../bin/hipcc -g   -c -o vectoradd_hip.o vectoradd_hip.cpp
make: ../../../bin/hipcc: No such file or directory
make: *** [<builtin>: vectoradd_hip.o] Error 127

==== gpu-burn ====
make: /opt/rocm/hip/bin/hipconfig: No such file or directory
rm -rf build
make: /opt/rocm/hip/bin/hipconfig: No such file or directory
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  
make: /opt/rocm/hip/bin/hipcc: No such file or directory
make: *** [Makefile:28: build/AmdGpuMonitor.o] Error 127
./test_all.sh: line 19: ./build/gpuburn-hip: No such file or directory

==== strided-access ====
rm -f strided-access *.o
Makefile:13: *** "Cannot find ../../../bin/hipcc, please install HIP toolkit".  Stop.
./test_all.sh: line 28: ./strided-access: No such file or directory

==== rtm8 ====
Please install rocm package
Using HIP_PATH=
hipcc -std=c++11 -O3 -o rtm8_hip rtm8.cpp
./build_hip.sh: line 23: /bin/hipcc: No such file or directory
./test_all.sh: line 37: ./rtm8_hip: No such file or directory

==== reduction ====
rm -f reduction *.o
Makefile:13: *** "Cannot find ../../../bin/hipcc, please install HIP toolkit".  Stop.
./reduction 1024*1024*4
./run.sh: line 7: ./reduction: No such file or directory
./reduction 8388608
./run.sh: line 7: ./reduction: No such file or directory
./reduction 16777216
./run.sh: line 7: ./reduction: No such file or directory
./reduction 33554432
./run.sh: line 7: ./reduction: No such file or directory
./reduction 67108864
./run.sh: line 7: ./reduction: No such file or directory
./reduction 134217728
./run.sh: line 7: ./reduction: No such file or directory
./reduction 268435456
./run.sh: line 7: ./reduction: No such file or directory
./reduction 536870912
./run.sh: line 7: ./reduction: No such file or directory

==== mini-nbody ====
Please install rocm package
hipcc -I../ -DSHMOO nbody-orig.cpp -o nbody-orig
./HIP-nbody-orig.sh: line 23: /bin/hipcc: No such file or directory
./nbody-orig 1024
./HIP-nbody-orig.sh: line 35: ./nbody-orig: No such file or directory
./nbody-orig 2048
./HIP-nbody-orig.sh: line 35: ./nbody-orig: No such file or directory
./nbody-orig 4096
./HIP-nbody-orig.sh: line 35: ./nbody-orig: No such file or directory
./nbody-orig 8192
./HIP-nbody-orig.sh: line 35: ./nbody-orig: No such file or directory
./nbody-orig 16384
./HIP-nbody-orig.sh: line 35: ./nbody-orig: No such file or directory
./nbody-orig 32768
./HIP-nbody-orig.sh: line 35: ./nbody-orig: No such file or directory
./nbody-orig 65536
./HIP-nbody-orig.sh: line 35: ./nbody-orig: No such file or directory
./nbody-orig 131072
./HIP-nbody-orig.sh: line 35: ./nbody-orig: No such file or directory
./nbody-orig 262144
./HIP-nbody-orig.sh: line 35: ./nbody-orig: No such file or directory
./nbody-orig 524288
./HIP-nbody-orig.sh: line 35: ./nbody-orig: No such file or directory
Please install rocm package
hipcc -I../ -DSHMOO nbody-soa.cpp -o nbody-soa
./HIP-nbody-soa.sh: line 26: /bin/hipcc: No such file or directory
./nbody-soa 1024
./HIP-nbody-soa.sh: line 37: ./nbody-soa: No such file or directory
./nbody-soa 2048
./HIP-nbody-soa.sh: line 37: ./nbody-soa: No such file or directory
./nbody-soa 4096
./HIP-nbody-soa.sh: line 37: ./nbody-soa: No such file or directory
./nbody-soa 8192
./HIP-nbody-soa.sh: line 37: ./nbody-soa: No such file or directory
./nbody-soa 16384
./HIP-nbody-soa.sh: line 37: ./nbody-soa: No such file or directory
./nbody-soa 32768
./HIP-nbody-soa.sh: line 37: ./nbody-soa: No such file or directory
./nbody-soa 65536
./HIP-nbody-soa.sh: line 37: ./nbody-soa: No such file or directory
./nbody-soa 131072
./HIP-nbody-soa.sh: line 37: ./nbody-soa: No such file or directory
Please install rocm package
hipcc -I../ -DSHMOO nbody-block.cpp -o nbody-block
./HIP-nbody-block.sh: line 26: /bin/hipcc: No such file or directory
./nbody-block 1024
./HIP-nbody-block.sh: line 37: ./nbody-block: No such file or directory
./nbody-block 2048
./HIP-nbody-block.sh: line 37: ./nbody-block: No such file or directory
./nbody-block 4096
./HIP-nbody-block.sh: line 37: ./nbody-block: No such file or directory
./nbody-block 8192
./HIP-nbody-block.sh: line 37: ./nbody-block: No such file or directory
./nbody-block 16384
./HIP-nbody-block.sh: line 37: ./nbody-block: No such file or directory
./nbody-block 32768
./HIP-nbody-block.sh: line 37: ./nbody-block: No such file or directory
./nbody-block 65536
./HIP-nbody-block.sh: line 37: ./nbody-block: No such file or directory
./nbody-block 131072
./HIP-nbody-block.sh: line 37: ./nbody-block: No such file or directory

==== add4 ====
rm -f   gpu-stream-hip *.o
../../../bin/hipcc -std=c++11 -O3 -c hip-stream.cpp -o hip-stream.o
make: ../../../bin/hipcc: No such file or directory
make: *** [Makefile:14: hip-stream.o] Error 127
./gpu-stream-hip
./runhip.sh: line 2: ./gpu-stream-hip: No such file or directory
./gpu-stream-hip --groups 256 --groupSize 256
./runhip.sh: line 4: ./gpu-stream-hip: No such file or directory
./gpu-stream-hip --float
./runhip.sh: line 6: ./gpu-stream-hip: No such file or directory
./gpu-stream-hip --float --groups 256 --groupSize 256
./runhip.sh: line 8: ./gpu-stream-hip: No such file or directory

==== cuda-stream ====
rm -f stream *.o
Makefile:13: *** "Cannot find ../../../bin/hipcc, please install HIP toolkit".  Stop.
./test_all.sh: line 72: ./stream: No such file or directory

==== Rodinia ====
--CLEAN: backprop
--CLEAN: bfs
--CLEAN: b+tree
--CLEAN: cfd
--CLEAN: dwt2d
--CLEAN: gaussian
--CLEAN: heartwall
--CLEAN: hotspot
--CLEAN: hybridsort
--CLEAN: kmeans
--CLEAN: lavaMD
--CLEAN: lud
--CLEAN: myocyte
--CLEAN: nn
--CLEAN: nw
--CLEAN: pathfinder
--CLEAN: srad
--CLEAN: streamcluster
--TESTING: backprop
BUILD FAILURE!!
--TESTING: bfs
BUILD FAILURE!!
--TESTING: b+tree
BUILD FAILURE!!
--TESTING: cfd
BUILD FAILURE!!
--TESTING: dwt2d
BUILD FAILURE!!
--TESTING: gaussian
BUILD FAILURE!!
--TESTING: heartwall
BUILD FAILURE!!
--TESTING: hotspot
BUILD FAILURE!!
--TESTING: hybridsort
BUILD FAILURE!!
--TESTING: kmeans
BUILD FAILURE!!
--TESTING: lavaMD
BUILD FAILURE!!
--TESTING: lud
BUILD FAILURE!!
--TESTING: myocyte
BUILD FAILURE!!
--TESTING: nn
BUILD FAILURE!!
--TESTING: nw
BUILD FAILURE!!
--TESTING: pathfinder
BUILD FAILURE!!
--TESTING: srad
BUILD FAILURE!!
--TESTING: streamcluster
BUILD FAILURE!!

==== OpenMP Hello World ====
./test_all.sh: line 87: cd: openmp-helloworld: No such file or directory
CMake Error: The source directory "/home/user/HIP-Examples/rodinia_3.0" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
make: *** No targets specified and no makefile found.  Stop.
./test_all.sh: line 92: ./test_openmp_helloworld: No such file or directory
user@debian:~/HIP-Examples$ 

It would be nice if it the script and makefiles are smarter.

Doing, $ HIP_PATH=/opt/rocm-3.10.0/hip ./test_all.sh appears to work. But should be documented in README at least I think. Or script should do detection better, if it is not set.

One of the options is to simply to call hipconfig directly and just relay on the user having PATH setup. I think it is more reliable.

baryluk commented 9 months ago

Still broken with rocm 6.0.2

and this repo at ff8123937c8851d86b1edfbad9f032462c48aa05

user@debian:~/HIP-Examples$ ./test_all.sh 

==== vectorAdd ====
rm -f ./vectoradd_hip.exe
rm -f vectoradd_hip.o
rm -f /opt/rocm/src/*.o
/opt/rocm/bin/hipcc -g   -c -o vectoradd_hip.o vectoradd_hip.cpp
In file included from <built-in>:1:
In file included from /opt/rocm-6.0.2/lib/llvm/lib/clang/17.0.0/include/__clang_hip_runtime_wrapper.h:50:
/opt/rocm-6.0.2/lib/llvm/lib/clang/17.0.0/include/cuda_wrappers/cmath:27:15: fatal error: 'cmath' file not found
#include_next <cmath>
              ^~~~~~~
1 error generated when compiling for gfx1030.
make: *** [<builtin>: vectoradd_hip.o] Error 1

==== gpu-burn ====
rm -rf build
mkdir -p build
/opt/rocm/bin/hipcc -I/opt/rocm/../include -O3 -c -o build/AmdGpuMonitor.o AmdGpuMonitor.cpp  
In file included from <built-in>:1:
In file included from /opt/rocm-6.0.2/lib/llvm/lib/clang/17.0.0/include/__clang_hip_runtime_wrapper.h:50:
/opt/rocm-6.0.2/lib/llvm/lib/clang/17.0.0/include/cuda_wrappers/cmath:27:15: fatal error: 'cmath' file not found
#include_next <cmath>
              ^~~~~~~
1 error generated when compiling for gfx1030.
make: *** [Makefile:30: build/AmdGpuMonitor.o] Error 1
./test_all.sh: line 19: ./build/gpuburn-hip: No such file or directory

==== strided-access ====
rm -f strided-access *.o
/opt/rocm/bin/hipcc -std=c++11 -O3 -o strided-access benchmark-hip.cpp 
In file included from <built-in>:1:
In file included from /opt/rocm-6.0.2/lib/llvm/lib/clang/17.0.0/include/__clang_hip_runtime_wrapper.h:50:
/opt/rocm-6.0.2/lib/llvm/lib/clang/17.0.0/include/cuda_wrappers/cmath:27:15: fatal error: 'cmath' file not found
#include_next <cmath>
              ^~~~~~~
1 error generated when compiling for gfx1030.
make: *** [Makefile:8: strided-access] Error 1
./test_all.sh: line 28: ./strided-access: No such file or directory

==== rtm8 ====
hipcc -std=c++11 -O3 -o rtm8_hip rtm8.cpp
In file included from <built-in>:1:
In file included from /opt/rocm-6.0.2/lib/llvm/lib/clang/17.0.0/include/__clang_hip_runtime_wrapper.h:50:
/opt/rocm-6.0.2/lib/llvm/lib/clang/17.0.0/include/cuda_wrappers/cmath:27:15: fatal error: 'cmath' file not found
#include_next <cmath>
              ^~~~~~~
1 error generated when compiling for gfx1030.
./test_all.sh: line 37: ./rtm8_hip: No such file or directory

==== reduction ====
rm -f reduction *.o
/opt/rocm/bin/hipcc -std=c++11 -O3 -o reduction reduction.cpp 
In file included from <built-in>:1:
In file included from /opt/rocm-6.0.2/lib/llvm/lib/clang/17.0.0/include/__clang_hip_runtime_wrapper.h:50:
/opt/rocm-6.0.2/lib/llvm/lib/clang/17.0.0/include/cuda_wrappers/cmath:27:15: fatal error: 'cmath' file not found
#include_next <cmath>
              ^~~~~~~
1 error generated when compiling for gfx1030.
make: *** [Makefile:8: reduction] Error 1
./reduction 1024*1024*4
./run.sh: line 7: ./reduction: No such file or directory
./reduction 8388608
./run.sh: line 7: ./reduction: No such file or directory
./reduction 16777216
./run.sh: line 7: ./reduction: No such file or directory
./reduction 33554432
./run.sh: line 7: ./reduction: No such file or directory
./reduction 67108864
./run.sh: line 7: ./reduction: No such file or directory
./reduction 134217728
./run.sh: line 7: ./reduction: No such file or directory
./reduction 268435456
./run.sh: line 7: ./reduction: No such file or directory
./reduction 536870912
./run.sh: line 7: ./reduction: No such file or directory

==== mini-nbody ====
hipcc -I../ -DSHMOO nbody-orig.cpp -o nbody-orig
In file included from <built-in>:1:
In file included from /opt/rocm-6.0.2/lib/llvm/lib/clang/17.0.0/include/__clang_hip_runtime_wrapper.h:50:
/opt/rocm-6.0.2/lib/llvm/lib/clang/17.0.0/include/cuda_wrappers/cmath:27:15: fatal error: 'cmath' file not found
#include_next <cmath>
              ^~~~~~~
1 error generated when compiling for gfx1030.
./nbody-orig 1024
./HIP-nbody-orig.sh: line 35: ./nbody-orig: No such file or directory
./nbody-orig 2048
./HIP-nbody-orig.sh: line 35: ./nbody-orig: No such file or directory
./nbody-orig 4096
./HIP-nbody-orig.sh: line 35: ./nbody-orig: No such file or directory
./nbody-orig 8192
./HIP-nbody-orig.sh: line 35: ./nbody-orig: No such file or directory
./nbody-orig 16384
./HIP-nbody-orig.sh: line 35: ./nbody-orig: No such file or directory
./nbody-orig 32768
./HIP-nbody-orig.sh: line 35: ./nbody-orig: No such file or directory
./nbody-orig 65536
./HIP-nbody-orig.sh: line 35: ./nbody-orig: No such file or directory
./nbody-orig 131072
./HIP-nbody-orig.sh: line 35: ./nbody-orig: No such file or directory
./nbody-orig 262144
./HIP-nbody-orig.sh: line 35: ./nbody-orig: No such file or directory
./nbody-orig 524288
./HIP-nbody-orig.sh: line 35: ./nbody-orig: No such file or directory
hipcc -I../ -DSHMOO nbody-soa.cpp -o nbody-soa
In file included from <built-in>:1:
In file included from /opt/rocm-6.0.2/lib/llvm/lib/clang/17.0.0/include/__clang_hip_runtime_wrapper.h:50:
/opt/rocm-6.0.2/lib/llvm/lib/clang/17.0.0/include/cuda_wrappers/cmath:27:15: fatal error: 'cmath' file not found
#include_next <cmath>
              ^~~~~~~
1 error generated when compiling for gfx1030.
./nbody-soa 1024
./HIP-nbody-soa.sh: line 37: ./nbody-soa: No such file or directory
./nbody-soa 2048
./HIP-nbody-soa.sh: line 37: ./nbody-soa: No such file or directory
./nbody-soa 4096
./HIP-nbody-soa.sh: line 37: ./nbody-soa: No such file or directory
./nbody-soa 8192
./HIP-nbody-soa.sh: line 37: ./nbody-soa: No such file or directory
./nbody-soa 16384
./HIP-nbody-soa.sh: line 37: ./nbody-soa: No such file or directory
./nbody-soa 32768
./HIP-nbody-soa.sh: line 37: ./nbody-soa: No such file or directory
./nbody-soa 65536
./HIP-nbody-soa.sh: line 37: ./nbody-soa: No such file or directory
./nbody-soa 131072
./HIP-nbody-soa.sh: line 37: ./nbody-soa: No such file or directory
hipcc -I../ -DSHMOO nbody-block.cpp -o nbody-block
In file included from <built-in>:1:
In file included from /opt/rocm-6.0.2/lib/llvm/lib/clang/17.0.0/include/__clang_hip_runtime_wrapper.h:50:
/opt/rocm-6.0.2/lib/llvm/lib/clang/17.0.0/include/cuda_wrappers/cmath:27:15: fatal error: 'cmath' file not found
#include_next <cmath>
              ^~~~~~~
1 error generated when compiling for gfx1030.
...
...
...
ppanchad-amd commented 3 months ago

@baryluk Internal ticket has been created to fix this issue. Thanks!

schung-amd commented 3 months ago

Closing as the HIP Examples are deprecated, please use rocm-examples and open an issue there if you have further issues.