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

[stdpar] amdgcn-link command failed with exit code 1 #1441

Open
asix001 opened this issue Apr 19, 2024 · 3 comments
Open

[stdpar] amdgcn-link command failed with exit code 1 #1441

asix001 opened this issue Apr 19, 2024 · 3 comments
Labels
discussion General discussion about something

Comments

@asix001
Copy link

asix001 commented Apr 19, 2024

When I try to compile a program which uses C++ Parallel STL, I get the following error:

/usr/bin/clang-offload-bundler: error: '/tmp/test-93cad0/test-gfx906.out': No such file or directory
clang-16: error: amdgcn-link command failed with exit code 1 

I compile my program with the follwing command:
acpp -O3 --acpp-stdpar --acpp-targets=hip program.cpp

I am using AMD MI210 GPU.

@asix001 asix001 added the discussion General discussion about something label Apr 19, 2024
@illuhad
Copy link
Collaborator

illuhad commented Apr 19, 2024

If you really want to use the old SMCP compiler (--acpp-targets=hip:...) you also need to provide a target of the form gfxXYZ which specifiies the target architecture. For example, --acpp-targets=hip:gfx908 is MI100. I think your GPU might be gfx90a, but you can look at the acpp-info output to check.

In any case, be advised that all our optimization efforts are currently focused almost exclusively on the new SSCP compiler (--acpp-targets=generic) which is going to provide better performance.

@asix001
Copy link
Author

asix001 commented Apr 24, 2024

@illuhad I tried with both --acpp-targets=hip:gfx90a and --acpp-targets=generic. For the former, I get the same error, for the latter, I get the error clang-16: error: linker command failed with exit code 1.
For --acpp-targets=generic it looks like acpp is looking for TBB which I find confusing as I am trying to run the program on GPU.

@illuhad
Copy link
Collaborator

illuhad commented Apr 24, 2024

AdaptiveCpp stdpar requiring TBB is expected, even when offloading to GPU. You would see the same thing with --acpp-targets=hip:gfx90a, the amdgcn-link error just means that it already errors out before host code linking.

The background is that AdaptiveCpp supports conditional offloading, i.e. it falls back to host execution if it thinks that the kernel cannot be safely run on device (e.g., if pointers to host stack are passed into the kernel), or if the optional offloading heuristic thinks that it is more beneficial to run on host.
Because of this, it always needs to compile two code paths: One where the STL algorithm is offloaded, and the fallback code path where regular libstdc++ parallel STL is used. Because libstdc++ PSTL needs TBB, AdaptiveCpp stdpar needs TBB by extension.

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