NVIDIA / NVIDIA/cuda-samples

Build failure on Ubuntu 24.04 (GCC 13.3.0) cuda13.1: "target_compile_features no known features"

Open
#402 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
9.6k
Forks
2.4k
Avg merge
53m
Merged PRs (30d)
1

Description

Description
I am unable to build cuda-samples on a fresh installation of Ubuntu 24.04. When running CMake, the configuration fails with target_compile_features no known features for CXX compiler "GNU" version 13.3.0 across multiple samples (e.g., cudaGraphsPerfScaling, transpose).

It appears that CMake is failing to map the feature set for GCC 13.3.0 when the project languages are mixed with CUDA, or the C++ standard detection is failing during the initial compiler check.

Environment

  • OS: Ubuntu 24.04 LTS
  • Compiler: GCC / G++ 13.3.0
  • CUDA Toolkit: 13.1 (Targeting architecture sm_90)
  • CMake: 3.28.3

Steps to Reproduce

  1. Clone the repository.
  2. mkdir build && cd build
  3. Run cmake .. -DCMAKE_CUDA_ARCHITECTURES=90 -DCMAKE_CUDA_COMPILER=/usr/local/cuda-13.1/bin/nvcc

Generates Error

CMake Error at Samples/6_Performance/transpose/CMakeLists.txt:28 (target_compile_features): 
  target_compile_features no known features for CXX compiler

  "GNU" 

  version 13.3.0.

Attempted Fixes

  • I have tried forcing CMAKE_CXX_STANDARD=17 via command line arguments.

It seems that despite enabling the CXX language, CMake cannot retrieve the compile features list for this specific GCC version when invoked within this project structure.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the configuration command with CMake 3.28.3, GCC 13.3.0, and CUDA 13.1. Inspect Samples/6_Performance/transpose/CMakeLists.txt at the reported target_compile_features call, then compare the setup used by other affected samples such as cudaGraphsPerfScaling. Done means the affected samples configure without the reported unknown-features error on the stated environment.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp
Domain
build-system, compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.