You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to ensure that Hipfort works with an nvidia backend. However when I try to install hipfort-6.0.2 the CMAKE configuration fails when I set HIP_PLATFORM="nvidia".
I have an RTX 3060 and CUDA 12.4 installed via package manager and everything seems ok with the NVIDIA software stack.
Operating System
Ubuntu 22.04.4 LTS (Jammy Jellyfish)
CPU
AMD Ryzen 7 6800H
GPU
RTX 3060
ROCm Version
ROCm 6.0.2
ROCm Component
hipfort
Steps to Reproduce
Install NVIDIA driver (Driver 550 installed)
Install rocm 6.0.2 using amdgpu-install
Install the hip-runtime-nvidia package (CUDA 12.4 installed, and I have an RTX 3060 with working drivers)
I then get numerous configuration errors to say that another target already exists.
CMake Error at /opt/rocm-6.0.2/lib/cmake/hip/hip-config-nvidia.cmake:21 (add_library):
add_library cannot create imported target "hip::device" because another
target with the same name already exists.
Call Stack (most recent call first):
/opt/rocm-6.0.2/lib/cmake/hip/hip-config.cmake:153 (include)
/usr/share/cmake-3.22/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
/opt/rocm-6.0.2/lib/cmake/rocblas/rocblas-config.cmake:90 (find_dependency)
lib/CMakeLists.txt:126 (find_package)
CMake Error at /opt/rocm-6.0.2/lib/cmake/hip/hip-config-nvidia.cmake:22 (add_library):
add_library cannot create imported target "hip::host" because another
target with the same name already exists.
Call Stack (most recent call first):
/opt/rocm-6.0.2/lib/cmake/hip/hip-config.cmake:153 (include)
/usr/share/cmake-3.22/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
/opt/rocm-6.0.2/lib/cmake/rocblas/rocblas-config.cmake:90 (find_dependency)
lib/CMakeLists.txt:126 (find_package)
CMake Error at /opt/rocm-6.0.2/lib/cmake/hip/hip-config-nvidia.cmake:23 (add_library):
add_library cannot create imported target "hip::amdhip64" because another
target with the same name already exists.
Call Stack (most recent call first):
/opt/rocm-6.0.2/lib/cmake/hip/hip-config.cmake:153 (include)
/usr/share/cmake-3.22/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
/opt/rocm-6.0.2/lib/cmake/rocblas/rocblas-config.cmake:90 (find_dependency)
lib/CMakeLists.txt:126 (find_package)
CMake Error at /opt/rocm-6.0.2/lib/cmake/hip/hip-config-nvidia.cmake:21 (add_library):
add_library cannot create imported target "hip::device" because another
target with the same name already exists.
Call Stack (most recent call first):
/opt/rocm-6.0.2/lib/cmake/hip/hip-config.cmake:153 (include)
/usr/share/cmake-3.22/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
/opt/rocm-6.0.2/lib/cmake/hipblas/hipblas-config.cmake:90 (find_dependency)
lib/CMakeLists.txt:133 (find_package)
CMake Error at /opt/rocm-6.0.2/lib/cmake/hip/hip-config-nvidia.cmake:22 (add_library):
add_library cannot create imported target "hip::host" because another
target with the same name already exists.
Call Stack (most recent call first):
/opt/rocm-6.0.2/lib/cmake/hip/hip-config.cmake:153 (include)
/usr/share/cmake-3.22/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
/opt/rocm-6.0.2/lib/cmake/hipblas/hipblas-config.cmake:90 (find_dependency)
lib/CMakeLists.txt:133 (find_package)
CMake Error at /opt/rocm-6.0.2/lib/cmake/hip/hip-config-nvidia.cmake:23 (add_library):
add_library cannot create imported target "hip::amdhip64" because another
target with the same name already exists.
Call Stack (most recent call first):
/opt/rocm-6.0.2/lib/cmake/hip/hip-config.cmake:153 (include)
/usr/share/cmake-3.22/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
/opt/rocm-6.0.2/lib/cmake/hipblas/hipblas-config.cmake:90 (find_dependency)
lib/CMakeLists.txt:133 (find_package)
CMake Error at /opt/rocm-6.0.2/lib/cmake/hip/hip-config-nvidia.cmake:21 (add_library):
add_library cannot create imported target "hip::device" because another
target with the same name already exists.
Call Stack (most recent call first):
/opt/rocm-6.0.2/lib/cmake/hip/hip-config.cmake:153 (include)
/usr/share/cmake-3.22/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
/opt/rocm-6.0.2/lib/cmake/rocfft/rocfft-config.cmake:90 (find_dependency)
lib/CMakeLists.txt:140 (find_package)
CMake Error at /opt/rocm-6.0.2/lib/cmake/hip/hip-config-nvidia.cmake:22 (add_library):
add_library cannot create imported target "hip::host" because another
target with the same name already exists.
Call Stack (most recent call first):
/opt/rocm-6.0.2/lib/cmake/hip/hip-config.cmake:153 (include)
/usr/share/cmake-3.22/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
/opt/rocm-6.0.2/lib/cmake/rocfft/rocfft-config.cmake:90 (find_dependency)
lib/CMakeLists.txt:140 (find_package)
CMake Error at /opt/rocm-6.0.2/lib/cmake/hip/hip-config-nvidia.cmake:23 (add_library):
add_library cannot create imported target "hip::amdhip64" because another
target with the same name already exists.
Call Stack (most recent call first):
/opt/rocm-6.0.2/lib/cmake/hip/hip-config.cmake:153 (include)
/usr/share/cmake-3.22/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
/opt/rocm-6.0.2/lib/cmake/rocfft/rocfft-config.cmake:90 (find_dependency)
lib/CMakeLists.txt:140 (find_package)
CMake Error at /opt/rocm-6.0.2/lib/cmake/hip/hip-config-nvidia.cmake:21 (add_library):
add_library cannot create imported target "hip::device" because another
target with the same name already exists.
Call Stack (most recent call first):
/opt/rocm-6.0.2/lib/cmake/hip/hip-config.cmake:153 (include)
/usr/share/cmake-3.22/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
/opt/rocm-6.0.2/lib/cmake/hipfft/hipfft-config.cmake:90 (find_dependency)
lib/CMakeLists.txt:147 (find_package)
CMake Error at /opt/rocm-6.0.2/lib/cmake/hip/hip-config-nvidia.cmake:22 (add_library):
add_library cannot create imported target "hip::host" because another
target with the same name already exists.
Call Stack (most recent call first):
/opt/rocm-6.0.2/lib/cmake/hip/hip-config.cmake:153 (include)
/usr/share/cmake-3.22/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
/opt/rocm-6.0.2/lib/cmake/hipfft/hipfft-config.cmake:90 (find_dependency)
lib/CMakeLists.txt:147 (find_package)
CMake Error at /opt/rocm-6.0.2/lib/cmake/hip/hip-config-nvidia.cmake:23 (add_library):
add_library cannot create imported target "hip::amdhip64" because another
target with the same name already exists.
Call Stack (most recent call first):
/opt/rocm-6.0.2/lib/cmake/hip/hip-config.cmake:153 (include)
/usr/share/cmake-3.22/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
/opt/rocm-6.0.2/lib/cmake/hipfft/hipfft-config.cmake:90 (find_dependency)
lib/CMakeLists.txt:147 (find_package)
CMake Error at /opt/rocm-6.0.2/lib/cmake/hip/hip-config-nvidia.cmake:21 (add_library):
add_library cannot create imported target "hip::device" because another
target with the same name already exists.
Call Stack (most recent call first):
/opt/rocm-6.0.2/lib/cmake/hip/hip-config.cmake:153 (include)
/usr/share/cmake-3.22/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
/opt/rocm-6.0.2/lib/cmake/rocrand/rocrand-config.cmake:90 (find_dependency)
lib/CMakeLists.txt:154 (find_package)
CMake Error at /opt/rocm-6.0.2/lib/cmake/hip/hip-config-nvidia.cmake:22 (add_library):
add_library cannot create imported target "hip::host" because another
target with the same name already exists.
Call Stack (most recent call first):
/opt/rocm-6.0.2/lib/cmake/hip/hip-config.cmake:153 (include)
/usr/share/cmake-3.22/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
/opt/rocm-6.0.2/lib/cmake/rocrand/rocrand-config.cmake:90 (find_dependency)
lib/CMakeLists.txt:154 (find_package)
CMake Error at /opt/rocm-6.0.2/lib/cmake/hip/hip-config-nvidia.cmake:23 (add_library):
add_library cannot create imported target "hip::amdhip64" because another
target with the same name already exists.
Call Stack (most recent call first):
/opt/rocm-6.0.2/lib/cmake/hip/hip-config.cmake:153 (include)
/usr/share/cmake-3.22/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
/opt/rocm-6.0.2/lib/cmake/rocrand/rocrand-config.cmake:90 (find_dependency)
lib/CMakeLists.txt:154 (find_package)
CMake Error at /opt/rocm-6.0.2/lib/cmake/hip/hip-config-nvidia.cmake:21 (add_library):
add_library cannot create imported target "hip::device" because another
target with the same name already exists.
Call Stack (most recent call first):
/opt/rocm-6.0.2/lib/cmake/hip/hip-config.cmake:153 (include)
/usr/share/cmake-3.22/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
/opt/rocm-6.0.2/lib/cmake/hiprand/hiprand-config.cmake:90 (find_dependency)
lib/CMakeLists.txt:161 (find_package)
CMake Error at /opt/rocm-6.0.2/lib/cmake/hip/hip-config-nvidia.cmake:22 (add_library):
add_library cannot create imported target "hip::host" because another
target with the same name already exists.
Call Stack (most recent call first):
/opt/rocm-6.0.2/lib/cmake/hip/hip-config.cmake:153 (include)
/usr/share/cmake-3.22/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
/opt/rocm-6.0.2/lib/cmake/hiprand/hiprand-config.cmake:90 (find_dependency)
lib/CMakeLists.txt:161 (find_package)
CMake Error at /opt/rocm-6.0.2/lib/cmake/hip/hip-config-nvidia.cmake:23 (add_library):
add_library cannot create imported target "hip::amdhip64" because another
target with the same name already exists.
Call Stack (most recent call first):
/opt/rocm-6.0.2/lib/cmake/hip/hip-config.cmake:153 (include)
/usr/share/cmake-3.22/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
/opt/rocm-6.0.2/lib/cmake/hiprand/hiprand-config.cmake:90 (find_dependency)
lib/CMakeLists.txt:161 (find_package)
CMake Error at /opt/rocm-6.0.2/lib/cmake/hip/hip-config-nvidia.cmake:21 (add_library):
add_library cannot create imported target "hip::device" because another
target with the same name already exists.
Call Stack (most recent call first):
/opt/rocm-6.0.2/lib/cmake/hip/hip-config.cmake:153 (include)
/usr/share/cmake-3.22/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
/opt/rocm-6.0.2/lib/cmake/rocsolver/rocsolver-config.cmake:90 (find_dependency)
lib/CMakeLists.txt:168 (find_package)
CMake Error at /opt/rocm-6.0.2/lib/cmake/hip/hip-config-nvidia.cmake:22 (add_library):
add_library cannot create imported target "hip::host" because another
target with the same name already exists.
Call Stack (most recent call first):
/opt/rocm-6.0.2/lib/cmake/hip/hip-config.cmake:153 (include)
/usr/share/cmake-3.22/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
/opt/rocm-6.0.2/lib/cmake/rocsolver/rocsolver-config.cmake:90 (find_dependency)
lib/CMakeLists.txt:168 (find_package)
CMake Error at /opt/rocm-6.0.2/lib/cmake/hip/hip-config-nvidia.cmake:23 (add_library):
add_library cannot create imported target "hip::amdhip64" because another
target with the same name already exists.
Call Stack (most recent call first):
/opt/rocm-6.0.2/lib/cmake/hip/hip-config.cmake:153 (include)
/usr/share/cmake-3.22/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
/opt/rocm-6.0.2/lib/cmake/rocsolver/rocsolver-config.cmake:90 (find_dependency)
lib/CMakeLists.txt:168 (find_package)
CMake Error at /opt/rocm-6.0.2/lib/cmake/hip/hip-config-nvidia.cmake:21 (add_library):
add_library cannot create imported target "hip::device" because another
target with the same name already exists.
Call Stack (most recent call first):
/opt/rocm-6.0.2/lib/cmake/hip/hip-config.cmake:153 (include)
/usr/share/cmake-3.22/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
/opt/rocm-6.0.2/lib/cmake/rocblas/rocblas-config.cmake:90 (find_dependency)
/usr/share/cmake-3.22/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
/opt/rocm-6.0.2/lib/cmake/rocsolver/rocsolver-config.cmake:92 (find_dependency)
lib/CMakeLists.txt:168 (find_package)
CMake Error at /opt/rocm-6.0.2/lib/cmake/hip/hip-config-nvidia.cmake:22 (add_library):
add_library cannot create imported target "hip::host" because another
target with the same name already exists.
Call Stack (most recent call first):
/opt/rocm-6.0.2/lib/cmake/hip/hip-config.cmake:153 (include)
/usr/share/cmake-3.22/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
/opt/rocm-6.0.2/lib/cmake/rocblas/rocblas-config.cmake:90 (find_dependency)
/usr/share/cmake-3.22/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
/opt/rocm-6.0.2/lib/cmake/rocsolver/rocsolver-config.cmake:92 (find_dependency)
lib/CMakeLists.txt:168 (find_package)
CMake Error at /opt/rocm-6.0.2/lib/cmake/hip/hip-config-nvidia.cmake:23 (add_library):
add_library cannot create imported target "hip::amdhip64" because another
target with the same name already exists.
Call Stack (most recent call first):
/opt/rocm-6.0.2/lib/cmake/hip/hip-config.cmake:153 (include)
/usr/share/cmake-3.22/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
/opt/rocm-6.0.2/lib/cmake/rocblas/rocblas-config.cmake:90 (find_dependency)
/usr/share/cmake-3.22/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
/opt/rocm-6.0.2/lib/cmake/rocsolver/rocsolver-config.cmake:92 (find_dependency)
lib/CMakeLists.txt:168 (find_package)
CMake Error at /opt/rocm-6.0.2/lib/cmake/hip/hip-config-nvidia.cmake:21 (add_library):
add_library cannot create imported target "hip::device" because another
target with the same name already exists.
Call Stack (most recent call first):
/opt/rocm-6.0.2/lib/cmake/hip/hip-config.cmake:153 (include)
/usr/share/cmake-3.22/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
/opt/rocm-6.0.2/lib/cmake/hipsolver/hipsolver-config.cmake:90 (find_dependency)
lib/CMakeLists.txt:175 (find_package)
CMake Error at /opt/rocm-6.0.2/lib/cmake/hip/hip-config-nvidia.cmake:22 (add_library):
add_library cannot create imported target "hip::host" because another
target with the same name already exists.
Call Stack (most recent call first):
/opt/rocm-6.0.2/lib/cmake/hip/hip-config.cmake:153 (include)
/usr/share/cmake-3.22/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
/opt/rocm-6.0.2/lib/cmake/hipsolver/hipsolver-config.cmake:90 (find_dependency)
lib/CMakeLists.txt:175 (find_package)
CMake Error at /opt/rocm-6.0.2/lib/cmake/hip/hip-config-nvidia.cmake:23 (add_library):
add_library cannot create imported target "hip::amdhip64" because another
target with the same name already exists.
Call Stack (most recent call first):
/opt/rocm-6.0.2/lib/cmake/hip/hip-config.cmake:153 (include)
/usr/share/cmake-3.22/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
/opt/rocm-6.0.2/lib/cmake/hipsolver/hipsolver-config.cmake:90 (find_dependency)
lib/CMakeLists.txt:175 (find_package)
CMake Error at /opt/rocm-6.0.2/lib/cmake/hip/hip-config-nvidia.cmake:21 (add_library):
add_library cannot create imported target "hip::device" because another
target with the same name already exists.
Call Stack (most recent call first):
/opt/rocm-6.0.2/lib/cmake/hip/hip-config.cmake:153 (include)
/usr/share/cmake-3.22/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
/opt/rocm-6.0.2/lib/cmake/rocsparse/rocsparse-config.cmake:90 (find_dependency)
lib/CMakeLists.txt:182 (find_package)
CMake Error at /opt/rocm-6.0.2/lib/cmake/hip/hip-config-nvidia.cmake:22 (add_library):
add_library cannot create imported target "hip::host" because another
target with the same name already exists.
Call Stack (most recent call first):
/opt/rocm-6.0.2/lib/cmake/hip/hip-config.cmake:153 (include)
/usr/share/cmake-3.22/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
/opt/rocm-6.0.2/lib/cmake/rocsparse/rocsparse-config.cmake:90 (find_dependency)
lib/CMakeLists.txt:182 (find_package)
CMake Error at /opt/rocm-6.0.2/lib/cmake/hip/hip-config-nvidia.cmake:23 (add_library):
add_library cannot create imported target "hip::amdhip64" because another
target with the same name already exists.
Call Stack (most recent call first):
/opt/rocm-6.0.2/lib/cmake/hip/hip-config.cmake:153 (include)
/usr/share/cmake-3.22/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
/opt/rocm-6.0.2/lib/cmake/rocsparse/rocsparse-config.cmake:90 (find_dependency)
lib/CMakeLists.txt:182 (find_package)
CMake Error at /opt/rocm-6.0.2/lib/cmake/hip/hip-config-nvidia.cmake:21 (add_library):
add_library cannot create imported target "hip::device" because another
target with the same name already exists.
Call Stack (most recent call first):
/opt/rocm-6.0.2/lib/cmake/hip/hip-config.cmake:153 (include)
/usr/share/cmake-3.22/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
/opt/rocm-6.0.2/lib/cmake/hipsparse/hipsparse-config.cmake:90 (find_dependency)
lib/CMakeLists.txt:189 (find_package)
CMake Error at /opt/rocm-6.0.2/lib/cmake/hip/hip-config-nvidia.cmake:22 (add_library):
add_library cannot create imported target "hip::host" because another
target with the same name already exists.
Call Stack (most recent call first):
/opt/rocm-6.0.2/lib/cmake/hip/hip-config.cmake:153 (include)
/usr/share/cmake-3.22/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
/opt/rocm-6.0.2/lib/cmake/hipsparse/hipsparse-config.cmake:90 (find_dependency)
lib/CMakeLists.txt:189 (find_package)
CMake Error at /opt/rocm-6.0.2/lib/cmake/hip/hip-config-nvidia.cmake:23 (add_library):
add_library cannot create imported target "hip::amdhip64" because another
target with the same name already exists.
Call Stack (most recent call first):
/opt/rocm-6.0.2/lib/cmake/hip/hip-config.cmake:153 (include)
/usr/share/cmake-3.22/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
/opt/rocm-6.0.2/lib/cmake/hipsparse/hipsparse-config.cmake:90 (find_dependency)
lib/CMakeLists.txt:189 (find_package)
(Optional for Linux users) Output of /opt/rocm/bin/rocminfo --support
No response
Additional Information
Environment variables
HIP_PLATFORM="nvidia"
The text was updated successfully, but these errors were encountered:
I think the issue is that the hipFORT build process is broken when hipconfig is set to the NVIDIA platform. I haven't used the hipFORT NVIDIA backend myself (yet), but my understanding is that when you build hipFORT, it actually builds for both the AMD and NVIDIA platforms (even when the hipconfig platform is amd).
At the very least, we could detect this situation and print a useful error message. I think that would be a useful improvement for the hipfort build scripts. Although, it would be better if hipfort could build with hipconfig in either mode. I think that should be possible.
For now, I believe that you need to specify the platform as NVIDIA when building projects that use hipFORT rather than when you're building hipFORT itself.
Yes that's quite correct! Could we please add a sentence to the documentation to say that you don't have to build hipfort this way in order to use the NVIDIA backend. It would save a bit of time for other folks.
Furthermore, while using CMAKE I found that specifying the HIP language in a project description seems to make compilation very unfriendly to an NVIDIA backend. In such cases I removed the HIP language, set the environment variable CXX to hipcc, HIP_PLATFORM to nvidia, and appended "-lcudart" to CMAKE_EXE_LINKER_FLAGS, like this.
if (DEFINEDENV{HIP_PLATFORM})
if ($ENV{HIP_PLATFORM}STREQUAL"nvidia")
message("Setting variables for nvidia")
set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lcudart")
endif()
endif()
Problem Description
I need to ensure that Hipfort works with an nvidia backend. However when I try to install hipfort-6.0.2 the CMAKE configuration fails when I set HIP_PLATFORM="nvidia".
I have an RTX 3060 and CUDA 12.4 installed via package manager and everything seems ok with the NVIDIA software stack.
Operating System
Ubuntu 22.04.4 LTS (Jammy Jellyfish)
CPU
AMD Ryzen 7 6800H
GPU
RTX 3060
ROCm Version
ROCm 6.0.2
ROCm Component
hipfort
Steps to Reproduce
Run the following script from the build directory
I then get numerous configuration errors to say that another target already exists.
(Optional for Linux users) Output of /opt/rocm/bin/rocminfo --support
No response
Additional Information
Environment variables
HIP_PLATFORM="nvidia"
The text was updated successfully, but these errors were encountered: