Skip to content

building examples with CUDA on RTX 4070 #280

Description

@nibblelab

Hi,

I'm trying to compile the lib examples with CUDA 12 over an RTX 4070 GPU, but I'm having this error:

[ 36%] Building NVCC (Device) object examples/CMakeFiles/solver_cuda.dir/solver_cuda_generated_solver.cu.o
nvcc fatal   : Unsupported gpu architecture 'compute_30'
CMake Error at solver_cuda_generated_solver.cu.o.RelWithDebInfo.cmake:220 (message):
  Error generating
  /home/johnatas/MFLab/Code/amgcl/build/examples/CMakeFiles/solver_cuda.dir//./solver_cuda_generated_solver.cu.o

The GPU supported architectures are:

$ nvcc --list-gpu-arch
compute_50
compute_52
compute_53
compute_60
compute_61
compute_62
compute_70
compute_72
compute_75
compute_80
compute_86
compute_87
compute_89
compute_90

If I change the CMakeLists.txt to choose the architecture from the GPU itself by modifying

cuda_select_nvcc_arch_flags(CUDA_ARCH_FLAGS ${CUDA_TARGET_ARCH}) 

to

cuda_select_nvcc_arch_flags(CUDA_ARCH_FLAGS Auto) 

It will select a supported architecture, and compile the solver_cuda module (with some warnings) but the overall compiling will fail thanks to a series of compilation errors like:

[ 37%] Linking CXX executable solver_cuda
[ 37%] Built target solver_cuda
[ 38%] Building NVCC (Device) object examples/CMakeFiles/schur_pressure_correction_cuda.dir/schur_pressure_correction_cuda_generated_schur_pressure_correction.cu.o
...
avx512fp16intrin.h(101): error: more than one conversion function from "__half" to "<error-type>" applies
...
avx512fp16intrin.h(3187): error: return value type does not match the function type
...

How can I fix this to compile amgcl examples with CUDA 12?

My system settings:

  • Ubuntu 24.04 LTS
  • GCC 12.2
  • CUDA 12.0 - RTX 4070
  • Cmake 3.27.1
  • Boost 1.81.0
  • OpenMPI 4.1.5
  • Eigen3 3.4.0
  • Hwloc 2.9.0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions