[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Building rocRAND with Debian HIP



I went back and reviewed some of my suggestions for HIP and rocRAND.

On 2022-06-04 23:21, Cordell Bloor wrote:

HIP Fix #2

The second problem with rocm-hipamd is that debian/patches/0007-isystem-removal.patch removes the wrong append to HIPCXXFLAGS. That's my fault. I listed the incorrect line numbers in my previous mail. It's -isystem "$HIP_INCLUDE_PATH" that causes problems, so that's lines 227-229 [1].

I didn't notice at the time, but the hip tests failed to build after deleting those lines. It seems that addition of the HIP include directory to the compile flags may be needed when HIP is installed to a non-system directory, but will cause problems when HIP is installed into /usr.

Rather than outright removal, I found that I could guard the HIPCXXFLAGS appends behind if($HIP_INCLUDE_PATH ne "/usr/include") for a successful build. Another potential alternative to consider may be to use -idirafter rather than -isystem.

rocRAND Fix #1

You'll need to delete the unnecessary HIP_COMPILER check at the end of VerifyCompiler.cmake [2]. It's checking that HIP_COMPILER STREQUAL "clang" and failing because HIP_COMPILER is "clang-14". It then emits a FATAL_ERROR to provide a 'friendly' error message. The entire section I linked in [2] can be deleted. All it does is suppress warnings.

The error that rocRAND emits is indeed unnecessary, but we will encounter this sort of problem quite frequently if we set HIP_COMPILER as "clang-14". The HIP_COMPILER should probably be changed in rocm-hipamd. As far as I can tell, HIP_COMPILER is never used to compile anything. It can be left as "clang" even if the compiler binary is "clang-14". The variable seems to exist solely to distinguish nvcc, hcc and clang.

[1]: https://salsa.debian.org/rocm-team/rocm-hipamd/-/blob/upstream/5.0.0/hip/bin/hipcc#L227-229
[2]: https://github.com/ROCmSoftwarePlatform/rocRAND/blob/rocm-5.0.0/cmake/VerifyCompiler.cmake#L43-L51

Sincerely,
Cory Bloor

Reply to: