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

Bug#1031538: libamdhip64-dev: find_package(hip) requires additional packages



Package: libamdhip64-dev
Version: 5.2.3-4
Severity: normal
X-Debbugs-Cc: cgmb@slerp.xyz

Dear Maintainer,

The dependencies for libhipamd64-dev appear to be underspecified.

main.cpp:

    #include <hip/hip_runtime.h>
    #include <stdio.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;
    }

CMakeLists.txt:

    cmake_minimum_required(VERSION 3.22)
    project(example LANGUAGES CXX)
    
    find_package(hip REQUIRED)
    
    add_executable(ex main.cpp)
    target_link_libraries(ex hip::device)

Build log:

    # CXX=hipcc cmake -S. -Bbuild
    -- The CXX compiler identification is Clang 15.0.7
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Check for working CXX compiler: /usr/bin/hipcc - skipped
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    CMake Error at /usr/share/cmake-3.25/Modules/CMakeFindDependencyMacro.cmake:47 (find_package):
      By not providing "Findamd_comgr.cmake" in CMAKE_MODULE_PATH this project
      has asked CMake to find a package configuration file provided by
      "amd_comgr", but CMake did not find one.
    
      Could not find a package configuration file provided by "amd_comgr" with
      any of the following names:
    
        amd_comgrConfig.cmake
        amd_comgr-config.cmake
    
      Add the installation prefix of "amd_comgr" to CMAKE_PREFIX_PATH or set
      "amd_comgr_DIR" to a directory containing one of the above files.  If
      "amd_comgr" provides a separate development package or SDK, be sure it has
      been installed.
    Call Stack (most recent call first):
      /usr/lib/x86_64-linux-gnu/cmake/hip/hip-config.cmake:206 (find_dependency)
      CMakeLists.txt:4 (find_package)
    
    
    -- Configuring incomplete, errors occurred!

Build log after `apt install libamd-comgr-dev`:

    # CXX=hipcc cmake -S. -Bbuild
    -- The CXX compiler identification is Clang 15.0.7
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Check for working CXX compiler: /usr/bin/hipcc - skipped
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    CMake Error at /usr/share/cmake-3.25/Modules/CMakeFindDependencyMacro.cmake:47 (find_package):
      By not providing "Findhsa-runtime64.cmake" in CMAKE_MODULE_PATH this
      project has asked CMake to find a package configuration file provided by
      "hsa-runtime64", but CMake did not find one.
    
      Could not find a package configuration file provided by "hsa-runtime64"
      with any of the following names:
    
        hsa-runtime64Config.cmake
        hsa-runtime64-config.cmake
    
      Add the installation prefix of "hsa-runtime64" to CMAKE_PREFIX_PATH or set
      "hsa-runtime64_DIR" to a directory containing one of the above files.  If
      "hsa-runtime64" provides a separate development package or SDK, be sure it
      has been installed.
    Call Stack (most recent call first):
      /usr/lib/x86_64-linux-gnu/cmake/hip/hip-config.cmake:215 (find_dependency)
      CMakeLists.txt:4 (find_package)
    
    
    -- Configuring incomplete, errors occurred!

Build log after `apt install libhsa-runtime-dev`:

    # CXX=hipcc cmake -S. -Bbuild
    -- The CXX compiler identification is Clang 15.0.7
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Check for working CXX compiler: /usr/bin/hipcc - skipped
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
    -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
    -- Found Threads: TRUE
    -- hip::amdhip64 is SHARED_LIBRARY
    -- Performing Test HIP_CLANG_SUPPORTS_PARALLEL_JOBS
    -- Performing Test HIP_CLANG_SUPPORTS_PARALLEL_JOBS - Failed
    -- Configuring done
    -- Generating done

-- 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

Versions of packages libamdhip64-dev depends on:
ii  libamdhip64-5        5.2.3-4
ii  libhiprtc-builtins5  5.2.3-4

libamdhip64-dev recommends no packages.

libamdhip64-dev suggests no packages.

-- no debconf information


Reply to: