Closed tdd11235813 closed 5 months ago
update, WIP: working on compiling hip-clang via INSTALL.md (please fix AMD-clang link to HIP-clang in TOC). Here is the current install script. It compiles, but could not compile hip code with hip-clang yet. It still uses HCC stuff, but it seems it is intended. I'll update when I know more...
manual install hip-clang (broken)
update: the new hip-clang will not use any HCC at all, so do not waste your time to debug this script. The instructions in the public repos are not consistent at the moment.
I tried this recipe, but when I try to compile a hip file, I get:
/usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/a-a5df7e.o: in function `__hip_module_ctor':
a.hip.cpp:(.text+0x706): undefined reference to `__hipRegisterFatBinary'
/usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: a.hip.cpp:(.text+0x739): undefined reference to `__hipRegisterFunction'
/usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/a-a5df7e.o: in function `__hip_module_dtor':
a.hip.cpp:(.text+0x75e): undefined reference to `__hipUnregisterFatBinary'
This is defined in hip_clang.cpp, and this file is also compiled by the above script. Really waiting when hip-clang will be part of a ROCm release.
@davidrohr Could you please try with #1331 ?
Thanks, the fix works.
I found another issue with the hip-clang from this recipe: When the command line invoking hipcc contains -fopenmp
, I receive the following errors:
/opt/rocm/llvm/lib/clang/10.0.0/include/__clang_cuda_math_forward_declares.h:53:16: error: static declaration of 'abs' follows non-static declaration
__DEVICE__ int abs(int) __NOEXCEPT;
^
/usr/include/stdlib.h:837:12: note: previous declaration is here
extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
^
In file included from a.hip.cpp:3:
In file included from /opt/rocm/llvm/hip//include/hip/hip_runtime.h:56:
In file included from /opt/rocm/llvm/hip//include/hip/hcc_detail/hip_runtime.h:457:
Please not that I am not compiling for cuda, I have no idea why hipcc pull in the clang cuda headers.
thanks @davidrohr for pushing this, I also had issues with OpenMP and hcc in the past, not only because of the fishy math includes, and had to disable hipcc and OpenMP. I know it does not help :( (we use HIP for nvcc and hcc backend at the moment, without OpenMP support)
There are several people wondering about this HIP-clang path. It might save a lot of our time if AMD could provide a first HIP-clang version or straightforward guide or at least some information on the current plan & issues, since HCC has been deprecated (have not checked recent updates though).
When an HCC-less HIP-clang will be provided eventually, then it would be now waste of time to debug this HIP-clang compilation where HCC is still used.
update: the new hip-clang will not use any HCC at all, so do not waste your time to debug this script. The instructions in the public repos are not consistent at the moment.
Can you give some information which branch of llvm and hip could be used for building the hip-clang version so that I could build and install it by myself?
I have been able to build older hcc based hip and use that for building the tensorflow 2.02 from AMD's tensorflow-upsteam repo's r2.0-rocm-hipclang branch thats using the hip clang version. (same problem with the r2.1 branches)
I have only been able to build the tensorflow if I change the flags on r2.0-rocm-hipclang branch to use the hcc based hip.
@lamikr Apologies for the lack of response. Can you please test with latest ROCm 6.1.0 (HIP 6.1)? Thanks!
Can you shed some light on the new compiler workflow on HIP(AMD)? We currently use the deprecated HCC for our HIP codes on the AMD platform (ROCm 2.5). By reading hipcc script, it looks like, the new workflow will involve the
/opt/rocm/llvm
as default for HIP clang path, which is currently not present on our ROCm 2.5 installation (ubuntu), but it probably will come with new ROCm? Or is it part of the llvm AMDGPU toolchain?