HIP
HIP copied to clipboard
Error and warnings when generating depfiles
I suppose I cannot just use ordinary clang to do this.
$ hipcc -MM -MP -MF test.d test.cpp -MT test.d -MT test.o
clang-15: warning: -lgcc_s: 'linker' input unused [-Wunused-command-line-argument]
clang-15: warning: -lgcc: 'linker' input unused [-Wunused-command-line-argument]
clang-15: warning: -lpthread: 'linker' input unused [-Wunused-command-line-argument]
clang-15: warning: -lm: 'linker' input unused [-Wunused-command-line-argument]
clang-15: warning: -lrt: 'linker' input unused [-Wunused-command-line-argument]
clang-15: warning: -Wl,--enable-new-dtags: 'linker' input unused [-Wunused-command-line-argument]
clang-15: warning: -Wl,-rpath=/opt/rocm-5.3.0/lib:/opt/rocm-5.3.0/lib: 'linker' input unused [-Wunused-command-line-argument]
clang-15: warning: -lamdhip64: 'linker' input unused [-Wunused-command-line-argument]
clang-15: warning: -lclang_rt.builtins-x86_64: 'linker' input unused [-Wunused-command-line-argument]
/opt/rocm-5.3.0/llvm/bin/clang-offload-bundler: error: '/tmp/test-181823/test-gfx900.d': No such file or directory
clang-15: error: clang-offload-bundler command failed with exit code 1 (use -v to see invocation)
there is a bug in hipcc which does not handle -MM properly even though -M is handled.
The workaround is to use -M -MM
This workaround does not work when trying to use rocm 5.3 clang++ directly:
$ /opt/rocm/llvm/bin/clang++ -x hip -M -MM -MP -MF test.d test.cpp -MT test.d -MT test.o
/opt/rocm/llvm/bin/clang-offload-bundler: error: '/tmp/test-a6d293/test-gfx803.d': No such file or directory
clang-15: error: clang-offload-bundler command failed with exit code 1 (use -v to see invocation)
it needs hipcc.
If you use clang directly, you need to add --cuda-host-only -c
Ok thanks. Will this be fixed?
The proper fix of this issue would require clang driver to parse and merge dependence files for CPU and each GPU. It would take some time and efforts. However I think eventually it should be fixed.
Just to note it worked with hcc (at least it did not require any additional flags).
@misos1 Hi, is your issue resolved on the latest HIP? If so can we close this ticket?
Seems this was fixed so why was it closed as "not planned"?