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

Radeon VII #175

Open
commandline-be opened this issue Nov 4, 2024 · 54 comments
Open

Radeon VII #175

commandline-be opened this issue Nov 4, 2024 · 54 comments

Comments

@commandline-be
Copy link

owner of a Radeon VII card, if i can help testing code to run well on it, let me know

@lamikr
Copy link
Owner

lamikr commented Nov 7, 2024

Hi, that would be really interesting!

Most of the rocm components seems to had by default the support for in code for the Radeon VII/gfx906 in place by default and couple of weeks ago I went through all the common places typically requiring patching. I have tested that everything should now build for these cards but not been able to test functionality with VII.

That said, if you have time it would be great if you could try to make the build and test it. These steps should help you to get started.

git clone [email protected]:lamikr/rocm_sdk_builder.git 
cd rocm_sdk_builder
./install_deps.sh
./babs.sh -c (choose gfx906)
./babs.sh -b

And once the build has been progressed to building rocminfo and amd-smi, those command would be good way to start checking the build.


source /opt/rocm/bin/env_rocm.sh
rocminfo
amd-smi metrics

Hip and opencl -compiler tests should be also doable pretty soon (no need to wait whole build to finish)

source /opt/rocm/bin/env_rocm.sh
cd /opt/rocm_sdk_612/docs/examples/hipcc/hello_world
./build.sh
cd /opt/rocm_sdk_612/docs/examples/opencl/hello_world
./build.sh

Once the build has finished, if things works well, then also pytorch should have the support for you gpu.
Some basic benchmarks are done by

cd benchmarks
./run_and_save_benchmarks.sh

If these works, then you can also build the llama_cpp, stable-diffusion-webui and vllm with command:

./babs.sh -b binfo/extra/ai_tools.blist

All of those have also own example apps you can run either on console or by starting their web-server and then connecting to it via browser. (I can help more later if needed)

@commandline-be
Copy link
Author

Thanks :-) I'll try that asap

@Said-Akbar
Copy link

Hello @lamikr ,

Thank you for your amazing work! I am really glad I found this repo.

I have two AMD MI60 cards (gfx906). I will also compile this repo and share test results with you!

I am specifically interested in VLLM batch/concurrent inference speeds. So far, I was not able to compile VLLM with default installations of ROCM 6.2.2 and VLLM.
Another issue I faced was lack of flash attention support. I see this repo has aotriton with support for gfx906. I hope aotriton implementation of flash attention works with this repo. Reference: ROCm/aotriton#39

There is also composable_kernel based flash attention implementation here - https://github.com/ROCm/flash-attention (v2.6.3). This FA compiles fine with default ROCM 6.2.2 in Ubuntu 22.04 but exllamav2 backend with llama3 8B started generating gibberish text (exllamav2 works fine without FA2; but exllamav2 is very slow without FA2). I hope this repo fixes this gibberish text generation problem with FA2.

Thanks again!

@Said-Akbar
Copy link

Quick update. I did a fresh installation of Ubuntu 24.04.1 today which takes around 6.5GB SSD storage. It installs Nvidia GPU drivers by default. I assumed this repo would install AMD GPU drivers but no, it did not. Probably, this should be mentioning in README with a brief description of how to install GPU drivers. So, I installed AMD GPU drivers as follows:

sudo apt update
sudo apt install "linux-headers-$(uname -r)" "linux-modules-extra-$(uname -r)"
sudo usermod -a -G render,video $LOGNAME # Add the current user to the render and video groups
wget https://repo.radeon.com/amdgpu-install/6.2.4/ubuntu/noble/amdgpu-install_6.2.60204-1_all.deb
sudo apt install ./amdgpu-install_6.2.60204-1_all.deb
sudo apt update

Also, there were several packages missing in Ubuntu which I had to install after I saw error messages in ./install_deps.sh.

sudo apt install rpm
sudo apt install python3-pip
sudo apt install git-lfs

Only after that, I was able to run ./install_deps.sh without errors.
I selected gfx906 for ./babs.sh -c and now I'm waiting for ./babs.sh -b to finish. So, far it has been running for 1.5 hours on my AMD 5950x CPU with 96GB DDR4 3200Mhz.
Currently, the script is installing flang_libpgmath.

Another feedback. Can you please include a global progress bar that says how many packages were built and the total number of packages remaining in terminal logs?

@Said-Akbar
Copy link

Said-Akbar commented Nov 20, 2024

ok, I want to report an error that occurred while building the source code.
I ran ./babs.sh -b and after 1.5 hours, this is the error message I see:

-- LIBOMPTARGET: Not building hostexec for NVPTX because cuda not found
   -- Building hostexec with LLVM 17.0.0git found with CLANG_TOOL /opt/rocm_sdk_612/bin/clang
-- LIBOMPTARGET: Building the llvm-omp-device-info tool
-- LIBOMPTARGET: Building the llvm-omp-kernel-replay tool
-- LIBOMPTARGET: Building DeviceRTL. Using clang: /opt/rocm_sdk_612/bin/clang, llvm-link: /opt/rocm_sdk_612/bin/llvm-link and opt: /opt/rocm_sdk_612/bin/opt
-- LIBOMPTARGET: DeviceRTLs gfx906: Getting ROCm device libs from /opt/rocm_sdk_612/lib64/cmake/AMDDeviceLibs
 ===================> bc_files: Configuration.cpp-400-gfx906.bc;Debug.cpp-400-gfx906.bc;Kernel.cpp-400-gfx906.bc;LibC.cpp-400-gfx906.bc;Mapping.cpp-400-gfx906.bc;Misc.cpp-400-gfx906.bc;Parallelism.cpp-400-gfx906.bc;Reduction.cpp-400-gfx906.bc;State.cpp-400-gfx906.bc;Synchronization.cpp-400-gfx906.bc;Tasking.cpp-400-gfx906.bc;Utils.cpp-400-gfx906.bc;Workshare.cpp-400-gfx906.bc;ExtraMapping.cpp-400-gfx906.bc;Xteamr.cpp-400-gfx906.bc;Memory.cpp-400-gfx906.bc;Xteams.cpp-400-gfx906.bc;/home/saidp/Downloads/rocm_sdk_builder/builddir/016_03_llvm_project_openmp/libm-400-gfx906.bc;/home/saidp/Downloads/rocm_sdk_builder/builddir/016_03_llvm_project_openmp/libomptarget/hostexec/libhostexec-400-gfx906.bc;/opt/rocm_sdk_612/amdgcn/bitcode/ocml.bc;/opt/rocm_sdk_612/amdgcn/bitcode/ockl.bc;/opt/rocm_sdk_612/amdgcn/bitcode/oclc_wavefrontsize64_on.bc;/opt/rocm_sdk_612/amdgcn/bitcode/oclc_isa_version_906.bc;/opt/rocm_sdk_612/amdgcn/bitcode/oclc_abi_version_400.bc ========================
-- LIBOMPTARGET: DeviceRTLs gfx906: Getting ROCm device libs from /opt/rocm_sdk_612/lib64/cmake/AMDDeviceLibs
 ===================> bc_files: Configuration.cpp-500-gfx906.bc;Debug.cpp-500-gfx906.bc;Kernel.cpp-500-gfx906.bc;LibC.cpp-500-gfx906.bc;Mapping.cpp-500-gfx906.bc;Misc.cpp-500-gfx906.bc;Parallelism.cpp-500-gfx906.bc;Reduction.cpp-500-gfx906.bc;State.cpp-500-gfx906.bc;Synchronization.cpp-500-gfx906.bc;Tasking.cpp-500-gfx906.bc;Utils.cpp-500-gfx906.bc;Workshare.cpp-500-gfx906.bc;ExtraMapping.cpp-500-gfx906.bc;Xteamr.cpp-500-gfx906.bc;Memory.cpp-500-gfx906.bc;Xteams.cpp-500-gfx906.bc;/home/saidp/Downloads/rocm_sdk_builder/builddir/016_03_llvm_project_openmp/libm-500-gfx906.bc;/home/saidp/Downloads/rocm_sdk_builder/builddir/016_03_llvm_project_openmp/libomptarget/hostexec/libhostexec-500-gfx906.bc;/opt/rocm_sdk_612/amdgcn/bitcode/ocml.bc;/opt/rocm_sdk_612/amdgcn/bitcode/ockl.bc;/opt/rocm_sdk_612/amdgcn/bitcode/oclc_wavefrontsize64_on.bc;/opt/rocm_sdk_612/amdgcn/bitcode/oclc_isa_version_906.bc;/opt/rocm_sdk_612/amdgcn/bitcode/oclc_abi_version_500.bc ========================


CMake Error at cmake/OpenMPTesting.cmake:209 (add_custom_target):
  add_custom_target cannot create target
  "check-libomptarget-nvptx64-nvidia-cuda" because another target with the
  same name already exists.  The existing target is a custom target created
  in source directory
  "/home/saidp/Downloads/rocm_sdk_builder/src_projects/llvm-project/openmp/libomptarget/test".
  See documentation for policy CMP0002 for more details.
Call Stack (most recent call first):
  libomptarget/test/CMakeLists.txt:23 (add_openmp_testsuite)


CMake Error at cmake/OpenMPTesting.cmake:209 (add_custom_target):
  add_custom_target cannot create target
  "check-libomptarget-nvptx64-nvidia-cuda-LTO" because another target with
  the same name already exists.  The existing target is a custom target
  created in source directory
  "/home/saidp/Downloads/rocm_sdk_builder/src_projects/llvm-project/openmp/libomptarget/test".
  See documentation for policy CMP0002 for more details.
Call Stack (most recent call first):
  libomptarget/test/CMakeLists.txt:23 (add_openmp_testsuite)

Attaching the full error output ./babs.sh -b >>error_output.txt 2>&1 after running it the second time for reference:
error_output.txt

Short info about my PC:
OS: Ubuntu 24.04.1
CPU: AMD 5950x
RAM: 96GB DDR4 3200Mhz
Storage: SSD 1TB + HDD
GPUs: RTX 3090 (for Video output), 2xAMD MI60 (gfx906).


I ran the following commands and they worked.

source /opt/rocm_sdk_612/bin/env_rocm.sh
rocminfo
amd-smi metric
cd /opt/rocm_sdk_612/docs/examples/hipcc/hello_world
./build.sh
cd /opt/rocm_sdk_612/docs/examples/opencl/hello_world
./build.sh

rocminfo correctly showed those two MI60 cards. hipcc and opencl examples worked without errors.
Only ./run_and_save_benchmarks.sh did not work due to missing torch library.


Please, let me know if I need to install Cuda libraries or else, how I fix the error above.

Thanks!

@Said-Akbar
Copy link

@lamikr , I think the error I am seeing might be related to spack/spack#45411 but not sure how I implement the fix here. Let me know. thanks!

@Said-Akbar
Copy link

Said-Akbar commented Nov 21, 2024

Quick update. Installation is working after I remove all nvidia drivers and restart my PC.

sudo apt-get purge nvidia*
sudo apt-get autoremove
sudo apt-get autoclean

Now, Ubuntu is using X.Org Server Nouveau drivers.

@Said-Akbar
Copy link

Finally, ROCM SDK was installed on my PC after 5 hours. It takes ~90GB of space in rocm_sdk_builder, 8.5GB in the triton folder, ~2GB in the lib/x86_64-linux-gnu folder (mostly LLVM) and ~20GB in opt/rocm_sdk_612 folder. Total of 120GB of files! Is there a way to create an installable version of my current setup (all 120GB)? It is huge and time-consuming. For comparison, rocm installation from binaries takes around 30GB.

@Said-Akbar
Copy link

here are the benchmark results. I think the flash attention test failed.

./run_and_save_benchmarks.sh
Timestamp for benchmark results: 20241121_190404
Saving to file: 20241121_190404_cpu_vs_gpu_simple.txt
Benchmarking CPU and GPUs
Pytorch version: 2.4.1
ROCM HIP version: 6.1.40093-61a06a2f8
       Device:  AMD Ryzen 9 5950X 16-Core Processor
    'CPU time: 26.503 sec
       Device: AMD Radeon Graphics
    'GPU time: 0.399 sec
       Device: AMD Radeon Graphics
    'GPU time: 0.353 sec
Benchmark ready

Saving to file: 20241121_190404_pytorch_dot_products.txt
Pytorch version: 2.4.1
dot product calculation test
tensor([[[ 0.2042, -0.5683,  0.5711,  1.5666, -0.8859, -0.4255, -0.6103,
          -0.5932],
         [-0.1816, -1.0552,  0.3676,  2.1399, -0.8622,  0.1185, -0.4614,
          -0.4577],
         [ 0.2491, -0.5238,  0.5873,  1.5027, -0.8808, -0.4906, -0.6309,
          -0.6083]],

        [[-0.0812,  0.5027, -0.0134, -0.1771, -1.6389,  0.0154, -1.1964,
          -0.3948],
         [-0.3459, -0.4265,  0.0969,  0.0608, -0.9923, -0.4199, -0.7190,
          -0.0208],
         [-0.2615, -0.6958,  0.1066, -0.1948, -1.2152, -0.1223, -0.6278,
           0.1627]]], device='cuda:0')

Benchmarking cuda and cpu with Default, Math, Flash Attention amd Memory pytorch backends
Device: AMD Radeon Graphics / cuda:0
    Default benchmark:
:0:/home/saidp/Downloads/rocm_sdk_builder/src_projects/clr/hipamd/src/hip_global.cpp:114 : 8471950880 us: [pid:454884 tid:0x7ad2a9db0b80] Cannot find Symbol with name: Cijk_Alik_Bljk_HHS_BH_MT128x64x16_SE_APM1_AF0EM2_AF1EM1_AMAS3_ASAE01_ASCE01_ASEM2_BL1_BS1_DTLA0_DTLB0_EPS1_FL1_GLVWA4_GLVWB4_GRVW4_GSU1_GSUASB_ISA906_IU1_K1_KLA_LPA0_LPB0_LDL1_LRVW4_MDA1_MMFGLC_NLCA1_NLCB1_ONLL1_PK0_PGR1_PLR1_SIA1_SU32_SUM0_SUS256_SVW4_SNLL0_TT8_4_USFGROn1_VAW2_VSn1_VW4_VWB4_WG16_16_1_WGM1

@Said-Akbar
Copy link

that error above is causing llama.cpp not to run any models on GPU. Let me file a bug.

@commandline-be
Copy link
Author

@lamikr finally got round to do the testing

initially the build went smooth-ish
then i noticed something failed

after doing a ./bass.sh --clean and starting ./babs.sh -b again i now get an error on '

HIP_COMPILER=clang
HIP_RUNTIME=rocclr
ROCM_PATH=/opt/rocm_sdk_612
HIP_ROCCLR_HOME=/opt/rocm_sdk_612
HIP_CLANG_PATH=/opt/rocm_sdk_612/bin
HIP_INCLUDE_PATH=/opt/rocm_sdk_612/include
HIP_LIB_PATH=/opt/rocm_sdk_612/lib
DEVICE_LIB_PATH=/opt/rocm_sdk_612/amdgcn/bitcode
HIP_CLANG_RT_LIB=/opt/rocm_sdk_612/lib/clang/17/lib/linux
hipcc-args: -DENABLE_BACKTRACE -DHAVE_BACKTRACE_H -I/usr/src/rocm_sdk_builder/src_projects/roctracer/src/util -O3 -DNDEBUG -fPIC -Wall -Werror -std=gnu++17 -MD -MT src/CMakeFiles/util.dir/util/debug.cpp.o -MF CMakeFiles/util.dir/util/debug.cpp.o.d -o CMakeFiles/util.dir/util/debug.cpp.o -c /usr/src/rocm_sdk_builder/src_projects/roctracer/src/util/debug.cpp
hipcc-cmd: "/opt/rocm_sdk_612/bin/clang" -isystem "/opt/rocm_sdk_612/include" --offload-arch=gfx906 -mllvm -amdgpu-early-inline-all=true -mllvm -amdgpu-function-calls=false --hip-path="/opt/rocm_sdk_612" --hip-device-lib-path="/opt/rocm_sdk_612/amdgcn/bitcode" -DENABLE_BACKTRACE -DHAVE_BACKTRACE_H -I/usr/src/rocm_sdk_builder/src_projects/roctracer/src/util -O3 -DNDEBUG -fPIC -Wall -Werror -std=gnu++17 -MD -MT src/CMakeFiles/util.dir/util/debug.cpp.o -MF CMakeFiles/util.dir/util/debug.cpp.o.d -o "CMakeFiles/util.dir/util/debug.cpp.o" -c -x hip /usr/src/rocm_sdk_builder/src_projects/roctracer/src/util/debug.cpp
/usr/src/rocm_sdk_builder/src_projects/roctracer/src/util/debug.cpp:33:10: fatal error: 'backtrace.h' file not found
33 | #include <backtrace.h>
| ^~~~~~~~~~~~~
1 error generated when compiling for gfx906.
make[2]: *** [src/CMakeFiles/util.dir/build.make:76: src/CMakeFiles/util.dir/util/debug.cpp.o] Error 1
make[2]: Leaving directory '/usr/src/rocm_sdk_builder/builddir/011_01_roctracer'
make[1]: *** [CMakeFiles/Makefile2:220: src/CMakeFiles/util.dir/all] Error 2
make[1]: Leaving directory '/usr/src/rocm_sdk_builder/builddir/011_01_roctracer'
make: *** [Makefile:156: all] Error 2
build failed: roctracer

@lamikr
Copy link
Owner

lamikr commented Nov 24, 2024

Hi. thanks for the reports. The flash attention support for gfx906 would need to be implemented in aotriton.
As it's gfc based gpu, I need to check would the triton code there that supports newwer gfx9* cards could get to work also with gfx906.

Althought I do not have the gfx906, I will start a new build for it with ubuntu 24.04 and try to reproduce the build errors. If you have some fixes, are you able to make pull request?

@commandline-be
Copy link
Author

hey @lamikr

The build is on LinuxMint Debian Edition, if need be i can make pull requests
can you help identify the backtrace.h origin ?

@lamikr
Copy link
Owner

lamikr commented Nov 25, 2024

I have multiple versions of it under src_projects directory

$ cd src_projects/
$ find -name backtrace.h

./rocgdb/libbacktrace/backtrace.h
./rocMLIR/external/llvm-project/compiler-rt/lib/gwp_asan/optional/backtrace.h
./binutils-gdb/libbacktrace/backtrace.h
./openmpi/opal/mca/backtrace/backtrace.h
./llvm-project/compiler-rt/lib/gwp_asan/optional/backtrace.h
./pytorch/third_party/tensorpipe/third_party/libnop/include/nop/utility/backtrace.h

I am not sure what is causing it. Maybe the install directory /opt/rocm_sdk_612 should also be removed and then start a clean build. Lets try to reset everything and then start a fresh build.
(Normally this should not be needed and only command would be ./babs.sh -up and ./babs.sh -b to get only the changed projects rebuild)

./babs.sh -ca
./babs.sh -up
./babs.sh --clean
rm -rf /opt/rocm_sdk_612
./babs.sh -b

I have not solved yet the llama.cpp error with gfx906 but trying to add more debug to next build related to that.
Lets track that issue on #180

@cb88
Copy link

cb88 commented Dec 12, 2024

I can get as far as running the HIP and CL hello worlds, but cannot run the run and save benchmarks script.

-- MIGraphX is using hipRTC
-- MIGraphx is using Find-2.0 API of MIOpen
-- MIGraphx is using Find Mode API of MIOpen
-- MIGraphx is using Beta API of rocBLAS
-- MIGraphX is using Beta API of rocBLAS for FP8 computations
-- Enable test package migraphx
-- rocm-cmake: Set license file to /home/cb88/rocm_sdk_builder/src_projects/AMDMIGraphX/LICENSE.
-- Generate ctest file
-- Configuring done (1.4s)
CMake Error in src/py/CMakeLists.txt:
Imported target "pybind11::module" includes non-existent path

"/include"

in its INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:

  • The path was deleted, renamed, or moved to another location.

  • An install or uninstall procedure did not complete successfully.

  • The installation package was faulty and references files it does not
    provide.

CMake Error in src/py/CMakeLists.txt:
Imported target "pybind11::pybind11" includes non-existent path

"/include"

in its INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:

  • The path was deleted, renamed, or moved to another location.

  • An install or uninstall procedure did not complete successfully.

  • The installation package was faulty and references files it does not
    provide.

CMake Warning (dev) at /opt/rocm_sdk_612/share/rocmcmakebuildtools/cmake/ROCMTest.cmake:230 (install):
Policy CMP0095 is not set: RPATH entries are properly escaped in the
intermediary CMake install script. Run "cmake --help-policy CMP0095" for
policy details. Use the cmake_policy command to set the policy and
suppress this warning.

RPATH entries for target 'test_verify' will not be escaped in the
intermediary cmake_install.cmake script.
Call Stack (most recent call first):
test/verify/CMakeLists.txt:29 (rocm_install_test)
This warning is for project developers. Use -Wno-dev to suppress it.

-- Generating done (2.5s)
CMake Generate step failed. Build files cannot be regenerated correctly.
configure failed: AMDMIGraphX

@lamikr
Copy link
Owner

lamikr commented Jan 10, 2025

I have now done couple of docker images from the quite new rocm_sdk_builder for different gpu-architectures.
I was not able to build a support for all possible GPU's to single docker/podman image because the size of some libraries grow so big that the linking started to fail first on composable kernel and then on pytorch.
So at the moment I have 3 different images build:

  • 1 for cdna GPUs
  • 1 for rdna 1 and rdna 2 GPUs
  • 1 for rdna 3 and 3.5 gpus

Docker image for cdna-cards supports gfx906 and works at least with MI50, so I believe it could also work with Vega VII. The problem is that even with xz-compressed the size of these images is 6GB. (and as uncompessed it is about 50gb) These images have every application included from rocm sdk builder.

Do you know is it possible to upload xz compressed docker images to docker hub?

@lamikr
Copy link
Owner

lamikr commented Jan 10, 2025

@Said-Akbar, @cb88 and @commandline-be
I just tested the cdna docker image and it works for me with MI50.

Here are the commands I used to import and run it: (tmpdir was needed because image is so big that to import would fail if reqular /tmp memory dir is used)

  1. image import
$ sudo su
$ mkdir -p /opt/containers/tmp
$ export TMPDIR=/opt/containers/tmp
$ podman import --change CMD=/bin/bash --change ENTRYPOINT=/bin/bash rocm_sdk_builder_612_cdna_docker.tar rocm_sdk_612_cdna

  1. run the imported docker image by giving also permissions to gpu

podman run -it --device=/dev/kfd --device=/dev/dri --group-add keep-groups localhost/rocm_sdk_612_cdna bash

  1. Test it (no need to run source /opt/rocm_sdk_612/bin/rocm_env.sh as I have added that to .bashrc in image)

[root@localhost podman]# podman run -it --device=/dev/kfd --device=/dev/dri --group-add keep-groups localhost/rocm_sdk_612_cdna bash
root@1cbe841f5f4d:/# cd /opt/rocm_sdk_612/docs/examples/hipcc/hello_world/
root@1cbe841f5f4d:/opt/rocm_sdk_612/docs/examples/hipcc/hello_world# ./build.sh 
rm -f ./hello_world
rm -f hello_world.o
rm -f /opt/rocm_sdk_612/src/*.o
/opt/rocm_sdk_612/bin/hipcc -g -fPIE   -c -o hello_world.o hello_world.cpp
/opt/rocm_sdk_612/bin/hipcc hello_world.o -fPIE -o hello_world
./hello_world
 System minor: 0
 System major: 9
 Agent name: AMD Instinct MI60 / MI50
Kernel input: GdkknVnqkc
Expecting that kernel increases each character from input string by one
Kernel output string: HelloWorld
Output string matched with HelloWorld
Test ok!

Now I would need some location where to upload it.

@Said-Akbar
Copy link

Hello @lamikr ,

I checked docker hub and they have a limit of 2GB. Since it is not enough for this container, I can suggest that you create a compressed file and upload it to a google drive. Each new gmail account will have 15GB of free storage. Then you can make the folder public and share with us. Thanks!

@lamikr
Copy link
Owner

lamikr commented Jan 12, 2025

Hi @Said-Akbar, I did what you suggested :-)
Image for CDNA GPU's is now in

https://drive.google.com/drive/folders/1XnoSvL41XhrKT_5NbBSrUZ_1LaVpQ-xb

Let me know how it work. I put there also a file with some instructions as at least I needed to change the TMPDIR location during import time to avoid running out of memory.

@Said-Akbar
Copy link

Thank you! I will try it tomorrow.

@Rongronggg9
Copy link

I checked docker hub and they have a limit of 2GB.

GitHub offers a free docker registry for public repos. The size limit is 10GiB per layer.
https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry#troubleshooting

@lamikr
Copy link
Owner

lamikr commented Jan 13, 2025

Do you have experience for doing docker builds on github and what does the layer mean here? I would think that the end-image size is at least 10-50 gb uncompressed and as compressed it would be about 2-6 gb.

At the moment I am doing the build by using files in folder

docs/notes/containers/docker_build folder

I have splitted there the Dockerfile to multiple parts because I had some kind of image merge error in the end, when I just tried to build too many projects in one step.

At the moment I will first put everything in comment on Dockerfile after line
RUN cd rocm_sdk_builder && ./babs.sh -b docs/notes/containers/blist/binfo_core_p1.blist
There the binfo_core_p1.blist file has list of apps that are wanted to be build on first phase:

`

  • binfo/core/001_rocm_core.binfo
  • binfo/core/002_01_cmake_backport.binfo
  • binfo/core/002_02_zstd_backport.binfo
    ...
  • binfo/core/010_02_rocthrust.binfo
    `

and then I will call for example a script:

./build_rocm_sdk_container_rdna3.sh

Once that step finishes and image is saved, I uncomment the line asking to build the second set:
RUN cd rocm_sdk_builder && ./babs.sh -b docs/notes/containers/blist/binfo_core_p2.blist

and then launch the ./build_rocm_sdk_container_rdna3.sh script again.
In this way if there is some build problem on p2.blist, I just need to fix that and then restart from phase p2 instead of restating the whole build from the beginning.

Maybe there is some better/smarter way of doing the commits between RUN commands that I am missing. Something similar than calling "podman tag " directly from the Dockerfile between RUN commands.

Or alternatively there could maybe be a script that adds those "RUN commands" dynamically to Dockerfile after each succesful build phase. That would be nice to try on github.

@Rongronggg9
Copy link

what does the layer mean here?

Most (if not all) Dockerfile instructions result in a new layer to be created. You may examine layers of existing images using docker image history.

I would think that the end-image size is at least 10-50 gb uncompressed and as compressed it would be about 2-6 gb.

I guess the size limit is applied to the compressed size of each layer, but I am not very sure.

I had some kind of image merge error in the end, when I just tried to build too many projects in one step.

That's a bad practice even if it succeeds in merging since a massive image layer is very hard to upload/download. Splitting build steps into multiple RUN does the right thing.

Maybe there is some better/smarter way of doing the commits between RUN commands that I am missing.

Use the layer id (hash) in docker image history. For example, if you'd like to start from layer 1234567890ab, create a temporary Dockerfile like:

FROM 1234567890ab
# ... remaining steps ...

and build it.

Or alternatively there could maybe be a script that adds those "RUN commands" dynamically to Dockerfile after each succesful build phase.

docker container commit is here to help.

For example:

  1. Create a base Dockerfile and build it. docker build -t rsb_image_base .
FROM ubuntu:24.04

# ... omitted ...

WORKDIR /
RUN apt update && apt install -y git git-lfs sudo vim
RUN git clone --recursive https://github.com/lamikr/rocm_sdk_builder.git
WORKDIR /rocm_sdk_builder
RUN git checkout master
RUN ./docs/notes/containers/scripts/preconfig_ubuntu.sh
RUN ./docs/notes/containers/scripts/select_target_gpus.sh ${ENV_VAR__TARGET_GPU_CFG_FILE_ALL}
  1. docker run --name rsb_container_step1 rsb_image_base ./docs/notes/containers/scripts/download_binfo_src.sh
  2. docker container commit rsb_container_step1 rsb_image_step1
  3. docker run --name rsb_container_step2 rsb_image_step1 ./babs.sh -b docs/notes/containers/blist/binfo_core_p1.blist
  4. docker container commit rsb_container_step2 rsb_image_step2
  5. ......

I noticed that your Dockerfile does some cleanup jobs in the final layers. It is useless as all deleted files will remain in the previous layers (each layer, once created, is immutable).

@lamikr
Copy link
Owner

lamikr commented Jan 13, 2025

Thanks for the suggestions... So basically you suggested that the Dockerfile itself has only a commands for creating the very base image and then all other "docker run" commands following are called from the shell script instead of adding them to Dockerfile itself.

I did not realize that it can be done that way. I had thought that I need to modify the Dockerfile itself dynamically from the script between each build step by using "echo "MY command" >> Dockerfile". Error-check needs to be anyway added between each step so that the script will stop, if some of the steps failed.

Reason for the cleanup task in the end is that in that way the exported image created with "podman export" will be smaller. That one will contain only the files that are in the image on final step. The image that is now shared in gmail fileshare is done in that way. In that way I was able to reduce the size of the exported image for tens of gigs.

User of the docker image can get these files anyway back if he want by using babs.sh commands. It even allows updating and rebuilding it partially with commands like:

cd /rocm_sdk_builder
./babs.sh -up
./babs.sh -b

@Rongronggg9
Copy link

Rongronggg9 commented Jan 14, 2025

The export sub-command merges all layers together, resulting in any files that are not in the last layer being vanished. It's fine when you share the image as a tarball. However, that's not the case when pushing an image to a registry (Docker hub, GitHub Packages, etc) - all layers are pushed so deleting files in the last layers doesn't help.
If you do want to push a squashed image to a registry, building a multi-stage image is the preferable way, e.g.,

FROM ubuntu:24.04 AS builder

# ... all build steps ... 

FROM scratch
COPY --from=builder / /
# Now you get a single-layer image

That being said, the best practice to build a Docker image usually follows these practices:

  1. Do not clone your repo inside the container, instead, COPY it from a local clone, especially when the Dockerfile is designed for CI/CD. Doing so ensures build cache is able to work properly.
  2. Besides, only COPY those files that are strictly needed in the next RUN step. Using this strategy, you don't need the dirty "build-uncomment-build" cycle. Any modification to the copied files results in the following steps to be rebuilt. This is exactly why layers exist in the first place - making build cache work efficiently. Again this practice is very useful in CI/CD in order that a build task does not require rebuilding every step for just tiny changes.

If you'd like to setup GitHub Actions to build Docker images, there is a limit that "each job in a workflow can run for up to 6 hours of execution time".

https://docs.github.com/en/actions/administering-github-actions/usage-limits-billing-and-administration

To work around the limit, splitting the Dockerfile is needed anyway in order that a build workflow can be split into multiple jobs - several jobs build some groups of dependencies, and they are finally aggregated in jobs that build the last monsters (pytorch, etc). This strategy has some other advantages, e.g. if two or more components do not depend on each other, they can be built in different jobs (thus on different GHA runners) simultaneously, cutting the total build time down greatly.

The current build process of the project follows a linear dependency chain (components are built one by one). Could you make a (rough) dependency graph among all components built by this project? Using such information, building some components simultaneously would be possible and I am willing to help to write proper Dockerfile and GHA workflows.

@commandline-be
Copy link
Author

Thanks for this guide. Sadly I've not managed to push beyond the 'build failed: roctracer' situation.

This fails on 'hipGetDevicePropertiesR0600' with an undefined reference in MatrixTranspose_test.cpp:(.text+0x322)

This fails on 'hipGetDevicePropertiesR0600' with an undefined reference in MatrixTranspose_test.cpp:(.text+0x360)

I'm building this on Debian which is not throwing any compatibility issue afaik but does fail to build.

It seems also the build script is not aligned with the actual code tree.

in that i do not find env_rocm.sh in /opt/rocm/bin for example but i do find it under ./binfo/env

etc.

Please assist

Hi, that would be really interesting!

Most of the rocm components seems to had by default the support for in code for the Radeon VII/gfx906 in place by default and couple of weeks ago I went through all the common places typically requiring patching. I have tested that everything should now build for these cards but not been able to test functionality with VII.

That said, if you have time it would be great if you could try to make the build and test it. These steps should help you to get started.

git clone [email protected]:lamikr/rocm_sdk_builder.git 
cd rocm_sdk_builder
./install_deps.sh
./babs.sh -c (choose gfx906)
./babs.sh -b

And once the build has been progressed to building rocminfo and amd-smi, those command would be good way to start checking the build.


source /opt/rocm/bin/env_rocm.sh
rocminfo
amd-smi metrics

Hip and opencl -compiler tests should be also doable pretty soon (no need to wait whole build to finish)

source /opt/rocm/bin/env_rocm.sh
cd /opt/rocm_sdk_612/docs/examples/hipcc/hello_world
./build.sh
cd /opt/rocm_sdk_612/docs/examples/opencl/hello_world
./build.sh

Once the build has finished, if things works well, then also pytorch should have the support for you gpu. Some basic benchmarks are done by

cd benchmarks
./run_and_save_benchmarks.sh

If these works, then you can also build the llama_cpp, stable-diffusion-webui and vllm with command:

./babs.sh -b binfo/extra/ai_tools.blist

All of those have also own example apps you can run either on console or by starting their web-server and then connecting to it via browser. (I can help more later if needed)

@commandline-be
Copy link
Author

commandline-be commented Jan 15, 2025

After running

babs -rs
source /opt/rocm_sdk_612/bin/env_rocm.sh
babs -b

The result was the same, the file env_rocm.sh was not found in /opt/rocm/bin before or after

@lamikr
Copy link
Owner

lamikr commented Jan 15, 2025

@commandline-be It should be by default in

/opt/rocm_sdk_612/bin/env_rocm.sh

(not in /opt/rocm/bin/env_rocm.sh, as /opt/rocm folder is usually used by the AMD's own rocm builds)

Can you check whether you have /opt/rocm_sdk_612/bin/env_rocm.sh?

If yes, then you should also find some example apps to test on. For example:

cd /opt/rocm_sdk_612/docs/examples/hipcc/store_single_value
./build.sh

If not, let's try to do with smaller steps to find out what is the problem. The env-variable script should be installed alredy by the first package, so we can try to build only that one.

./babs.sh -up
./babs.sh --clean
sudo rm -rf /opt/rocm_sdk_612
./babs.sh -b binfo/core/001_rocm_core.binfo

After these commands you should have that script installed and only a couple of other files.
If could be useful, if you can paste the the output of "./babs.sh -b binfo/core/001_rocm_core.binfo" command.

@lamikr
Copy link
Owner

lamikr commented Jan 16, 2025

@Rongronggg9 Thanks for the feedback. I will try to do the Dockerfile and github-actions for github build now...

I was thinking something like this for the base-image that would be run on first command. It should stay under time and space limit for single layer.

FROM ubuntu:24.04

ARG ENV_VAR__TARGET_GPU_CFG_FILE_ALL=docs/notes/containers/config/build_cfg_all.user
ARG ENV_VAR__TARGET_GPU_CFG_FILE_SELECTED=docs/notes/containers/config/build_cfg_cdna.user

ARG ENV_VAR__TARGET_GPU_CFG_FILE_RDNA12=docs/notes/containers/config/build_cfg_rdna1_rdna2.user
ARG ENV_VAR__TARGET_GPU_CFG_FILE_RDNA3=docs/notes/containers/config/build_cfg_rdna3.user
ARG ENV_VAR__TARGET_GPU_CFG_FILE_CDNA=docs/notes/containers/config/build_cfg_cdna.user
ARG ENV_VAR__TARGET_GPU_CFG_FILE=docs/notes/containers/config/build_cfg_cdna.user
ARG ENV_VAR__TARGET_GPU_CFG_FILE_SELECTED=docs/notes/containers/config/build_cfg_cdna.user

WORKDIR /
RUN apt update && apt install -y git git-lfs sudo vim
RUN git clone --recursive https://github.com/lamikr/rocm_sdk_builder.git
RUN cd rocm_sdk_builder && git checkout master

# example how to apply updates to image during the build time
# RUN cd /rocm_sdk_builder && git reset --hard HEAD~1 && ./babs.sh -up
RUN cd rocm_sdk_builder && ./docs/notes/containers/scripts/preconfig_ubuntu.sh
RUN cd rocm_sdk_builder && ./docs/notes/containers/scripts/select_target_gpus.sh ${ENV_VAR__TARGET_GPU_CFG_FILE_ALL}
RUN cd rocm_sdk_builder && ./babs.sh -b binfo/core/001_rocm_core.binfo
RUN cd rocm_sdk_builder && ./babs.sh -b binfo/core/002_01_cmake_backport.binfo
RUN cd rocm_sdk_builder && ./babs.sh -b binfo/core/002_02_zstd_backport.binfo
RUN cd rocm_sdk_builder && ./babs.sh -b binfo/core/002_03_python_backport.binfo
RUN cd rocm_sdk_builder && ./babs.sh -b binfo/core/002_04_ffmpeg7_devel.binfo

And then for github-actions, I could first try with something like this to build the base image first with Dockerfile and then run single action to build llvm with a separate command after that to create a second layer.

name: rocm_sdk_builder_docker_image
on:
  workflow_dispatch:
    inputs:
      build:
        description: 'Build the docker image'
        required: true
        default: 'true'

jobs:
  build:
    runs-on: ubuntu-24.04
    steps:
    - name: checkout
      uses: actions/checkout@v4
    - name: build_rocm_sdk_builder_src_image
      run: docker build docs/notes/containers/github/docker_build -t rsb_image_base:latest

@lamikr
Copy link
Owner

lamikr commented Jan 16, 2025

It took couple of iterations, but action and dockerfile in previous commit seems to now work to run the dockerfile.
Now I need to figure out how to add these individual docker build commands to be able to run these ./babs.sh -b commands on layers after that. I tried to add this


    - name: rsb_image_base_step_03
      run: docker run --name rsb_image_base_step_03 rsb_image_base cd /rocm_sdk_builder && ./babs.sh -b binfo/core/003_llvm_project_llvm.binfo

But I am getting error:


Run docker run --name rsb_image_core_03 rsb_image_base cd /rocm_sdk_builder && ./babs.sh -b binfo/core/003_llvm_project_llvm.binfo
docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: exec: "cd": executable file not found in $PATH: unknown.
Error: Process completed with exit code 127.

@lamikr
Copy link
Owner

lamikr commented Jan 16, 2025

Needed to add -bash -c... So this seems to work and llvm is now building.

`
name: rocm_sdk_builder_docker_image
on:
workflow_dispatch:
inputs:
build:
description: 'Build the docker image'
required: true
default: 'true'

jobs:
build:
runs-on: ubuntu-24.04
steps:
- name: checkout
uses: actions/checkout@v4
- name: build_rocm_sdk_builder_src_image
run: docker build docs/notes/containers/github/docker_build -t rsb_image_base:latest
- name: rsb_image_core_03
run: docker run --name rsb_image_core_03 rsb_image_base bash -c "cd /rocm_sdk_builder && ./babs.sh -b binfo/core/003_llvm_project_llvm.binfo"

Could I somehow now continue from the image created by this action by creating another action? Or do I just need to add all run: docker run commands to this one?
`

@Rongronggg9
Copy link

Rongronggg9 commented Jan 17, 2025

Could I somehow now continue from the image created by this action by creating another action?

Refer to https://github.com/Rongronggg9/wps-office-repack/blob/main/.github/workflows/repack.yml for a live example of a multi-job workflow. Using needs, you can define the dependency chain among all jobs. Each job can only run if all its dependencies are finished and successful. Multiple jobs, as long as their dependencies are met, can run simultaneously. For example, needs: [ fetch ] ensures that the jobs in the "repack" matrix depend on the "fetch" job, and all jobs in the "repack" matrix can be picked by different GHA runners and run simultaneously.

You need to upload the Docker image built in each job somehow and download it in the next job. In my example, the "fetch" job is the prerequisite of the jobs in the "repack" matrix. The bridge connecting the these jobs is the "cache" step - each public GitHub repo has a 10GiB GHA cache storage. The "cache" step in the "fetch" uploads files to the GHA cache storage, and then the "cache" step in each job in the "repack" matrix downloads the uploaded files.

That being said, this methodology may not be the best one for your GHA workflow. Docker has a feature called inline cache, which embeds build cache into the pushed image with almost no impact on the image size. Thus, you can just push the intermediate image to GitHub packages in each job and pull it in the next jobs.

Or do I just need to add all run: docker run commands to this one?

Doing this only addes steps to the same job.

@commandline-be
Copy link
Author

commandline-be commented Jan 20, 2025

@lamikr tried all that not few times already, now i tried the approach you suggested, same issue

To my understanding the fail originates from line 156 in MatrixTranspose.c

Image

which throws an error on clang:

commenting out line 156 does not fix anything on retrying ./babs.sh -b

@commandline-be
Copy link
Author

Hi. thanks for the reports. The flash attention support for gfx906 would need to be implemented in aotriton. As it's gfc based gpu, I need to check would the triton code there that supports newwer gfx9* cards could get to work also with gfx906.

Althought I do not have the gfx906, I will start a new build for it with ubuntu 24.04 and try to reproduce the build errors. If you have some fixes, are you able to make pull request?

Yes, what do you want to be done with the pull requests ?

@lamikr
Copy link
Owner

lamikr commented Jan 22, 2025

@commandline-be Sorry I have forgot to mention that I was able to reproduce the build error on roctracer with backtrace.h on ubuntu in some situations. It has been fixed since January 12.
If you have time, can you try to do a fresh build one more time by doing commands:

sudo rm -rf /opt/rocm_sdk_612
./babs.sh --up
./babs.sh --reset
./babs.sh -b

That should make sure that everything has been cleaned from previous build and new build is started from crash.

@commandline-be
Copy link
Author

Just in case this matters to someone, when using the gfx906 in a Linux VM it suffers from a known bug. This requires to compile a module for Linux named vendor-reset. It works well for the Radeon VII.

you can find the module here, it builds with dkms also

https://github.com/gnif/vendor-reset/

@lamikr
Copy link
Owner

lamikr commented Jan 22, 2025

@commandline-be Fingers crossed that the build will now work for you with Vega VII. So you are doing the build on Linux VM?

@commandline-be
Copy link
Author

@commandline-be Sorry I have forgot to mention that I was able to reproduce the build error on roctracer with backtrace.h on ubuntu in some situations. It has been fixed since January 12. If you have time, can you try to do a fresh build one more time by doing commands:

sudo rm -rf /opt/rocm_sdk_612
./babs.sh --up
./babs.sh --reset
./babs.sh -b

That should make sure that everything has been cleaned from previous build and new build is started from crash.

building now, pending results

@lamikr
Copy link
Owner

lamikr commented Jan 22, 2025

@Rongronggg9 The discussion related to docker image kind of sidetracked the original Radeon VII issue, so I created a new issue for the docker image building by using the github actions on

#201

I hope you could help me there to fix the current action file which fails on upload phase.

@commandline-be
Copy link
Author

@commandline-be Fingers crossed that the build will now work for you with Vega VII. So you are doing the build on Linux VM?

Yeah, that would be great, so i can make real use of this card eventually. I barely used it but for some AI / ML tasks it seems well suited still.

@commandline-be
Copy link
Author

commandline-be commented Jan 23, 2025

@lamikr sorry to say, some difference but same outcome.

[100%] Built target file_plugin
make[1]: Leaving directory '/home/dv/src/rocm_sdk_builder/builddir/011_01_roctracer'
make: *** [Makefile:156: all] Error 2
build failed: roctracer

---- the commands i used from ./src/rocm_sdk_builders/

sudo rm -rf /opt/rocm_sdk_612
./babs.sh --up
./babs.sh --reset
./babs.sh -b


I'm building on a recent Debian which is somewhat like Ubuntu but not entirely.

==== LARGER CONTEXT

[ 82%] Linking HIP executable MatrixTranspose
cd /home/user/src/rocm_sdk_builder/builddir/011_01_roctracer/test && /usr/bin/cmake -E cmake_link_script CMakeFiles/MatrixTranspose.dir/link.txt --verbose=1
/opt/rocm_sdk_612/bin/hipcc_cmake_linker_helper /opt/rocm_sdk_612/bin -no-pie -Wl,--build-id=md5 CMakeFiles/MatrixTranspose.dir/hip/MatrixTranspose_generated_MatrixTranspose.cpp.o -o MatrixTranspose -Wl,-rpath,/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer:/opt/rocm_sdk_612/lib64: ../libroctracer64.so.4.1.0 ../libroctx64.so.4.1.0 -Wl,-rpath-link,/opt/rocm_sdk_612/lib64
HIP_PATH=/opt/rocm_sdk_612
HIP_PLATFORM=amd
HIP_COMPILER=clang
HIP_RUNTIME=rocclr
ROCM_PATH=/opt/rocm_sdk_612
HIP_ROCCLR_HOME=/opt/rocm_sdk_612
HIP_CLANG_PATH=/opt/rocm_sdk_612/bin
HIP_INCLUDE_PATH=/opt/rocm_sdk_612/include
HIP_LIB_PATH=/opt/rocm_sdk_612/lib
DEVICE_LIB_PATH=/opt/rocm_sdk_612/amdgcn/bitcode
HIP_CLANG_RT_LIB=/opt/rocm_sdk_612/lib/clang/17/lib/linux
hipcc-args: -no-pie -Wl,--build-id=md5 CMakeFiles/MatrixTranspose.dir/hip/MatrixTranspose_generated_MatrixTranspose.cpp.o -o MatrixTranspose -Wl,-rpath,/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer:/opt/rocm_sdk_612/lib64: ../libroctracer64.so.4.1.0 ../libroctx64.so.4.1.0 -Wl,-rpath-link,/opt/rocm_sdk_612/lib64
hipcc-cmd: "/opt/rocm_sdk_612/bin/clang" --driver-mode=g++ -O3 --hip-path="/opt/rocm_sdk_612" --hip-link --rtlib=compiler-rt -unwindlib=libgcc -no-pie -Wl,--build-id=md5 CMakeFiles/MatrixTranspose.dir/hip/MatrixTranspose_generated_MatrixTranspose.cpp.o -o "MatrixTranspose" -Wl,-rpath,/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer:/opt/rocm_sdk_612/lib64: ../libroctracer64.so.4.1.0 ../libroctx64.so.4.1.0 -Wl,-rpath-link,/opt/rocm_sdk_612/lib64
/usr/bin/ld: CMakeFiles/MatrixTranspose.dir/hip/MatrixTranspose_generated_MatrixTranspose.cpp.o: in function main': MatrixTranspose.cpp:(.text+0x15c): undefined reference to hipGetDevicePropertiesR0600'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [test/CMakeFiles/MatrixTranspose.dir/build.make:92: test/MatrixTranspose] Error 1
make[2]: Leaving directory '/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer'
make[1]: *** [CMakeFiles/Makefile2:550: test/CMakeFiles/MatrixTranspose.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

[ 84%] Linking CXX shared library libcodeobj_test.so
cd /home/user/src/rocm_sdk_builder/builddir/011_01_roctracer/test && /usr/bin/cmake -E cmake_link_script CMakeFiles/codeobj_test.dir/link.txt --verbose=1
/opt/rocm_sdk_612/bin/hipcc -fPIC -O3 -DNDEBUG -no-pie -shared -Wl,-soname,libcodeobj_test.so -o libcodeobj_test.so CMakeFiles/codeobj_test.dir/app/codeobj_test.cpp.o -Wl,-rpath,/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer:/opt/rocm_sdk_612/lib64: ../libroctracer64.so.4.1.0 -Wl,-rpath-link,/opt/rocm_sdk_612/lib64
HIP_PATH=/opt/rocm_sdk_612
HIP_PLATFORM=amd
HIP_COMPILER=clang
HIP_RUNTIME=rocclr
ROCM_PATH=/opt/rocm_sdk_612
HIP_ROCCLR_HOME=/opt/rocm_sdk_612
HIP_CLANG_PATH=/opt/rocm_sdk_612/bin
HIP_INCLUDE_PATH=/opt/rocm_sdk_612/include
HIP_LIB_PATH=/opt/rocm_sdk_612/lib
DEVICE_LIB_PATH=/opt/rocm_sdk_612/amdgcn/bitcode
HIP_CLANG_RT_LIB=/opt/rocm_sdk_612/lib/clang/17/lib/linux
hipcc-args: -fPIC -O3 -DNDEBUG -no-pie -shared -Wl,-soname,libcodeobj_test.so -o libcodeobj_test.so CMakeFiles/codeobj_test.dir/app/codeobj_test.cpp.o -Wl,-rpath,/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer:/opt/rocm_sdk_612/lib64: ../libroctracer64.so.4.1.0 -Wl,-rpath-link,/opt/rocm_sdk_612/lib64
hipcc-cmd: "/opt/rocm_sdk_612/bin/clang" --driver-mode=g++ --hip-path="/opt/rocm_sdk_612" --hip-link --rtlib=compiler-rt -unwindlib=libgcc -fPIC -O3 -DNDEBUG -no-pie -shared -Wl,-soname,libcodeobj_test.so -o "libcodeobj_test.so" CMakeFiles/codeobj_test.dir/app/codeobj_test.cpp.o -Wl,-rpath,/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer:/opt/rocm_sdk_612/lib64: ../libroctracer64.so.4.1.0 -Wl,-rpath-link,/opt/rocm_sdk_612/lib64
clang: warning: argument unused during compilation: '-no-pie' [-Wunused-command-line-argument]
make[2]: Leaving directory '/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer'
[ 84%] Built target codeobj_test
Generated /home/user/src/rocm_sdk_builder/builddir/011_01_roctracer/test/CMakeFiles/multi_pool_activities.dir/directed/./multi_pool_activities_generated_multi_pool_activities.cpp.o successfully.
cd /home/user/src/rocm_sdk_builder/builddir/011_01_roctracer && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/user/src/rocm_sdk_builder/src_projects/roctracer /home/user/src/rocm_sdk_builder/src_projects/roctracer/test /home/user/src/rocm_sdk_builder/builddir/011_01_roctracer /home/user/src/rocm_sdk_builder/builddir/011_01_roctracer/test /home/user/src/rocm_sdk_builder/builddir/011_01_roctracer/test/CMakeFiles/multi_pool_activities.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer'
make -f test/CMakeFiles/multi_pool_activities.dir/build.make test/CMakeFiles/multi_pool_activities.dir/build
make[2]: Entering directory '/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer'
[ 86%] Linking HIP executable multi_pool_activities
cd /home/user/src/rocm_sdk_builder/builddir/011_01_roctracer/test && /usr/bin/cmake -E cmake_link_script CMakeFiles/multi_pool_activities.dir/link.txt --verbose=1
/opt/rocm_sdk_612/bin/hipcc_cmake_linker_helper /opt/rocm_sdk_612/bin -no-pie -Wl,--build-id=md5 CMakeFiles/multi_pool_activities.dir/directed/multi_pool_activities_generated_multi_pool_activities.cpp.o -o multi_pool_activities -Wl,-rpath,/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer:/opt/rocm_sdk_612/lib64: ../libroctracer64.so.4.1.0 -Wl,-rpath-link,/opt/rocm_sdk_612/lib64
HIP_PATH=/opt/rocm_sdk_612
HIP_PLATFORM=amd
HIP_COMPILER=clang
HIP_RUNTIME=rocclr
ROCM_PATH=/opt/rocm_sdk_612
HIP_ROCCLR_HOME=/opt/rocm_sdk_612
HIP_CLANG_PATH=/opt/rocm_sdk_612/bin
HIP_INCLUDE_PATH=/opt/rocm_sdk_612/include
HIP_LIB_PATH=/opt/rocm_sdk_612/lib
DEVICE_LIB_PATH=/opt/rocm_sdk_612/amdgcn/bitcode
HIP_CLANG_RT_LIB=/opt/rocm_sdk_612/lib/clang/17/lib/linux
hipcc-args: -no-pie -Wl,--build-id=md5 CMakeFiles/multi_pool_activities.dir/directed/multi_pool_activities_generated_multi_pool_activities.cpp.o -o multi_pool_activities -Wl,-rpath,/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer:/opt/rocm_sdk_612/lib64: ../libroctracer64.so.4.1.0 -Wl,-rpath-link,/opt/rocm_sdk_612/lib64
hipcc-cmd: "/opt/rocm_sdk_612/bin/clang" --driver-mode=g++ -O3 --hip-path="/opt/rocm_sdk_612" --hip-link --rtlib=compiler-rt -unwindlib=libgcc -no-pie -Wl,--build-id=md5 CMakeFiles/multi_pool_activities.dir/directed/multi_pool_activities_generated_multi_pool_activities.cpp.o -o "multi_pool_activities" -Wl,-rpath,/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer:/opt/rocm_sdk_612/lib64: ../libroctracer64.so.4.1.0 -Wl,-rpath-link,/opt/rocm_sdk_612/lib64
make[2]: Leaving directory '/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer'
[ 86%] Built target multi_pool_activities
1 warning generated when compiling for gfx906.
2 warnings generated when compiling for gfx906.
1 warning generated when compiling for gfx906.
[ 88%] Linking CXX shared library ../libhip_stats.so
cd /home/user/src/rocm_sdk_builder/builddir/011_01_roctracer/src && /usr/bin/cmake -E cmake_link_script CMakeFiles/hip_stats.dir/link.txt --verbose=1
/opt/rocm_sdk_612/bin/hipcc -fPIC -O3 -DNDEBUG -no-pie -shared -Wl,-soname,libhip_stats.so -o ../libhip_stats.so CMakeFiles/hip_stats.dir/hip_stats/hip_stats.cpp.o -Wl,-rpath,/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer:/opt/rocm_sdk_612/lib64: ../libroctracer64.so.4.1.0 -lstdc++fs -Wl,-rpath-link,/opt/rocm_sdk_612/lib64
HIP_PATH=/opt/rocm_sdk_612
HIP_PLATFORM=amd
HIP_COMPILER=clang
HIP_RUNTIME=rocclr
ROCM_PATH=/opt/rocm_sdk_612
HIP_ROCCLR_HOME=/opt/rocm_sdk_612
HIP_CLANG_PATH=/opt/rocm_sdk_612/bin
HIP_INCLUDE_PATH=/opt/rocm_sdk_612/include
HIP_LIB_PATH=/opt/rocm_sdk_612/lib
DEVICE_LIB_PATH=/opt/rocm_sdk_612/amdgcn/bitcode
HIP_CLANG_RT_LIB=/opt/rocm_sdk_612/lib/clang/17/lib/linux
hipcc-args: -fPIC -O3 -DNDEBUG -no-pie -shared -Wl,-soname,libhip_stats.so -o ../libhip_stats.so CMakeFiles/hip_stats.dir/hip_stats/hip_stats.cpp.o -Wl,-rpath,/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer:/opt/rocm_sdk_612/lib64: ../libroctracer64.so.4.1.0 -lstdc++fs -Wl,-rpath-link,/opt/rocm_sdk_612/lib64
hipcc-cmd: "/opt/rocm_sdk_612/bin/clang" --driver-mode=g++ --hip-path="/opt/rocm_sdk_612" --hip-link --rtlib=compiler-rt -unwindlib=libgcc -fPIC -O3 -DNDEBUG -no-pie -shared -Wl,-soname,libhip_stats.so -o "../libhip_stats.so" CMakeFiles/hip_stats.dir/hip_stats/hip_stats.cpp.o -Wl,-rpath,/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer:/opt/rocm_sdk_612/lib64: ../libroctracer64.so.4.1.0 -lstdc++fs -Wl,-rpath-link,/opt/rocm_sdk_612/lib64
clang: warning: argument unused during compilation: '-no-pie' [-Wunused-command-line-argument]
make[2]: Leaving directory '/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer'
[ 88%] Built target hip_stats
/home/user/src/rocm_sdk_builder/src_projects/roctracer/test/app/MatrixTranspose_test.cpp:153:5: warning: ignoring return value of function declared with 'nodiscard' attribute [-Wunused-result]
153 | hipSetDevice(devIndex);
| ^~~~~~~~~~~~ ~~~~~~~~
/home/user/src/rocm_sdk_builder/src_projects/roctracer/test/app/MatrixTranspose_test.cpp:153:5: warning: ignoring return value of function declared with 'nodiscard' attribute [-Wunused-result]
153 | hipSetDevice(devIndex);
| ^~~~~~~~~~~~ ~~~~~~~~
/home/user/src/rocm_sdk_builder/src_projects/roctracer/test/app/MatrixTranspose_test.cpp:141:3: warning: ignoring return value of function declared with 'nodiscard' attribute [-Wunused-result]
141 | hipGetDeviceCount(&gpuCount);
| ^~~~~~~~~~~~~~~~~ ~~~~~~~~~
/home/user/src/rocm_sdk_builder/src_projects/roctracer/test/app/MatrixTranspose_test.cpp:153:5: warning: ignoring return value of function declared with 'nodiscard' attribute [-Wunused-result]
153 | hipSetDevice(devIndex);
| ^~~~~~~~~~~~ ~~~~~~~~
1 warning generated when compiling for host.
Generated /home/user/src/rocm_sdk_builder/builddir/011_01_roctracer/test/CMakeFiles/MatrixTranspose_test.dir/app/./MatrixTranspose_test_generated_MatrixTranspose_test.cpp.o successfully.
cd /home/user/src/rocm_sdk_builder/builddir/011_01_roctracer && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/user/src/rocm_sdk_builder/src_projects/roctracer /home/user/src/rocm_sdk_builder/src_projects/roctracer/test /home/user/src/rocm_sdk_builder/builddir/011_01_roctracer /home/user/src/rocm_sdk_builder/builddir/011_01_roctracer/test /home/user/src/rocm_sdk_builder/builddir/011_01_roctracer/test/CMakeFiles/MatrixTranspose_test.dir/DependInfo.cmake --color=
1 warning generated when compiling for host.
make[2]: Leaving directory '/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer'
make -f test/CMakeFiles/MatrixTranspose_test.dir/build.make test/CMakeFiles/MatrixTranspose_test.dir/build
make[2]: Entering directory '/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer'
Generated /home/user/src/rocm_sdk_builder/builddir/011_01_roctracer/test/CMakeFiles/MatrixTranspose_hipaact_test.dir/app/./MatrixTranspose_hipaact_test_generated_MatrixTranspose_test.cpp.o successfully.
cd /home/user/src/rocm_sdk_builder/builddir/011_01_roctracer && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/user/src/rocm_sdk_builder/src_projects/roctracer /home/user/src/rocm_sdk_builder/src_projects/roctracer/test /home/user/src/rocm_sdk_builder/builddir/011_01_roctracer /home/user/src/rocm_sdk_builder/builddir/011_01_roctracer/test /home/user/src/rocm_sdk_builder/builddir/011_01_roctracer/test/CMakeFiles/MatrixTranspose_hipaact_test.dir/DependInfo.cmake --color=
[ 90%] Linking HIP executable MatrixTranspose_test
cd /home/user/src/rocm_sdk_builder/builddir/011_01_roctracer/test && /usr/bin/cmake -E cmake_link_script CMakeFiles/MatrixTranspose_test.dir/link.txt --verbose=1
make[2]: Leaving directory '/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer'
make -f test/CMakeFiles/MatrixTranspose_hipaact_test.dir/build.make test/CMakeFiles/MatrixTranspose_hipaact_test.dir/build
/opt/rocm_sdk_612/bin/hipcc_cmake_linker_helper /opt/rocm_sdk_612/bin -no-pie -Wl,--build-id=md5 CMakeFiles/MatrixTranspose_test.dir/app/MatrixTranspose_test_generated_MatrixTranspose_test.cpp.o -o MatrixTranspose_test -Wl,-rpath,/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer:/opt/rocm_sdk_612/lib64: ../libroctracer64.so.4.1.0 ../libroctx64.so.4.1.0 -Wl,-rpath-link,/opt/rocm_sdk_612/lib64
make[2]: Entering directory '/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer'
[ 92%] Linking HIP executable MatrixTranspose_hipaact_test
cd /home/user/src/rocm_sdk_builder/builddir/011_01_roctracer/test && /usr/bin/cmake -E cmake_link_script CMakeFiles/MatrixTranspose_hipaact_test.dir/link.txt --verbose=1
/opt/rocm_sdk_612/bin/hipcc_cmake_linker_helper /opt/rocm_sdk_612/bin -no-pie -Wl,--build-id=md5 CMakeFiles/MatrixTranspose_hipaact_test.dir/app/MatrixTranspose_hipaact_test_generated_MatrixTranspose_test.cpp.o -o MatrixTranspose_hipaact_test -Wl,-rpath,/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer:/opt/rocm_sdk_612/lib64: ../libroctracer64.so.4.1.0 ../libroctx64.so.4.1.0 -Wl,-rpath-link,/opt/rocm_sdk_612/lib64
2 warnings generated when compiling for host.
Generated /home/user/src/rocm_sdk_builder/builddir/011_01_roctracer/test/CMakeFiles/MatrixTranspose_mgpu.dir/app/./MatrixTranspose_mgpu_generated_MatrixTranspose_test.cpp.o successfully.
cd /home/user/src/rocm_sdk_builder/builddir/011_01_roctracer && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/user/src/rocm_sdk_builder/src_projects/roctracer /home/user/src/rocm_sdk_builder/src_projects/roctracer/test /home/user/src/rocm_sdk_builder/builddir/011_01_roctracer /home/user/src/rocm_sdk_builder/builddir/011_01_roctracer/test /home/user/src/rocm_sdk_builder/builddir/011_01_roctracer/test/CMakeFiles/MatrixTranspose_mgpu.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer'
make -f test/CMakeFiles/MatrixTranspose_mgpu.dir/build.make test/CMakeFiles/MatrixTranspose_mgpu.dir/build
make[2]: Entering directory '/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer'
[ 94%] Linking HIP executable MatrixTranspose_mgpu
cd /home/user/src/rocm_sdk_builder/builddir/011_01_roctracer/test && /usr/bin/cmake -E cmake_link_script CMakeFiles/MatrixTranspose_mgpu.dir/link.txt --verbose=1
/opt/rocm_sdk_612/bin/hipcc_cmake_linker_helper /opt/rocm_sdk_612/bin -no-pie -Wl,--build-id=md5 CMakeFiles/MatrixTranspose_mgpu.dir/app/MatrixTranspose_mgpu_generated_MatrixTranspose_test.cpp.o -o MatrixTranspose_mgpu -Wl,-rpath,/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer:/opt/rocm_sdk_612/lib64: ../libroctracer64.so.4.1.0 ../libroctx64.so.4.1.0 -Wl,-rpath-link,/opt/rocm_sdk_612/lib64
HIP_PATH=/opt/rocm_sdk_612
HIP_PLATFORM=amd
HIP_COMPILER=clang
HIP_RUNTIME=rocclr
ROCM_PATH=/opt/rocm_sdk_612
HIP_ROCCLR_HOME=/opt/rocm_sdk_612
HIP_CLANG_PATH=/opt/rocm_sdk_612/bin
HIP_INCLUDE_PATH=/opt/rocm_sdk_612/include
HIP_LIB_PATH=/opt/rocm_sdk_612/lib
DEVICE_LIB_PATH=/opt/rocm_sdk_612/amdgcn/bitcode
HIP_CLANG_RT_LIB=/opt/rocm_sdk_612/lib/clang/17/lib/linux
hipcc-args: -no-pie -Wl,--build-id=md5 CMakeFiles/MatrixTranspose_test.dir/app/MatrixTranspose_test_generated_MatrixTranspose_test.cpp.o -o MatrixTranspose_test -Wl,-rpath,/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer:/opt/rocm_sdk_612/lib64: ../libroctracer64.so.4.1.0 ../libroctx64.so.4.1.0 -Wl,-rpath-link,/opt/rocm_sdk_612/lib64
HIP_PATH=/opt/rocm_sdk_612
HIP_PLATFORM=amd
HIP_COMPILER=clang
HIP_RUNTIME=rocclr
ROCM_PATH=/opt/rocm_sdk_612
HIP_ROCCLR_HOME=/opt/rocm_sdk_612
HIP_CLANG_PATH=/opt/rocm_sdk_612/bin
HIP_INCLUDE_PATH=/opt/rocm_sdk_612/include
HIP_LIB_PATH=/opt/rocm_sdk_612/lib
DEVICE_LIB_PATH=/opt/rocm_sdk_612/amdgcn/bitcode
HIP_CLANG_RT_LIB=/opt/rocm_sdk_612/lib/clang/17/lib/linux
hipcc-args: -no-pie -Wl,--build-id=md5 CMakeFiles/MatrixTranspose_hipaact_test.dir/app/MatrixTranspose_hipaact_test_generated_MatrixTranspose_test.cpp.o -o MatrixTranspose_hipaact_test -Wl,-rpath,/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer:/opt/rocm_sdk_612/lib64: ../libroctracer64.so.4.1.0 ../libroctx64.so.4.1.0 -Wl,-rpath-link,/opt/rocm_sdk_612/lib64
hipcc-cmd: "/opt/rocm_sdk_612/bin/clang" --driver-mode=g++ -O3 --hip-path="/opt/rocm_sdk_612" --hip-link --rtlib=compiler-rt -unwindlib=libgcc -no-pie -Wl,--build-id=md5 CMakeFiles/MatrixTranspose_test.dir/app/MatrixTranspose_test_generated_MatrixTranspose_test.cpp.o -o "MatrixTranspose_test" -Wl,-rpath,/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer:/opt/rocm_sdk_612/lib64: ../libroctracer64.so.4.1.0 ../libroctx64.so.4.1.0 -Wl,-rpath-link,/opt/rocm_sdk_612/lib64
hipcc-cmd: "/opt/rocm_sdk_612/bin/clang" --driver-mode=g++ -O3 --hip-path="/opt/rocm_sdk_612" --hip-link --rtlib=compiler-rt -unwindlib=libgcc -no-pie -Wl,--build-id=md5 CMakeFiles/MatrixTranspose_hipaact_test.dir/app/MatrixTranspose_hipaact_test_generated_MatrixTranspose_test.cpp.o -o "MatrixTranspose_hipaact_test" -Wl,-rpath,/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer:/opt/rocm_sdk_612/lib64: ../libroctracer64.so.4.1.0 ../libroctx64.so.4.1.0 -Wl,-rpath-link,/opt/rocm_sdk_612/lib64
HIP_PATH=/opt/rocm_sdk_612
HIP_PLATFORM=amd
HIP_COMPILER=clang
HIP_RUNTIME=rocclr
/usr/bin/ld: CMakeFiles/MatrixTranspose_test.dir/app/MatrixTranspose_test_generated_MatrixTranspose_test.cpp.o: in function main': MatrixTranspose_test.cpp:(.text+0x322): undefined reference to hipGetDevicePropertiesR0600'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ROCM_PATH=/opt/rocm_sdk_612
HIP_ROCCLR_HOME=/opt/rocm_sdk_612
HIP_CLANG_PATH=/opt/rocm_sdk_612/bin
HIP_INCLUDE_PATH=/opt/rocm_sdk_612/include
HIP_LIB_PATH=/opt/rocm_sdk_612/lib
DEVICE_LIB_PATH=/opt/rocm_sdk_612/amdgcn/bitcode
HIP_CLANG_RT_LIB=/opt/rocm_sdk_612/lib/clang/17/lib/linux
hipcc-args: -no-pie -Wl,--build-id=md5 CMakeFiles/MatrixTranspose_mgpu.dir/app/MatrixTranspose_mgpu_generated_MatrixTranspose_test.cpp.o -o MatrixTranspose_mgpu -Wl,-rpath,/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer:/opt/rocm_sdk_612/lib64: ../libroctracer64.so.4.1.0 ../libroctx64.so.4.1.0 -Wl,-rpath-link,/opt/rocm_sdk_612/lib64
make[2]: *** [test/CMakeFiles/MatrixTranspose_test.dir/build.make:92: test/MatrixTranspose_test] Error 1
make[2]: Leaving directory '/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer'
make[1]: *** [CMakeFiles/Makefile2:577: test/CMakeFiles/MatrixTranspose_test.dir/all] Error 2
/usr/bin/ld: CMakeFiles/MatrixTranspose_hipaact_test.dir/app/MatrixTranspose_hipaact_test_generated_MatrixTranspose_test.cpp.o: in function main': MatrixTranspose_test.cpp:(.text+0x322): undefined reference to hipGetDevicePropertiesR0600'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [test/CMakeFiles/MatrixTranspose_hipaact_test.dir/build.make:92: test/MatrixTranspose_hipaact_test] Error 1
make[2]: Leaving directory '/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer'
make[1]: *** [CMakeFiles/Makefile2:604: test/CMakeFiles/MatrixTranspose_hipaact_test.dir/all] Error 2
hipcc-cmd: "/opt/rocm_sdk_612/bin/clang" --driver-mode=g++ -O3 --hip-path="/opt/rocm_sdk_612" --hip-link --rtlib=compiler-rt -unwindlib=libgcc -no-pie -Wl,--build-id=md5 CMakeFiles/MatrixTranspose_mgpu.dir/app/MatrixTranspose_mgpu_generated_MatrixTranspose_test.cpp.o -o "MatrixTranspose_mgpu" -Wl,-rpath,/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer:/opt/rocm_sdk_612/lib64: ../libroctracer64.so.4.1.0 ../libroctx64.so.4.1.0 -Wl,-rpath-link,/opt/rocm_sdk_612/lib64
/usr/bin/ld: CMakeFiles/MatrixTranspose_mgpu.dir/app/MatrixTranspose_mgpu_generated_MatrixTranspose_test.cpp.o: in function main': MatrixTranspose_test.cpp:(.text+0x360): undefined reference to hipGetDevicePropertiesR0600'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [test/CMakeFiles/MatrixTranspose_mgpu.dir/build.make:92: test/MatrixTranspose_mgpu] Error 1
make[2]: Leaving directory '/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer'
make[1]: *** [CMakeFiles/Makefile2:631: test/CMakeFiles/MatrixTranspose_mgpu.dir/all] Error 2
Generated /home/user/src/rocm_sdk_builder/builddir/011_01_roctracer/test/CMakeFiles/activity_and_callback.dir/directed/./activity_and_callback_generated_activity_and_callback.cpp.o successfully.
cd /home/user/src/rocm_sdk_builder/builddir/011_01_roctracer && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/user/src/rocm_sdk_builder/src_projects/roctracer /home/user/src/rocm_sdk_builder/src_projects/roctracer/test /home/user/src/rocm_sdk_builder/builddir/011_01_roctracer /home/user/src/rocm_sdk_builder/builddir/011_01_roctracer/test /home/user/src/rocm_sdk_builder/builddir/011_01_roctracer/test/CMakeFiles/activity_and_callback.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer'
make -f test/CMakeFiles/activity_and_callback.dir/build.make test/CMakeFiles/activity_and_callback.dir/build
make[2]: Entering directory '/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer'
[ 96%] Linking HIP executable activity_and_callback
cd /home/user/src/rocm_sdk_builder/builddir/011_01_roctracer/test && /usr/bin/cmake -E cmake_link_script CMakeFiles/activity_and_callback.dir/link.txt --verbose=1
/opt/rocm_sdk_612/bin/hipcc_cmake_linker_helper /opt/rocm_sdk_612/bin -no-pie -Wl,--build-id=md5 CMakeFiles/activity_and_callback.dir/directed/activity_and_callback_generated_activity_and_callback.cpp.o -o activity_and_callback -Wl,-rpath,/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer:/opt/rocm_sdk_612/lib64: ../libroctracer64.so.4.1.0 -Wl,-rpath-link,/opt/rocm_sdk_612/lib64
HIP_PATH=/opt/rocm_sdk_612
HIP_PLATFORM=amd
HIP_COMPILER=clang
HIP_RUNTIME=rocclr
ROCM_PATH=/opt/rocm_sdk_612
HIP_ROCCLR_HOME=/opt/rocm_sdk_612
HIP_CLANG_PATH=/opt/rocm_sdk_612/bin
HIP_INCLUDE_PATH=/opt/rocm_sdk_612/include
HIP_LIB_PATH=/opt/rocm_sdk_612/lib
DEVICE_LIB_PATH=/opt/rocm_sdk_612/amdgcn/bitcode
HIP_CLANG_RT_LIB=/opt/rocm_sdk_612/lib/clang/17/lib/linux
hipcc-args: -no-pie -Wl,--build-id=md5 CMakeFiles/activity_and_callback.dir/directed/activity_and_callback_generated_activity_and_callback.cpp.o -o activity_and_callback -Wl,-rpath,/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer:/opt/rocm_sdk_612/lib64: ../libroctracer64.so.4.1.0 -Wl,-rpath-link,/opt/rocm_sdk_612/lib64
hipcc-cmd: "/opt/rocm_sdk_612/bin/clang" --driver-mode=g++ -O3 --hip-path="/opt/rocm_sdk_612" --hip-link --rtlib=compiler-rt -unwindlib=libgcc -no-pie -Wl,--build-id=md5 CMakeFiles/activity_and_callback.dir/directed/activity_and_callback_generated_activity_and_callback.cpp.o -o "activity_and_callback" -Wl,-rpath,/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer:/opt/rocm_sdk_612/lib64: ../libroctracer64.so.4.1.0 -Wl,-rpath-link,/opt/rocm_sdk_612/lib64
make[2]: Leaving directory '/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer'
[ 96%] Built target activity_and_callback
[ 98%] Linking CXX shared library ../libroctracer_tool.so
cd /home/user/src/rocm_sdk_builder/builddir/011_01_roctracer/src && /usr/bin/cmake -E cmake_link_script CMakeFiles/roctracer_tool.dir/link.txt --verbose=1
/opt/rocm_sdk_612/bin/hipcc -fPIC -O3 -DNDEBUG -Wl,--version-script=/home/user/src/rocm_sdk_builder/src_projects/roctracer/src/tracer_tool/exportmap -Wl,--no-undefined -no-pie -shared -Wl,-soname,libroctracer_tool.so -o ../libroctracer_tool.so CMakeFiles/roctracer_tool.dir/tracer_tool/tracer_tool.cpp.o -Wl,-rpath,/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer:/opt/rocm_sdk_612/lib64: libutil.a ../libroctracer64.so.4.1.0 /opt/rocm_sdk_612/lib64/libhsa-runtime64.so.1.13.0 -lstdc++fs -latomic -ldl
HIP_PATH=/opt/rocm_sdk_612
HIP_PLATFORM=amd
HIP_COMPILER=clang
HIP_RUNTIME=rocclr
ROCM_PATH=/opt/rocm_sdk_612
HIP_ROCCLR_HOME=/opt/rocm_sdk_612
HIP_CLANG_PATH=/opt/rocm_sdk_612/bin
HIP_INCLUDE_PATH=/opt/rocm_sdk_612/include
HIP_LIB_PATH=/opt/rocm_sdk_612/lib
DEVICE_LIB_PATH=/opt/rocm_sdk_612/amdgcn/bitcode
HIP_CLANG_RT_LIB=/opt/rocm_sdk_612/lib/clang/17/lib/linux
hipcc-args: -fPIC -O3 -DNDEBUG -Wl,--version-script=/home/user/src/rocm_sdk_builder/src_projects/roctracer/src/tracer_tool/exportmap -Wl,--no-undefined -no-pie -shared -Wl,-soname,libroctracer_tool.so -o ../libroctracer_tool.so CMakeFiles/roctracer_tool.dir/tracer_tool/tracer_tool.cpp.o -Wl,-rpath,/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer:/opt/rocm_sdk_612/lib64: libutil.a ../libroctracer64.so.4.1.0 /opt/rocm_sdk_612/lib64/libhsa-runtime64.so.1.13.0 -lstdc++fs -latomic -ldl
hipcc-cmd: "/opt/rocm_sdk_612/bin/clang" --driver-mode=g++ --hip-path="/opt/rocm_sdk_612" --hip-link --rtlib=compiler-rt -unwindlib=libgcc -fPIC -O3 -DNDEBUG -Wl,--version-script=/home/user/src/rocm_sdk_builder/src_projects/roctracer/src/tracer_tool/exportmap -Wl,--no-undefined -no-pie -shared -Wl,-soname,libroctracer_tool.so -o "../libroctracer_tool.so" CMakeFiles/roctracer_tool.dir/tracer_tool/tracer_tool.cpp.o -Wl,-rpath,/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer:/opt/rocm_sdk_612/lib64: libutil.a ../libroctracer64.so.4.1.0 /opt/rocm_sdk_612/lib64/libhsa-runtime64.so.1.13.0 -lstdc++fs -latomic -ldl
clang: warning: argument unused during compilation: '-no-pie' [-Wunused-command-line-argument]
make[2]: Leaving directory '/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer'
[ 98%] Built target roctracer_tool
[100%] Linking CXX shared library ../../libfile_plugin.so
cd /home/user/src/rocm_sdk_builder/builddir/011_01_roctracer/plugin/file && /usr/bin/cmake -E cmake_link_script CMakeFiles/file_plugin.dir/link.txt --verbose=1
/opt/rocm_sdk_612/bin/hipcc -fPIC -O3 -DNDEBUG -Wl,--version-script=/home/user/src/rocm_sdk_builder/src_projects/roctracer/plugin/file/../exportmap -Wl,--no-undefined -pthread -no-pie -shared -Wl,-soname,libfile_plugin.so -o ../../libfile_plugin.so CMakeFiles/file_plugin.dir/file.cpp.o -Wl,-rpath,/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer:/opt/rocm_sdk_612/lib64: ../../src/libutil.a ../../libroctracer64.so.4.1.0 /opt/rocm_sdk_612/lib64/libhsa-runtime64.so.1.13.0 -lstdc++fs /opt/rocm_sdk_612/lib64/libamd_comgr.so.2.7.60102
HIP_PATH=/opt/rocm_sdk_612
HIP_PLATFORM=amd
HIP_COMPILER=clang
HIP_RUNTIME=rocclr
ROCM_PATH=/opt/rocm_sdk_612
HIP_ROCCLR_HOME=/opt/rocm_sdk_612
HIP_CLANG_PATH=/opt/rocm_sdk_612/bin
HIP_INCLUDE_PATH=/opt/rocm_sdk_612/include
HIP_LIB_PATH=/opt/rocm_sdk_612/lib
DEVICE_LIB_PATH=/opt/rocm_sdk_612/amdgcn/bitcode
HIP_CLANG_RT_LIB=/opt/rocm_sdk_612/lib/clang/17/lib/linux
hipcc-args: -fPIC -O3 -DNDEBUG -Wl,--version-script=/home/user/src/rocm_sdk_builder/src_projects/roctracer/plugin/file/../exportmap -Wl,--no-undefined -pthread -no-pie -shared -Wl,-soname,libfile_plugin.so -o ../../libfile_plugin.so CMakeFiles/file_plugin.dir/file.cpp.o -Wl,-rpath,/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer:/opt/rocm_sdk_612/lib64: ../../src/libutil.a ../../libroctracer64.so.4.1.0 /opt/rocm_sdk_612/lib64/libhsa-runtime64.so.1.13.0 -lstdc++fs /opt/rocm_sdk_612/lib64/libamd_comgr.so.2.7.60102
hipcc-cmd: "/opt/rocm_sdk_612/bin/clang" --driver-mode=g++ --hip-path="/opt/rocm_sdk_612" --hip-link --rtlib=compiler-rt -unwindlib=libgcc -fPIC -O3 -DNDEBUG -Wl,--version-script=/home/user/src/rocm_sdk_builder/src_projects/roctracer/plugin/file/../exportmap -Wl,--no-undefined -pthread -no-pie -shared -Wl,-soname,libfile_plugin.so -o "../../libfile_plugin.so" CMakeFiles/file_plugin.dir/file.cpp.o -Wl,-rpath,/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer:/opt/rocm_sdk_612/lib64: ../../src/libutil.a ../../libroctracer64.so.4.1.0 /opt/rocm_sdk_612/lib64/libhsa-runtime64.so.1.13.0 -lstdc++fs /opt/rocm_sdk_612/lib64/libamd_comgr.so.2.7.60102
clang: warning: argument unused during compilation: '-no-pie' [-Wunused-command-line-argument]
make[2]: Leaving directory '/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer'
[100%] Built target file_plugin
make[1]: Leaving directory '/home/user/src/rocm_sdk_builder/builddir/011_01_roctracer'
make: *** [Makefile:156: all] Error 2
build failed: roctracer

lamikr added a commit that referenced this issue Jan 23, 2025
workaround to solve build problem on debian
until better fix is available.

#175

Signed-off-by: Mika Laitio <[email protected]>
@lamikr
Copy link
Owner

lamikr commented Jan 23, 2025

@commandline-be
hmm, weird... For some reason this line in roctracer/test/hip/MatrixTranspose.cpp will fail for you because not finding the function... HIP_CALL(hipGetDeviceProperties(&devProp, 0)); Wondering whats the difference on debian build as the build command for that file looked to be same what I have.

As a workaround, I disabled the building of roctraces tests for now by default. Can you try to update the sources and try again with these commands to get updated roctracer and then try to build it again.

./babs.sh -up
./babs.sh -b

@lamikr
Copy link
Owner

lamikr commented Jan 23, 2025

Thank you! I will try it tomorrow.

@Said-Akbar Hi, Have you had time to test the docker image?

@commandline-be
Copy link
Author

@commandline-be hmm, weird... For some reason this line in roctracer/test/hip/MatrixTranspose.cpp will fail for you because not finding the function... HIP_CALL(hipGetDeviceProperties(&devProp, 0)); Wondering whats the difference on debian build as the build command for that file looked to be same what I have.

As a workaround, I disabled the building of roctraces tests for now by default. Can you try to update the sources and try again with these commands to get updated roctracer and then try to build it again.

./babs.sh -up
./babs.sh -b

could this be because I'm not building as root ?
the context for building is a VM with PCI passthrough for the GPU

thus far I've not had notable issues with functionalities, at one point I played 3D games and benchmarks in the VM

@lamikr
Copy link
Owner

lamikr commented Jan 23, 2025

Sorry, I had error on my fix. Pushed new change again... Now the

./babs.sh -up
./babs.sh -b

should work...

@commandline-be
Copy link
Author

Sorry, I had error on my fix. Pushed new change again... Now the

./babs.sh -up ./babs.sh -b

should work...

no worries, your work is much appreciated. I've erased the entire rocm_sdk_builder folder and started over from scratch.

@commandline-be
Copy link
Author

Progress it seems ...

[ 0%] Building C object external/llvm-project/llvm/lib/Support/BLAKE3/CMakeFiles/LLVMSupportBlake3.dir/blake3.c.o
cd /home/user/src/rocm_sdk_builder/builddir/031_01_miopen_rocMLIR/external/llvm-project/llvm/lib/Support/BLAKE3 && /usr/bin/cc -DBUILD_EXAMPLES -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D_LIBCPP_ENABLE_ASSERTIONS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/user/src/rocm_sdk_builder/builddir/031_01_miopen_rocMLIR/external/llvm-project/llvm/lib/Support/BLAKE3 -I/home/user/src/rocm_sdk_builder/src_projects/rocMLIR/external/llvm-project/llvm/lib/Support/BLAKE3 -I/home/user/src/rocm_sdk_builder/builddir/031_01_miopen_rocMLIR/external/llvm-project/llvm/include -I/home/user/src/rocm_sdk_builder/src_projects/rocMLIR/external/llvm-project/llvm/include -I/opt/rocm_sdk_612/include -I/opt/rocm_sdk_612/hsa/include -I/opt/rocm_sdk_612/rocm_smi/include -I/opt/rocm_sdk_612/rocblas/include -fPIC -fno-semantic-interposition -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-comment -ffunction-sections -fdata-sections -O3 -DNDEBUG -fPIC -UNDEBUG -MD -MT external/llvm-project/llvm/lib/Support/BLAKE3/CMakeFiles/LLVMSupportBlake3.dir/blake3.c.o -MF CMakeFiles/LLVMSupportBlake3.dir/blake3.c.o.d -o CMakeFiles/LLVMSupportBlake3.dir/blake3.c.o -c /home/user/src/rocm_sdk_builder/src_projects/rocMLIR/external/llvm-project/llvm/lib/Support/BLAKE3/blake3.c
Traceback (most recent call last):
File "/home/user/src/rocm_sdk_builder/src_projects/rocMLIR/external/llvm-project/mlir/lib/Dialect/GPU/AmdDeviceLibsIncGen.py", line 53, in
generate(Path(sys.argv[1]), Path(sys.argv[2]), sys.argv[3:])
File "/home/user/src/rocm_sdk_builder/src_projects/rocMLIR/external/llvm-project/mlir/lib/Dialect/GPU/AmdDeviceLibsIncGen.py", line 29, in generate
with (bcPath / (lib + ".bc")).open("rb") as libFile:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/rocm_sdk_612/lib/python3.11/pathlib.py", line 1044, in open
return io.open(self, mode, buffering, encoding, errors, newline)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/usr/amdgcn/bitcode/ocml.bc'
make[2]: *** [external/llvm-project/llvm/tools/mlir/lib/Dialect/GPU/CMakeFiles/AmdDeviceLibsIncGen.dir/build.make:124: external/llvm-project/llvm/tools/mlir/lib/Dialect/GPU/Transforms/AmdDeviceLibs.cpp.inc] Error 1
make[2]: *** Deleting file 'external/llvm-project/llvm/tools/mlir/lib/Dialect/GPU/Transforms/AmdDeviceLibs.cpp.inc'
make[2]: Leaving directory '/home/user/src/rocm_sdk_builder/builddir/031_01_miopen_rocMLIR'
make[1]: *** [CMakeFiles/Makefile2:57100: external/llvm-project/llvm/tools/mlir/lib/Dialect/GPU/CMakeFiles/AmdDeviceLibsIncGen.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/home/user/src/rocm_sdk_builder/builddir/031_01_miopen_rocMLIR'
[ 0%] Built target llvm_vcsrevision_h

and eventually

[ 0%] Built target MLIRTableGen
make[1]: Leaving directory '/home/user/src/rocm_sdk_builder/builddir/031_01_miopen_rocMLIR'
make: *** [Makefile:156: all] Error 2
build failed: rocMLIR

@commandline-be
Copy link
Author

commandline-be commented Jan 23, 2025

After: apt install miopen-hip-dev and then babs -b again I now get

Dependencies file "external/llvm-project/llvm/lib/Support/CMakeFiles/LLVMSupport.dir/circular_raw_ostream.cpp.o.d" is newer than depends file "/home/user/src/rocm_sdk_builder/builddir/031_01_miopen_rocMLIR/external/llvm-project/llvm/lib/Support/CMakeFiles/LLVMSupport.dir/compiler_depend.internal".
Dependencies file "external/llvm-project/llvm/lib/Support/CMakeFiles/LLVMSupport.dir/raw_os_ostream.cpp.o.d" is newer than depends file "/home/user/src/rocm_sdk_builder/builddir/031_01_miopen_rocMLIR/external/llvm-project/llvm/lib/Support/CMakeFiles/LLVMSupport.dir/compiler_depend.internal".
Dependencies file "external/llvm-project/llvm/lib/Support/CMakeFiles/LLVMSupport.dir/raw_ostream.cpp.o.d" is newer than depends file "/home/user/src/rocm_sdk_builder/builddir/031_01_miopen_rocMLIR/external/llvm-project/llvm/lib/Support/CMakeFiles/LLVMSupport.dir/compiler_depend.internal".
Dependencies file "external/llvm-project/llvm/lib/Support/CMakeFiles/LLVMSupport.dir/xxhash.cpp.o.d" is newer than depends file "/home/user/src/rocm_sdk_builder/builddir/031_01_miopen_rocMLIR/external/llvm-project/llvm/lib/Support/CMakeFiles/LLVMSupport.dir/compiler_depend.internal".
Consolidate compiler generated dependencies of target LLVMSupport
make[2]: Leaving directory '/home/user/src/rocm_sdk_builder/builddir/031_01_miopen_rocMLIR'
make -f external/llvm-project/llvm/lib/Support/CMakeFiles/LLVMSupport.dir/build.make external/llvm-project/llvm/lib/Support/CMakeFiles/LLVMSupport.dir/build
make[2]: Entering directory '/home/user/src/rocm_sdk_builder/builddir/031_01_miopen_rocMLIR'
make[2]: Nothing to be done for 'external/llvm-project/llvm/lib/Support/CMakeFiles/LLVMSupport.dir/build'.
make[2]: Leaving directory '/home/user/src/rocm_sdk_builder/builddir/031_01_miopen_rocMLIR'
[ 4%] Built target LLVMSupport
make[1]: Leaving directory '/home/user/src/rocm_sdk_builder/builddir/031_01_miopen_rocMLIR'
make: *** [Makefile:156: all] Error 2
build failed: rocMLIR

and also after: apt install llvm-dev

make[2]: Nothing to be done for 'external/llvm-project/llvm/tools/mlir/lib/TableGen/CMakeFiles/MLIRTableGen.dir/build'.
make[2]: Leaving directory '/home/user/src/rocm_sdk_builder/builddir/031_01_miopen_rocMLIR'
[ 0%] Generating device libraries include package
[ 0%] Built target llvm_vcsrevision_h
[ 0%] Built target LLVMSupportBlake3
[ 0%] Built target LLVMDemangle
cd /home/user/src/rocm_sdk_builder/builddir/031_01_miopen_rocMLIR/external/llvm-project/llvm/tools/mlir/lib/Dialect/GPU && /home/user/src/rocm_sdk_builder/src_projects/rocMLIR/external/llvm-project/mlir/lib/Dialect/GPU/AmdDeviceLibsIncGen.py /home/user/src/rocm_sdk_builder/builddir/031_01_miopen_rocMLIR/external/llvm-project/llvm/tools/mlir/lib/Dialect/GPU/Transforms/AmdDeviceLibs.cpp.inc /usr ocml ockl hip asanrtl
make -f external/llvm-project/llvm/lib/Support/CMakeFiles/LLVMSupport.dir/build.make external/llvm-project/llvm/lib/Support/CMakeFiles/LLVMSupport.dir/depend
[ 0%] Built target obj.LLVMTableGenCommon
[ 0%] Built target MLIRTableGen
make[2]: Entering directory '/home/user/src/rocm_sdk_builder/builddir/031_01_miopen_rocMLIR'
cd /home/user/src/rocm_sdk_builder/builddir/031_01_miopen_rocMLIR && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/user/src/rocm_sdk_builder/src_projects/rocMLIR /home/user/src/rocm_sdk_builder/src_projects/rocMLIR/external/llvm-project/llvm/lib/Support /home/user/src/rocm_sdk_builder/builddir/031_01_miopen_rocMLIR /home/user/src/rocm_sdk_builder/builddir/031_01_miopen_rocMLIR/external/llvm-project/llvm/lib/Support /home/user/src/rocm_sdk_builder/builddir/031_01_miopen_rocMLIR/external/llvm-project/llvm/lib/Support/CMakeFiles/LLVMSupport.dir/DependInfo.cmake --color=
Traceback (most recent call last):
File "/home/user/src/rocm_sdk_builder/src_projects/rocMLIR/external/llvm-project/mlir/lib/Dialect/GPU/AmdDeviceLibsIncGen.py", line 53, in
generate(Path(sys.argv[1]), Path(sys.argv[2]), sys.argv[3:])
File "/home/user/src/rocm_sdk_builder/src_projects/rocMLIR/external/llvm-project/mlir/lib/Dialect/GPU/AmdDeviceLibsIncGen.py", line 29, in generate
with (bcPath / (lib + ".bc")).open("rb") as libFile:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/rocm_sdk_612/lib/python3.11/pathlib.py", line 1044, in open
return io.open(self, mode, buffering, encoding, errors, newline)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/usr/amdgcn/bitcode/ocml.bc'

make[2]: *** [external/llvm-project/llvm/tools/mlir/lib/Dialect/GPU/CMakeFiles/AmdDeviceLibsIncGen.dir/build.make:124: external/llvm-project/llvm/tools/mlir/lib/Dialect/GPU/Transforms/AmdDeviceLibs.cpp.inc] Error 1
make[2]: *** Deleting file 'external/llvm-project/llvm/tools/mlir/lib/Dialect/GPU/Transforms/AmdDeviceLibs.cpp.inc'
make[2]: Leaving directory '/home/user/src/rocm_sdk_builder/builddir/031_01_miopen_rocMLIR'
make[1]: *** [CMakeFiles/Makefile2:57100: external/llvm-project/llvm/tools/mlir/lib/Dialect/GPU/CMakeFiles/AmdDeviceLibsIncGen.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/home/user/src/rocm_sdk_builder/builddir/031_01_miopen_rocMLIR'
make -f external/llvm-project/llvm/lib/Support/CMakeFiles/LLVMSupport.dir/build.make external/llvm-project/llvm/lib/Support/CMakeFiles/LLVMSupport.dir/build
make[2]: Entering directory '/home/user/src/rocm_sdk_builder/builddir/031_01_miopen_rocMLIR'
make[2]: Nothing to be done for 'external/llvm-project/llvm/lib/Support/CMakeFiles/LLVMSupport.dir/build'.
make[2]: Leaving directory '/home/user/src/rocm_sdk_builder/builddir/031_01_miopen_rocMLIR'
[ 4%] Built target LLVMSupport
make[1]: Leaving directory '/home/user/src/rocm_sdk_builder/builddir/031_01_miopen_rocMLIR'
make: *** [Makefile:156: all] Error 2
build failed: rocMLIR

@lamikr
Copy link
Owner

lamikr commented Jan 24, 2025

You should not need to install the rocm deb files, those are most likely messing the build somehow.
They probably defines the ROCM_PATH or some other environment variable that confuses the build because some apps are then looking files under ROCM_PATH.

That's because I see in AmdDeviceLibsIncGen.py file that was in your error message a following on line 25:

def generate(outputPath: Path, rocmPath: Path, libs: List[str]) -> None:
bcPath = rocmPath / "amdgcn" / "bitcode"

Can you print the output of following commands:

  1. env | grep ROCM

  2. sudo apt list --installed | grep rocm

  3. Or do you have /opt/rocm directory?

@commandline-be
Copy link
Author

You should not need to install the rocm deb files, those are most likely messing the build somehow. They probably defines the ROCM_PATH or some other environment variable that confuses the build because some apps are then looking files under ROCM_PATH.

That's because I see in AmdDeviceLibsIncGen.py file that was in your error message a following on line 25:

def generate(outputPath: Path, rocmPath: Path, libs: List[str]) -> None: bcPath = rocmPath / "amdgcn" / "bitcode"

Can you print the output of following commands:

  1. env | grep ROCM
  2. sudo apt list --installed | grep rocm
  3. Or do you have /opt/rocm directory?

Thanks for the informative feedback.

  1. no results for ROCM and rocm
  2. there were debs installed, I tried installed the deb to see if this affected the build process, these seems both true and false, depending on the type of file installed
  3. yes, all builds find otherwise

should I consider running a source <path> before building ?

@commandline-be
Copy link
Author

I've now removed anything related to rocm installed on the OS by the package manager. The build now appears to continue.

Thanks. I assumed the build process would not ingest anything from the OS for building.

@commandline-be
Copy link
Author

commandline-be commented Jan 24, 2025

After a long build it now fails at pytorch. I report the output below, should this matter. I'm restarting the entire build after a clean (-rs)

cc1plus: all warnings being treated as errors
[52/2619] Building CXX object third_party/fbgemm/asmjit/CMakeFiles/asmjit.dir/src/asmjit/x86/x86assembler.cpp.o
ninja: build stopped: subcommand failed.
build failed: pytorch
error in build cmd: ./build_rocm.sh /opt/rocm_sdk_612 60102 gfx906

--- before this FAILED is reported

41/2619] Building CXX object third_party/fbgemm/CMakeFiles/fbgemm_avx512.dir/src/UtilsAvx512.cc.o
FAILED: third_party/fbgemm/CMakeFiles/fbgemm_avx512.dir/src/UtilsAvx512.cc.o
/usr/bin/c++ -DFBGEMM_STATIC -I/home/user/src/rocm_sdk_builder/src_projects/pytorch/third_party/cpuinfo/include -I/home/user/src/rocm_sdk_builder/src_projects/pytorch/third_party/fbgemm/third_party/asmjit/src -I/home/user/src/rocm_sdk_builder/src_projects/pytorch/third_party/fbgemm/include -I/home/user/src/rocm_sdk_builder/src_projects/pytorch/third_party/fbgemm -isystem /home/user/src/rocm_sdk_builder/src_projects/pytorch/third_party/protobuf/src -isystem /home/user/src/rocm_sdk_builder/src_projects/pytorch/third_party/XNNPACK/include -Wno-error=maybe-uninitialized -D_GLIBCXX_USE_CXX11_ABI=1 -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -Wall -Wextra -Werror -Wno-deprecated-declarations -Wimplicit-fallthrough -O3 -DNDEBUG -fPIC -fvisibility=hidden -m64 -mavx2 -mfma -mavx512f -mavx512bw -mavx512dq -mavx512vl -std=c++17 -MD -MT third_party/fbgemm/CMakeFiles/fbgemm_avx512.dir/src/UtilsAvx512.cc.o -MF third_party/fbgemm/CMakeFiles/fbgemm_avx512.dir/src/UtilsAvx512.cc.o.d -o third_party/fbgemm/CMakeFiles/fbgemm_avx512.dir/src/UtilsAvx512.cc.o -c /home/user/src/rocm_sdk_builder/src_projects/pytorch/third_party/fbgemm/src/UtilsAvx512.cc
In file included from /usr/lib/gcc/x86_64-linux-gnu/12/include/immintrin.h:49,
from /home/user/src/rocm_sdk_builder/src_projects/pytorch/third_party/fbgemm/src/UtilsAvx512.cc:11:
In function ‘__m512 _mm512_unpacklo_ps(__m512, __m512)’,
inlined from ‘void fbgemm::{anonymous}::transpose_kernel_mxn_avx512(int, const float*, int64_t, float*, int64_t) [with int M = 16]’ at /home/user/src/rocm_sdk_builder/src_projects/pytorch/third_party/fbgemm/src/UtilsAvx512.cc:257:37:
/usr/lib/gcc/x86_64-linux-gnu/12/include/avx512fintrin.h:11541:10: warning: ‘__Y’ may be used uninitialized [-Wmaybe-uninitialized]
11541 | return (__m512) __builtin_ia32_unpcklps512_mask ((__v16sf) __A,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11542 | (__v16sf) __B,
| ~~~~~~~~~~~~~~
11543 | (__v16sf)
| ~~~~~~~~~
11544 | _mm512_undefined_ps (),
| ~~~~~~~~~~~~~~~~~~~~~~~
11545 | (__mmask16) -1);

@lamikr
Copy link
Owner

lamikr commented Jan 24, 2025

  1. env | grep ROCM
  2. sudo apt list --installed | grep rocm
  3. Or do you have /opt/rocm directory?

Thanks for the informative feedback.

1. no results for ROCM and rocm

2. there were debs installed, I tried installed the deb to see if this affected the build process, these seems both true and false, depending on the type of file installed

3. yes, all builds find otherwise

should I consider running a source <path> before building ?

Thanks, this was good to information.

Hard to know what exactly caused that. Maybe there were some libraries or header files under /usr directory that confused it. I wished it would have been some environment variable like ROCM_HOME because that I could have been able to solve/fix more easily by re-dedining it in envsetup.sh that babs uses.

Any changes you could check which deb files you removed? (history command)

@lamikr
Copy link
Owner

lamikr commented Jan 25, 2025

@commandline-be If you are still seeing the same error, could you try to replace the line "unset CFLAGS"
with

export CFLAGS="-Wno-error=maybe-uninitialized" 

from src_projects/pytorch/build_rocm.sh and then run

 ./babs.sh --clean binfo/core/039_02_pytorch.binfo
 ./babs.sh -b binfo/core/039_02_pytorch.binfo

to see whether pytorch would now build ok.

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

5 participants