ROCm / HIP

HIP: C++ Heterogeneous-Compute Interface for Portability
https://rocmdocs.amd.com/projects/HIP/
MIT License
3.54k stars 518 forks source link

[Issue]: Could not find a configuration file for package "HIP" - requested 1.0, found 6.0.0 #3520

Closed zedr closed 3 weeks ago

zedr commented 3 weeks ago

Problem Description

I cannot build pytorch from source using Fedora 40's supplied version of ROCM.

Building PyTorch for GPU arch: gfx1030
CMake Warning at cmake/public/LoadHIP.cmake:36 (find_package):
  Could not find a configuration file for package "HIP" that is compatible
  with requested version "1.0".

  The following configuration files were considered but not accepted:

    /usr/lib64/cmake/hip/hip-config.cmake, version: 6.0.0
    /lib64/cmake/hip/hip-config.cmake, version: 6.0.0

Call Stack (most recent call first):
  cmake/public/LoadHIP.cmake:41 (find_package_and_print_version)
  cmake/Dependencies.cmake:1258 (include)
  CMakeLists.txt:754 (include)

The same problem occurs both on the latest main and v2.3.0.

Package versions:

hsakmt-1.0.6-38.rocm6.0.0.fc40.x86_64
hsakmt-devel-1.0.6-38.rocm6.0.0.fc40.x86_64
rocm-clinfo-6.0.2-2.fc40.x86_64
rocm-cmake-6.0.2-1.fc40.noarch
rocm-comgr-17.1-5.fc40.x86_64
rocm-comgr-devel-17.1-5.fc40.x86_64
rocm-core-6.0.2-1.fc40.x86_64
rocm-core-devel-6.0.2-1.fc40.x86_64
rocm-dbgapi-0.71.0.60100-82.el9.x86_64
rocm-debug-agent-2.0.3.60100-82.el9.x86_64
rocm-device-libs-17.2-3.fc40.x86_64
rocm-gdb-14.1.60100-82.el9.x86_64
rocm-hip-6.0.2-2.fc40.x86_64
rocm-hip-devel-6.0.2-2.fc40.x86_64
rocminfo-6.0.2-2.fc40.x86_64
rocm-llvm-17.0.0.24103.60100-82.el9.x86_64
rocm-opencl-6.0.2-2.fc40.x86_64
rocm-opencl-devel-6.0.2-2.fc40.x86_64
rocm-opencl-icd-loader-1.2.60100-82.el9.x86_64
rocm-rpm-macros-1.0-11.fc40.x86_64
rocm-rpm-macros-modules-1.0-11.fc40.x86_64
rocm-runtime-6.0.0-3.fc40.x86_64
rocm-runtime-devel-6.0.0-3.fc40.x86_64
rocm-smi-6.0.2-1.fc40.x86_64
rocm-smi-devel-6.0.2-1.fc40.x86_64
rocm-smi-lib-7.0.0.60100-82.el9.x86_64

Generated output:

-- ******** Summary ********
-- General:
--   CMake version         : 3.28.2
--   CMake command         : /usr/bin/cmake
--   System                : Linux
--   C++ compiler          : /usr/bin/c++
--   C++ compiler id       : GNU
--   C++ compiler version  : 14.0.1
--   Using ccache if found : ON
--   Found ccache          : /usr/bin/ccache
--   CXX flags             :  -D_GLIBCXX_USE_CXX11_ABI=1 -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -DNDEBUG -DUSE_KINETO -DLIBKINETO_NOCUPTI -DLIBKINETO_NOROCTRACER -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -O2 -fPIC -Wall -Wextra -Werror=return-type -Werror=non-virtual-dtor -Werror=range-loop-construct -Werror=bool-operation -Wnarrowing -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-unused-parameter -Wno-unused-function -Wno-unused-result -Wno-strict-overflow -Wno-strict-aliasing -Wno-stringop-overflow -Wsuggest-override -Wno-psabi -Wno-error=pedantic -Wno-error=old-style-cast -Wno-missing-braces -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Wno-stringop-overflow
--   Build type            : Release
--   Compile definitions   : ONNX_ML=1;ONNXIFI_ENABLE_EXT=1;ONNX_NAMESPACE=onnx_torch;HAVE_MMAP=1;_FILE_OFFSET_BITS=64;HAVE_SHM_OPEN=1;HAVE_SHM_UNLINK=1;HAVE_MALLOC_USABLE_SIZE=1;USE_EXTERNAL_MZCRC;MINIZ_DISABLE_ZIP_READER_CRC32_CHECKS;FLASHATTENTION_DISABLE_ALIBI
--   CMAKE_PREFIX_PATH     : /home/zedr/src/pytorch/.env/lib/python3.9/site-packages
--   CMAKE_INSTALL_PREFIX  : /home/zedr/src/pytorch/torch
--   USE_GOLD_LINKER       : OFF
-- 
--   TORCH_VERSION         : 2.3.0
--   BUILD_CAFFE2          : OFF
--   BUILD_CAFFE2_OPS      : OFF
--   BUILD_STATIC_RUNTIME_BENCHMARK: OFF
--   BUILD_BINARY          : OFF
--   BUILD_CUSTOM_PROTOBUF : ON
--     Link local protobuf : ON
--   BUILD_DOCS            : OFF
--   BUILD_PYTHON          : True
--     Python version      : 3.9.19
--     Python executable   : /home/zedr/src/pytorch/.env/bin/python
--     Pythonlibs version  : 3.9.19
--     Python library      : /usr/lib64/libpython3.9.so.1.0
--     Python includes     : /usr/include/python3.9
--     Python site-packages: lib/python3.9/site-packages
--   BUILD_SHARED_LIBS     : ON
--   CAFFE2_USE_MSVC_STATIC_RUNTIME     : OFF
--   BUILD_TEST            : True
--   BUILD_JNI             : OFF
--   BUILD_MOBILE_AUTOGRAD : OFF
--   BUILD_LITE_INTERPRETER: OFF
--   INTERN_BUILD_MOBILE   : 
--   TRACING_BASED         : OFF
--   USE_BLAS              : 1
--     BLAS                : open
--     BLAS_HAS_SBGEMM     : 
--   USE_LAPACK            : 1
--     LAPACK              : open
--   USE_ASAN              : OFF
--   USE_TSAN              : OFF
--   USE_CPP_CODE_COVERAGE : OFF
--   USE_CUDA              : OFF
--   USE_XPU               : OFF
--   USE_ROCM              : OFF
--   BUILD_NVFUSER         : 
--   USE_EIGEN_FOR_BLAS    : ON
--   USE_FBGEMM            : ON
--     USE_FAKELOWP          : OFF
--   USE_KINETO            : ON
--   USE_FFMPEG            : OFF
--   USE_GFLAGS            : OFF
--   USE_GLOG              : OFF
--   USE_LEVELDB           : OFF
--   USE_LITE_PROTO        : OFF
--   USE_LMDB              : OFF
--   USE_METAL             : OFF
--   USE_PYTORCH_METAL     : OFF
--   USE_PYTORCH_METAL_EXPORT     : OFF
--   USE_MPS               : OFF
--   USE_MKL               : OFF
--   USE_MKLDNN            : ON
--   USE_MKLDNN_ACL        : OFF
--   USE_MKLDNN_CBLAS      : OFF
--   USE_UCC               : OFF
--   USE_ITT               : ON
--   USE_NCCL              : OFF
--   USE_NNPACK            : ON
--   USE_NUMPY             : ON
--   USE_OBSERVERS         : ON
--   USE_OPENCL            : OFF
--   USE_OPENCV            : OFF
--   USE_OPENMP            : ON
--   USE_TBB               : OFF
--   USE_MIMALLOC          : OFF
--   USE_VULKAN            : OFF
--   USE_PROF              : OFF
--   USE_QNNPACK           : ON
--   USE_PYTORCH_QNNPACK   : ON
--   USE_XNNPACK           : ON
--   USE_REDIS             : OFF
--   USE_ROCKSDB           : OFF
--   USE_ZMQ               : OFF
--   USE_DISTRIBUTED       : ON
--     USE_MPI               : OFF
--     USE_GLOO              : ON
--     USE_GLOO_WITH_OPENSSL : OFF
--     USE_TENSORPIPE        : ON
--   Public Dependencies  : 
--   Private Dependencies : Threads::Threads;pthreadpool;cpuinfo;qnnpack;pytorch_qnnpack;nnpack;XNNPACK;fbgemm;ittnotify;fp16;caffe2::openmp;tensorpipe;gloo;foxi_loader;rt;fmt::fmt-header-only;kineto;gcc_s;gcc;dl
--   Public CUDA Deps.    : 
--   Private CUDA Deps.   : 
--   USE_COREML_DELEGATE     : OFF
--   BUILD_LAZY_TS_BACKEND   : ON
--   USE_ROCM_KERNEL_ASSERT : OFF
-- Performing Test HAS_WMISSING_PROTOTYPES
-- Performing Test HAS_WMISSING_PROTOTYPES - Failed
-- Performing Test HAS_WERROR_MISSING_PROTOTYPES
-- Performing Test HAS_WERROR_MISSING_PROTOTYPES - Failed
-- Configuring done (29.8s)
-- Generating done (1.2s)

This is happening on a AMD Ryzen 7 PRO 6850U with Radeon Graphics (gfx1030).

pytorch with ROCM works on my machine when installing from pip: pip3 install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/rocm6.0

Operating System

Fedora release 40 (Forty)

CPU

AMD Ryzen 7 PRO 6850U with Radeon Graphics (family: 0x19, model: 0x44, stepping: 0x1)

GPU

AMD Radeon Pro W6800

ROCm Version

ROCm 6.0.0

ROCm Component

HIP

Steps to Reproduce

No response

(Optional for Linux users) Output of /opt/rocm/bin/rocminfo --support

No response

Additional Information

No response