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

[SYCL][ROCM] amdgcn flag shows lld errors #4468

Closed
zjin-lcf opened this issue Sep 2, 2021 · 3 comments · Fixed by #4475
Closed

[SYCL][ROCM] amdgcn flag shows lld errors #4468

zjin-lcf opened this issue Sep 2, 2021 · 3 comments · Fixed by #4475
Assignees
Labels
bug Something isn't working hip Issues related to execution on HIP backend.

Comments

@zjin-lcf
Copy link
Contributor

zjin-lcf commented Sep 2, 2021

Because of the message "clang-14: warning: argument 'amdgcn-amd-amdhsa-sycldevice' is deprecated, use 'amdgcn' instead [-Wdeprecated]",

changing the argument shows the following error for a few SYCL programs. Could you reproduce the error using any SYCL program ?

clang++ -fsycl-unnamed-lambda -fsycl -fsycl-targets=amdgcn -Xsycl-target-backend --offload-arch=gfx9xx -O3 main.o -o main
lld: error: :0:0: in function _ZTSZZ4mainENKUlRN2cl4sycl7handlerEE_clES2_E1k void (i32 addrspace(1)*, i64, i64, i64): unsupported hsa intrinsic without hsa target

lld: error: lto.tmp:(function typeinfo name for cl::sycl::detail::AssertInfoCopier: .text._ZTSN2cl4sycl6detail16AssertInfoCopierE+0x60): internal linker error: cannot read addend for relocation R_AMDGPU_GOTPCREL32_LO
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.

lld: error: lto.tmp:(function typeinfo name for cl::sycl::detail::AssertInfoCopier: .text._ZTSN2cl4sycl6detail16AssertInfoCopierE+0x68): internal linker error: cannot read addend for relocation R_AMDGPU_GOTPCREL32_HI
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.

lld: error: undefined symbol: SCRATCH_RSRC_DWORD0

referenced by lto.tmp:(typeinfo name for cl::sycl::detail::AssertInfoCopier)

lld: error: undefined symbol: SCRATCH_RSRC_DWORD1

referenced by lto.tmp:(typeinfo name for cl::sycl::detail::AssertInfoCopier)
llvm-foreach:

llvm-foreach:
clang-14: error: amdgcn-link command failed with exit code 1 (use -v to see invocation)
m

@zjin-lcf zjin-lcf added the bug Something isn't working label Sep 2, 2021
@zjin-lcf zjin-lcf changed the title [SYCL][ROCM] amdgcn flag shows the error: unsupported hsa intrinsic without hsa target [SYCL][ROCM] amdgcn flag shows lld errors Sep 2, 2021
@bader bader added the hip Issues related to execution on HIP backend. label Sep 2, 2021
@npmiller
Copy link
Contributor

npmiller commented Sep 2, 2021

This is most likely due to dropping -sycldevice in #3929, could you try with -fsycl-targets=amdgcn-amd-amdhsa? Maybe it's just the suggestion in the warning not being correct.

@bader bader self-assigned this Sep 2, 2021
@zjin-lcf
Copy link
Contributor Author

zjin-lcf commented Sep 2, 2021

It is fine with or without "-sycldevice". Thanks.

@bader
Copy link
Contributor

bader commented Sep 2, 2021

This is most likely due to dropping -sycldevice in #3929, could you try with -fsycl-targets=amdgcn-amd-amdhsa? Maybe it's just the suggestion in the warning not being correct.

Right. The warning message is misleading. It applies to the triples with SPIR target only. I'll try to fix the warning.

bader referenced this issue Sep 3, 2021
Today DPC++ compiler requires users to set "sycldevice" target triple component to separate SYCL compilation mode for SPIR target from other compilation mode (e.g. OpenCL).
Triple environment component is not intended to be used in such context and this patch removes `sycldevice`.

This patch also preserves backward compatibility with binaries built using old versions of the compiler, which enforced `sycldevice` environment component of the target triple. It's provided by `clang-offload-bundler` tool, which now implicitly looks for the additional SYCL offload kind bundle with a "legacy" triple.
A driver warning was added to let users know that `sycldevice` environment component is ignored now.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hip Issues related to execution on HIP backend.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants