ROCm / roctracer

ROCm Tracer Callback/Activity Library for Performance tracing AMD GPUs
https://rocm.docs.amd.com/projects/roctracer/en/latest/
Other
64 stars 30 forks source link

MatrixTranspose_test does not build due to numerious path issues #73

Closed gggh000 closed 1 year ago

gggh000 commented 2 years ago

Apparently make is expecting hipcc in ../../../bin/hipcc but it is in ../../../HIP/bin/hipcc relative from ~/ROCm-4.5/roctracer/test/MatrixTranspose_test location. Please note that this disrepancy happens after entire ROCm source code structure downloaded by repo sync and not changed.

root@nonroot-SYS-7049GP-TRT:~/ROCm-4.5/roctracer/test/MatrixTranspose_test# make
rm -f ./MatrixTranspose
rm -f MatrixTranspose.o
rm -f ../../../src/*.o
../../../bin/hipcc -g -I../../inc -I/opt/rocm/hsa/include/hsa -I/opt/rocm/hsa/include -I/opt/rocm/hip/include -I/opt/rocm/include -DLOCAL_BUILD=1 -DITERATIONS=100 -DAMD_INTERNAL_BUILD=1 -DHIP_TEST=1 --rocm-path=/opt/rocm -c -o MatrixTranspose.o MatrixTranspose.cpp
make: ../../../bin/hipcc: Command not found
Makefile:43: recipe for target 'MatrixTranspose.o' failed
make: *** [MatrixTranspose.o] Error 127
root@nonroot-SYS-7049GP-TRT:~/ROCm-4.5/roctracer/test/MatrixTranspose_test# hipcc
No Arguments passed, exiting ...
root@nonroot-SYS-7049GP-TRT:~/ROCm-4.5/roctracer/test/MatrixTranspose_test# ls -l /opt
total 36
drwxr-xr-x 4 root    root    4096 Dec 12 04:45 amdgpu
drwxr-xr-x 1 root    root    4096 Dec 12 05:16 cache
drwxr-xr-x 1 jenkins jenkins 4096 Dec 12 05:19 conda
drwxr-xr-x 4 root    root    4096 Dec 12 06:35 mpi_install
drwxr-xr-x 7 root    root    4096 Dec 12 06:43 ompi
lrwxrwxrwx 1 root    root      16 Feb  8 09:02 rocm -> /opt/rocm-4.3.2/
drwxr-xr-x 1 root    root    4096 Feb  7 07:39 rocm-4.5.2
drwxr-xr-x 6 root    root    4096 Dec 12 06:35 ucx
root@nonroot-SYS-7049GP-TRT:~/ROCm-4.5/roctracer/test/MatrixTranspose_test# ln ^C
root@nonroot-SYS-7049GP-TRT:~/ROCm-4.5/roctracer/test/MatrixTranspose_test# find ../../../ -name hipcc
../../../HIP/bin/hipcc
root@nonroot-SYS-7049GP-TRT:~/ROCm-4.5/roctracer/test/MatrixTranspose_test# 
gggh000 commented 2 years ago

I have hacked the Makefile to point correct path in hipcc but I think Makefile has too many improper paths and library path defined:


diff --git a/test/MatrixTranspose_test/Makefile b/test/MatrixTranspose_test/Makefile
index d0eab5a..26c8d8c 100644
--- a/test/MatrixTranspose_test/Makefile
+++ b/test/MatrixTranspose_test/Makefile
@@ -9,7 +9,7 @@ ROC_LIBS  = -Wl,--rpath,${LIB_PATH} $(LIB_PATH)/libroctracer64.so $(LIB_PATH)/li

 HIP_PATH ?= $(wildcard /opt/rocm/hip)
 ifeq (,$(HIP_PATH))
-   HIP_PATH=../../..
+   HIP_PATH=../../../HIP
 endif

 HIPCC=$(HIP_PATH)/bin/hipcc

root@nonroot-SYS-7049GP-TRT:~/ROCm-4.5/roctracer/test/MatrixTranspose_test# make
rm -f ./MatrixTranspose
rm -f MatrixTranspose.o
rm -f /opt/rocm/hip/src/*.o
/opt/rocm/hip/bin/hipcc -g -I../../inc -I/opt/rocm/hsa/include/hsa -I/opt/rocm/hsa/include -I/opt/rocm/hip/include -I/opt/rocm/include -DLOCAL_BUILD=1 -DITERATIONS=100 -DAMD_INTERNAL_BUILD=1 -DHIP_TEST=1 --rocm-path=/opt/rocm -c -o MatrixTranspose.o MatrixTranspose.cpp
In file included from MatrixTranspose.cpp:234:
../../inc/roctracer_hip.h:41:10: fatal error: 'hip_ostream_ops.h' file not found
#include <hip_ostream_ops.h>
         ^~~~~~~~~~~~~~~~~~~
1 error generated when compiling for gfx803.
Makefile:43: recipe for target 'MatrixTranspose.o' failed
make: *** [MatrixTranspose.o] Error 1
root@nonroot-SYS-7049GP-TRT:~/ROCm-4.5/roctracer/test/MatrixTranspose_test# find /opt -name hip_ostream_ops.h
/opt/rocm-4.5.2/roctracer/include/hip_ostream_ops.h
/opt/rocm-4.5.2/include/roctracer/hip_ostream_ops.h
lmoriche commented 1 year ago

This should be fixed in ROCm-5.3