-
Notifications
You must be signed in to change notification settings - Fork 56
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
[Issue]: Bad parsing of nvcc command line arguments by hipcc #226
Comments
Hi @neworderofjamie, you should be using llvm-project/amd/hipcc/bin/hipcc.pl Lines 354 to 361 in f9dc83d
-fPIC as well, so you should be able to just pass -fPIC .
|
Thanks for your response but /opt/rocm/bin/hipcc -dc -x cu -arch sm_86 -I"/opt/rocm/include" -std=c++11 -Xcompiler -fPIC files.cc nvcc is incorrectly invoked with: ailed to execute:/usr/local/cuda/bin/nvcc -Wno-deprecated-gpu-targets -lcuda -lcudart -L/usr/local/cuda/lib64 -dc -x cu -arch sm_86 -I/opt/rocm/include -std=c++11 -Xcompiler file.cc Using plain HIPCC_VERBOSE=1 /opt/rocm/bin/hipcc -dc -x cu -fPIC -arch sm_86 -I"/opt/rocm/include" -std=c++11 file.cc you can that the -fPIC is being stripped: hipcc-cmd: /usr/local/cuda/bin/nvcc -Wno-deprecated-gpu-targets -lcuda -lcudart -L/usr/local/cuda/lib64 -dc -x cu -arch sm_86 -I/opt/rocm/include -std=c++11 neuronUpdate.cc |
Also, by default my computer is using the binary rather than perl hipcc. However, if I force the perl version, I think the problem is with |
Thanks for checking it out! The binary and perl script should have the same logic with regards to this. I think you're on the right track, and agree that this is due to poor documentation:
It should be, but the scripts are actually configured to add llvm-project/amd/hipcc/bin/hipcc.pl Lines 417 to 422 in fba2930
-x cu explicitly seems to cause issues. On my end,
translates to
which has the expected
translates to
which does not seem to set the proper flags as you have observed. I see an old internal issue pertaining to this but can't find any mentions of this in documentation. Hopefully this resolves the issue on your end. I'll take a look to see where we can add documentation around this regardless, because there is no indication as far as I can see that adding |
Thank you so much - getting rid of the |
Problem Description
I'm trying to port some CUDA code to HIP and the
--compiler-options "-fPIC"
command line arguments seems to be being parsed incorrectly on thenvidia
platform and not being passed through tonvcc
Operating System
Ubuntu 20.04.6 LTS (Focal Fossa)"
CPU
Intel(R) Xeon(R) Gold 6134 CPU
GPU
2*NVIDIA RTX A5000
ROCm Version
ROCm 6.2.4
ROCm Component
HIPCC
Steps to Reproduce
/opt/rocm/bin/hipcc -dc -x cu -arch sm_86 -I"/opt/rocm/include" -std=c++11 --compiler-options -fPIC file.cc
where file.cc is a HIP source/usr/local/cuda/bin/nvcc -Wno-deprecated-gpu-targets -lcuda -lcudart -L/usr/local/cuda/lib64 -dc -x cu -arch sm_86 -I/opt/rocm/include -std=c++11 --compiler-options file.cc
i.e. compiler-options is parsed incorrectly(Optional for Linux users) Output of /opt/rocm/bin/rocminfo --support
No response
Additional Information
I can work around this by setting
NVCC_APPEND_FLAGS="--compiler-options -fPIC"
but this is annoyingThe text was updated successfully, but these errors were encountered: