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

Linking Error with HIP SDK 5.7 (Windows) #1446

Open
blinkfrog opened this issue Apr 23, 2024 · 2 comments
Open

Linking Error with HIP SDK 5.7 (Windows) #1446

blinkfrog opened this issue Apr 23, 2024 · 2 comments
Labels
discussion General discussion about something

Comments

@blinkfrog
Copy link
Contributor

Hello,

I recently updated the HIP SDK from version 5.5 to 5.7 and am experiencing a build error when trying to compile SYCL programs targeting AMD devices with AdaptiveCpp. Here's the error I encounter during the build process of a test project (and any other project results in the same errors too):

[1/2] Building CXX object CMakeFiles/Blur.dir/blur.cpp.obj
FAILED: CMakeFiles/Blur.dir/blur.cpp.obj
python C:/AdaptiveCpp/lib/cmake/AdaptiveCpp/syclcc-launcher --launcher-cxx-compiler=C:/llvm/bin/clang++.exe --launcher-syclcc="python*C:/AdaptiveCpp/bin/acpp"  --acpp-targets="omp;hip.explicit-multipass:gfx1030,gfx1031,gfx1032,gfx1100,gfx1101,gfx1102" C:\llvm\bin\clang++.exe  -IC:/Temp/sycltest/SyclCmakeProject2.AMD/build -IC:/Temp/sycltest/SyclCmakeProject2.AMD -isystem C:/AdaptiveCpp/include -isystem C:/AdaptiveCpp/include/AdaptiveCpp -O3 -DNDEBUG -D_DLL -D_MT -Xclang --dependent-lib=msvcrt "--rocm-path=C:/Program Files/AMD/ROCm/5.7" -MD -MT CMakeFiles/Blur.dir/blur.cpp.obj -MF CMakeFiles\Blur.dir\blur.cpp.obj.d -o CMakeFiles/Blur.dir/blur.cpp.obj -c C:/Temp/sycltest/SyclCmakeProject2.AMD/blur.cpp
fatal error: cannot link module '': linking module flags 'amdgpu_code_object_version': IDs have conflicting values in 'C:\Program Files\AMD\ROCm/5.7\/amdgcn/bitcode\hip.bc' and 'C:/Temp/sycltest/SyclCmakeProject2.AMD/blur.cpp'
1 error generated when compiling for gfx1030.
ninja: build stopped: subcommand failed.

The error seems to involve conflicting module flags related to the amdgpu_code_object_version.
There was no such error when I used HIP SDK 5.5.

I've rebuilt LLVM and AdaptiveCpp, ensuring that it correctly finds HIP SDK 5.7. Unfortunately, this didn't resolve the issue. I have a limited background in LLVM and in using cross-platform open source software in overall, so I may be missing something obvious. Has anyone here encountered a similar problem or could provide guidance on resolving these linking module flag conflicts? Any help or pointers would be greatly appreciated.

Thank you!

@blinkfrog blinkfrog added the discussion General discussion about something label Apr 23, 2024
@illuhad
Copy link
Collaborator

illuhad commented Apr 29, 2024

This is probably because your LLVM defaults to an earlier version of amdgpu code object version than what is used in your ROCm. Try upgrading your LLVM. You can also try targeting a newer code object version, e.g. -mlink-builtin-bitcode "/opt/rocm/amdgcn/bitcode/oclc_abi_version_<version>.bc", but I'm not sure if just linking the newer builtin bitcode is sufficient.

@blinkfrog
Copy link
Contributor Author

Thank you. I've checked, and both ROCm SDK 5.5 and 5.7 use LLVM 17.0.0, while I am using 17.0.4, so this probably isn't the case, if my understanding of how it all works is correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion General discussion about something
Projects
None yet
Development

No branches or pull requests

2 participants