Git Product home page Git Product logo

Comments (3)

jngrad avatar jngrad commented on June 20, 2024

Compatible toolchains to build C++ and CUDA code in Ubuntu noble:

  • GCC 10.5.0 with NVCC 12.0
  • GCC 11.4.0 with NVCC 12.0
  • GCC 12.3.0 with NVCC 12.0
  • GCC 13.2.0 with NVCC 12.0
  • Clang 14.0.6 with NVCC 12.0
  • Clang 17.0.6 for both C++ and CUDA code

from espresso.

jngrad avatar jngrad commented on June 20, 2024

When using Clang as the CUDA compiler, extra steps need to be taken when running the initial CMake configuration.

CMake cannot automatically detect default architectures:

CMake Error at /usr/share/cmake-3.27/Modules/CMakeDetermineCUDACompiler.cmake:603 (message):
  Failed to detect a default CUDA architecture.

  Compiler output:

Solution: add -D CMAKE_CUDA_ARCHITECTURES="61;75" to the CMake command to specify which architectures to build for.

CMake fails to execute enable_language(CUDA):

CMake Error at /usr/share/cmake-3.27/Modules/CMakeDetermineCompilerABI.cmake:57 (try_compile):
  Failed to generate test project build system.

Solution: only Clang 17 and Clang 18 are compatible with CUDA 12. Use for example CUDACXX=clang++-17.

Here is a minimal CMake configuration with Clang:

CC=clang-17 CXX=clang++-17 CUDACXX=clang++-17 /usr/bin/cmake .. \
    -D CMAKE_CUDA_ARCHITECTURES="61;75" -D CUDAToolkit_ROOT="/usr/lib/cuda"

A compiler warning will be generated during the build:

clang++-17: warning: CUDA version 12.0 is only partially supported [-Wunknown-cuda-version]

from espresso.

jngrad avatar jngrad commented on June 20, 2024

For GCC 13.2.0, one has to silence a compiler error with -D CMAKE_CUDA_FLAGS=-allow-unsupported-compiler. When compiled with this flag, the main GPU algorithms in ESPResSo (P3M, DDS, LB) still work as expected.

from espresso.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.