HIP icon indicating copy to clipboard operation
HIP copied to clipboard

Error and warnings when generating depfiles

Open misos1 opened this issue 3 years ago • 7 comments

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)

misos1 avatar Nov 11 '22 20:11 misos1

there is a bug in hipcc which does not handle -MM properly even though -M is handled.

The workaround is to use -M -MM

yxsamliu avatar Nov 14 '22 16:11 yxsamliu

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)

misos1 avatar Nov 14 '22 17:11 misos1

it needs hipcc.

If you use clang directly, you need to add --cuda-host-only -c

yxsamliu avatar Nov 14 '22 18:11 yxsamliu

Ok thanks. Will this be fixed?

misos1 avatar Nov 14 '22 19:11 misos1

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.

yxsamliu avatar Nov 14 '22 19:11 yxsamliu

Just to note it worked with hcc (at least it did not require any additional flags).

misos1 avatar Nov 14 '22 19:11 misos1

@misos1 Hi, is your issue resolved on the latest HIP? If so can we close this ticket?

abhimeda avatar Feb 08 '24 15:02 abhimeda

Seems this was fixed so why was it closed as "not planned"?

misos1 avatar Apr 11 '24 12:04 misos1