Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMAKE_CUDA_ARCHITECTURES is not displayed in ccmake #2212

Open
SimeonEhrig opened this issue Dec 21, 2023 · 3 comments
Open

CMAKE_CUDA_ARCHITECTURES is not displayed in ccmake #2212

SimeonEhrig opened this issue Dec 21, 2023 · 3 comments

Comments

@SimeonEhrig
Copy link
Member

If I build alpaka with enabled CUDA backend, the variable CMAKE_CUDA_ARCHITECTURES will be not displayed in the build folder, if I use ccmake.

In a default CUDA CMake project, the variable is visible, if I use ccmake.

cmake_minimum_required(VERSION 3.19)

project(gpu_arch LANGUAGES CXX)

enable_language(CUDA)

add_executable(${CMAKE_PROJECT_NAME})
target_sources(${CMAKE_PROJECT_NAME}
    PRIVATE
    main.cu
)

I think, there is a bug in the alpaka CMake, which hides/deletes the variable.

@SimeonEhrig
Copy link
Member Author

cc @psychocoderHPC

@bernhardmgruber
Copy link
Member

bernhardmgruber commented Jan 4, 2024

When I configure in am empty build directory:

CXX=g++-12 cmake -DCMAKE_CUDA_COMPILER=nvcc -DCMAKE_CUDA_HOST_COMPILER=g++-12 -Dalpaka_ACC_GPU_CUDA_ENABLE=ON ..
ccmake .

I see:
image
Looks good to me regarding my workflow. I use cmake version 3.28.1 and nvcc 12.3.

@bernhardmgruber
Copy link
Member

Also works for your empty project:

bgruber@graviola:~/dev/tet/build$ cat ../main.cu 
bgruber@graviola:~/dev/tet/build$ cat ../CMakeLists.txt 
cmake_minimum_required(VERSION 3.19)

project(gpu_arch LANGUAGES CXX)

enable_language(CUDA)

add_executable(${CMAKE_PROJECT_NAME})
target_sources(${CMAKE_PROJECT_NAME}
    PRIVATE
    main.cu
)
bgruber@graviola:~/dev/tet/build$ rm -rf *
bgruber@graviola:~/dev/tet/build$ CXX=g++-12 cmake -DCMAKE_CUDA_COMPILER=nvcc -DCMAKE_CUDA_HOST_COMPILER=g++-12 ..
-- The CXX compiler identification is GNU 12.3.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++-12 - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The CUDA compiler identification is NVIDIA 12.3.107
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Check for working CUDA compiler: /usr/local/cuda/bin/nvcc - skipped
-- Detecting CUDA compile features
-- Detecting CUDA compile features - done
-- Configuring done (1.5s)
-- Generating done (0.0s)
-- Build files have been written to: /home/bgruber/dev/tet/build
bgruber@graviola:~/dev/tet/build$ ccmake .

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants