Your message dated Fri, 02 Jun 2023 21:20:51 +0000
with message-id <[email protected]>
and subject line Bug#1031799: fixed in cmake 3.26.4-3
has caused the Debian Bug report #1031799,
regarding cmake-data: cmake does not search multiarch paths for HIP
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
1031799: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1031799
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: cmake-data
Version: 3.25.1-1
Severity: normal
X-Debbugs-Cc: [email protected], [email protected]

Dear Maintainer,

It is not possible to use CMake's HIP language support together with
the Debian package for HIP. Consider this sample project:

CMakeLists.txt:

    cmake_minimum_required(VERSION 3.22)
    project(example LANGUAGES HIP)
    add_executable(ex main.hip)

main.hip:

    #include <stdio.h>
    #include <stdlib.h>
    #include <hip/hip_runtime.h>
    
    #define CHECK_HIP(expr) do {              \
      hipError_t result = (expr);             \
      if (result != hipSuccess) {             \
        fprintf(stderr, "%s:%d: %s (%d)\n",   \
          __FILE__, __LINE__,                 \
          hipGetErrorString(result), result); \
        exit(EXIT_FAILURE);                   \
      }                                       \
    } while(0)
    
    __global__ void sq_arr(float *arr, int n) {
      int tid = blockDim.x*blockIdx.x + threadIdx.x;
      if (tid < n) {
        arr[tid] = arr[tid] * arr[tid];
      }
    }
    
    int main() {
      enum { N = 5 };
      float hArr[N] = { 1, 2, 3, 4, 5 };
      float *dArr;
      CHECK_HIP(hipMalloc(&dArr, sizeof(float) * N));
      CHECK_HIP(hipMemcpy(dArr, hArr, sizeof(float) * N, 
hipMemcpyHostToDevice));
      sq_arr<<<dim3(1), dim3(32,1,1), 0, 0>>>(dArr, N);
      CHECK_HIP(hipMemcpy(hArr, dArr, sizeof(float) * N, 
hipMemcpyDeviceToHost));
      for (int i = 0; i < N; ++i) {
        printf("%f\n", hArr[i]);
      }
      CHECK_HIP(hipFree(dArr));
      return 0;
    }

Build log:

    # apt install hipcc cmake
    # HIPFLAGS="--rocm-path=/usr 
--rocm-device-lib-path=/usr/lib/x86_64-linux-gnu/amdgcn/bitcode" \
        HIPCXX=clang++-15 cmake -S. -Bbuild --debug-output \
        -DCMAKE_LIBRARY_ARCHITECTURE=x86_64-linux-gnu
    Running with debug output on.
    -- The HIP compiler identification is Clang 15.0.7
       Called from: [3]     
/usr/share/cmake-3.25/Modules/CMakeDetermineCompilerId.cmake
                    [2]     
/usr/share/cmake-3.25/Modules/CMakeDetermineHIPCompiler.cmake
                    [1]     /root/CMakeLists.txt
    CMake Error at 
/usr/share/cmake-3.25/Modules/CMakeDetermineHIPCompiler.cmake:106 (message):
      The ROCm root directory:
    
       /usr
    
      does not contain the HIP runtime CMake package, expected at:
    
       /usr/lib/cmake/hip-lang/hip-lang-config.cmake
    
    Call Stack (most recent call first):
      CMakeLists.txt:2 (project)
    
    
       Called from: [2]     
/usr/share/cmake-3.25/Modules/CMakeDetermineHIPCompiler.cmake
                    [1]     /root/CMakeLists.txt
    -- Configuring incomplete, errors occurred!

This error is because when provided as part of the libamdhip64-dev
package, the HIP runtime CMake package is installed to
/usr/lib/$(DEB_HOST_MULTIARCH)/cmake/hip-lang/hip-lang-config.cmake
CMake should probably check both locations to ensure compatibility with
the layout of both the upstream ROCm project and the Debian HIP package.

In total, this path appears in three places:

/usr/share/cmake-3.25/Modules/CMakeDetermineHIPCompiler.cmake:105
/usr/share/cmake-3.25/Modules/CMakeDetermineHIPCompiler.cmake:110
/usr/share/cmake-3.25/Modules/CMakeHIPInformation.cmake:145

Sincerely,
Cory Bloor

-- System Information:
Debian Release: bookworm/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 6.1.0-3-amd64 (SMP w/32 CPU threads; PREEMPT)
Locale: LANG=C, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: unable to detect

-- no debconf information

--- End Message ---
--- Begin Message ---
Source: cmake
Source-Version: 3.26.4-3
Done: Timo Röhling <[email protected]>

We believe that the bug you reported is fixed in the latest version of
cmake, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Timo Röhling <[email protected]> (supplier of updated cmake package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Fri, 02 Jun 2023 22:32:20 +0200
Source: cmake
Architecture: source
Version: 3.26.4-3
Distribution: experimental
Urgency: medium
Maintainer: Debian CMake Team <[email protected]>
Changed-By: Timo Röhling <[email protected]>
Closes: 1031799
Changes:
 cmake (3.26.4-3) experimental; urgency=medium
 .
   [ Cordell Bloor ]
   * Fix HIP language integration (Closes: #1031799)
Checksums-Sha1:
 88d46d24ea1db51ffc76c9d094ff675342af3cc8 3886 cmake_3.26.4-3.dsc
 54e37f2c6a6905ec91b20582e3d2f8d414e43aaa 35172 cmake_3.26.4-3.debian.tar.xz
 6b7e03e8b83c6026d5fb50e9dc88a54e07b192f8 13587 cmake_3.26.4-3_amd64.buildinfo
Checksums-Sha256:
 dae9d163ceee4cc61d9a36c7a2c1165d6ae6809f76e9760d53630b4449f9c703 3886 
cmake_3.26.4-3.dsc
 ad58f20a3f6e0de3a036c927863e98f7d86876101adfca2869046f10c0318c72 35172 
cmake_3.26.4-3.debian.tar.xz
 c66c989f3343df29f5983c2906a7ae4b810acb249c9c8ca46181a67284510572 13587 
cmake_3.26.4-3_amd64.buildinfo
Files:
 01aa6d5b302986abef8efa7bd00cb53d 3886 devel optional cmake_3.26.4-3.dsc
 7b8806e158a42f250e4aef42be4c9b3a 35172 devel optional 
cmake_3.26.4-3.debian.tar.xz
 a92a328b7b5bfa7f794e5554c90d4698 13587 devel optional 
cmake_3.26.4-3_amd64.buildinfo

-----BEGIN PGP SIGNATURE-----

iQHIBAEBCgAyFiEEJvtDgpxjkjCIVtam+C8H+466LVkFAmR6WTIUHHJvZWhsaW5n
QGRlYmlhbi5vcmcACgkQ+C8H+466LVkYuQwAxDfDaZOzuFapfXzy15xHtHxhNXyS
7aBhZVQ/JSY5Z6Zp3zkNMn9ixh5BZlkWYTm2C/gb6Z2SaQlBijohdIUbZ0JZcpxF
s/adB1IdpXve2Lp1qjAO1O4NSLmPS4qJKNyHYXb2//C5A92Gnf5tidWiTYMr8Rzi
PiukfwMqkpMGNxWmq8okVDduITks5zb/1vH9kBPNgkSierknSCMNjHY+gD9TU0PU
7yvqmJ++kXXEE6dpSpMUTOp2+OPWlez0HfUnkBKhX6euc9ibJhrjl30WRX7wuuiH
g4PZWA9DurSf4pTSFo8cOCLuJVI/l81zKLK0H0Tf4H1WAR7rTc5XaJGANccD6zXy
8onBf3FxbsHtEDCbKoqiW10jVu9lBjrdGoseTpD1bAEShv8+MektXUv3cV0AASV7
rJkwK8FzpKOGagEdqltk6OUqoDl47JegmLbFZ7qFFC6Pzfc9HTZkrfTp0YVr721c
M4XVAF3NRGcyxl+d+2DYtd+2KggzOyYObShA
=Sm0t
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to