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

Call parameter type does not match function signature #999

Open
ex-rzr opened this issue Jan 23, 2019 · 8 comments
Open

Call parameter type does not match function signature #999

ex-rzr opened this issue Jan 23, 2019 · 8 comments
Assignees

Comments

@ex-rzr
Copy link

ex-rzr commented Jan 23, 2019

See ROCm/rocRAND#40

rocRAND cannot be built using HCC > 1.3.18482.
It looks like a compiler bug, but if it's not, any ideas how to fix this are welcome.

(We can't understand what commit should be used to build 1.3.18482, i.e. the version of HCC in official debs).

@david-salinas david-salinas self-assigned this Feb 1, 2019
@david-salinas
Copy link
Collaborator

Looking at this.

@david-salinas
Copy link
Collaborator

So, I just tried to reproduce this error, building rocRAND, with latest HCC and HIP, and I couldn't reproduce the error you're seeing. But I'm not terribly surprised that you ran into this problem. There are a lot of "moving parts" (HCC, HIP, and rocRAND) and it is easy to run into this situation, especially if you're building some, or all, of these from source. I would recommend, if you're primarily interested in only rocRAND, to use the already built HCC/HIP binaries from the Debian repo. And if you build rocRAND from source, to consider two things: 1) use a docker container to help minimize any "contamination" on your machine, and 2) when you do build, and then rebuild rocRAND, completely remove the "build" directory - don't trust make clean to do a good enough job of cleaning.

If you want to build HCC and/or HIP from source too, consider the above recommendations as well (use a docker container, and always completely remove build directory). And build/install HCC completely first, then HIP, then rocRAND.

Let me know if you are still running into this issue.

Cheers

@augustofg
Copy link

Hi,

I'm using ArchLinux and have rebuilt everything from scratch (roct-thunk-interface -> rocr-runtime -> hcc -> hip -> rocrand), still getting the same error when building rocrand:

Call parameter type does not match function signature!
  %StackGuardSlot = alloca i8*, addrspace(5)  
 i8**  call void @llvm.stackprotector(i8* %0, i8* addrspace(5)* %StackGuardSlot)
in function _Z19rocrand_init_kernelIN14rocrand_device13xorwow_engineEEvPT_myy
LLVM ERROR: Broken function found, compilation aborted!
Generating AMD GCN kernel failed in llc for target: gfx803             
Call parameter type does not match function signature!
  %StackGuardSlot = alloca i8*, addrspace(5)
 i8**  call void @llvm.stackprotector(i8* %0, i8* addrspace(5)* %StackGuardSlot)
in function _Z19rocrand_init_kernelIN14rocrand_device13xorwow_engineEEvPT_myy
LLVM ERROR: Broken function found, compilation aborted! 
Generating AMD GCN kernel failed in llc for target: gfx900
Call parameter type does not match function signature!
  %StackGuardSlot = alloca i8*, addrspace(5)
 i8**  call void @llvm.stackprotector(i8* %0, i8* addrspace(5)* %StackGuardSlot)
in function _Z19rocrand_init_kernelIN14rocrand_device13xorwow_engineEEvPT_myy
LLVM ERROR: Broken function found, compilation aborted!                                                
Generating AMD GCN kernel failed in llc for target: gfx906
clang-9: error: linker command failed with exit code 7 (use -v to see invocation)     
make[2]: *** [test/CMakeFiles/test_rocrand_kernel_xorwow.dir/build.make:91: test/test_rocrand_kernel_xorwow] Error 7
make[1]: *** [CMakeFiles/Makefile2:1183: test/CMakeFiles/test_rocrand_kernel_xorwow.dir/all] Error 2

I've built the master branch of all components. Can you please provide the exact revision of these components you have used @david-salinas ?

I prefer building everything from scratch, so I can properly package these components for ArchLinux.

Thanks,
Augusto.

@chazanov
Copy link

chazanov commented Feb 3, 2019

Same error for me. @david-salinas I hate Docker, but of course I'm building in a clean chroot.

@ex-rzr
Copy link
Author

ex-rzr commented Feb 4, 2019

I've checked the latest HCC (clang_tot_upgrade) and HIP (master) on Ubuntu. Other packages are ROCm 2.0 debs.

HCC clang version 9.0.0 (https://github.com/RadeonOpenCompute/hcc-clang-upgrade.git 73b2e4fbb46478ce08d42cc6d9e8bc7b8c7f58da) (https://github.com/RadeonOpenCompute/llvm.git c06b4c8225c8ec11de36cddf5b3d49bdd055c126) (based on HCC 1.3.19045-02e6963-73b2e4f-c06b4c8 )

rocRAND can be built. However, there is a recent commit (1d05859, https://github.com/RadeonOpenCompute/hcc/commits/clang_tot_upgrade) that updates submodules.

@Palmitoxico @chazanov @baerbock

  1. Release or Debug? I use -DCMAKE_BUILD_TYPE=Release for both HCC and HIP.
  2. @Palmitoxico and @chazanov use Arch. @baerbock, what is your platform?

@chazanov
Copy link

chazanov commented Feb 14, 2019

@ex-rzr Hi,
may you please upload your binaries of hcc & hip?

With the same config like you (release builds of hcc clang_tot_upgrade & HIP master from today):
HCC clang version 9.0.0 (https://github.com/RadeonOpenCompute/hcc-clang-upgrade.git 2d7f3a3c8f385c0aba115a6eed3ca96dd0b289e9) (https://github.com/RadeonOpenCompute/llvm.git 5f38a9683361416cfecc3e9c55f8c48dc5d5a041) (based on HCC 1.3.19064-46916709-2d7f3a3c8f-5f38a968336 )
HIP version: 1.5.19064
I still can't compile rocRAND (see Pastebin log)!

@ex-rzr
Copy link
Author

ex-rzr commented Feb 28, 2019

@david-salinas

Turned out that -fstack-protector-strong causes this crash. rocRAND doesn't use this flag but some users have it set "system-wide" (for example, in /etc/makepkg.conf which is used for building packages in Archlinux).

Even if there is an incorrect code in rocRAND (but I don't see it), the compiler must show an error, not crush.
I can add to rocRAND's cmake a code that removes this flag if necessary, but I'm not sure this is a right way.

What do you think?

@VincentSC
Copy link

@david-salinas, do you have a build of the compiler that does not crash on this, so we can see the error? In the short term, how can we override -fstack-protector-strong the easiest?

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