Skip to content

fix(cuda): CI stub build needs cstring; drop host CUDA -I - #25

Closed
caixuf wants to merge 1 commit into
mainfrom
cursor/fix-cuda-stub-includes-458c
Closed

caixuf wants to merge 1 commit into
mainfrom
cursor/fix-cuda-stub-includes-458c

Conversation

@caixuf

@caixuf caixuf commented Sep 20, 2026 •

Copy link
Copy Markdown
Owner

Problem

CI run 35051578273 failed on Build & Test (GCC), TSAN, and ASAN while compiling test_cuda_coro:

include/flowcoro/cuda.h:56:100: error: ‘memcpy’ is not a member of ‘std’
include/flowcoro/cuda.h:57:94: error: ‘memcpy’ is not a member of ‘std’

The compile line also injected -I/home/caixuf/.local/lib/python3.12/site-packages/nvidia/cu13/include on GitHub runners (path does not exist). There is no FLOWCORO_ENABLE_CUDA option; __has_include(<cuda.h>) already chose the in-header stubs, so this -I did not switch header mode — it only polluted the compile line.

Fix

  1. Include <cstring> and <cstdlib> in include/flowcoro/cuda.h so stub cuMemcpy*Async / cuMemAlloc* compile under GCC 13.
  2. Remove the hardcoded developer-machine nvidia/cu13 fallback from the header.
  3. In tests/CMakeLists.txt, add a CUDA include dir only when cuda.h actually exists (FLOWCORO_CUDA_INCLUDE_DIR, CUDA_HOME, CUDA_PATH, or /usr/local/cuda). Default no-GPU CI uses host stubs.

No CUDA feature-scope change.

Verify

Local Release (g++-13, no GPU / no toolkit):

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=g++-13 \
  -DFLOWCORO_BUILD_BENCHMARKS=OFF -DFLOWCORO_BUILD_EXAMPLES=OFF \
  -DFLOWCORO_ENABLE_DATABASE=OFF
  • CMake: FlowCoro: no CUDA toolkit headers found; test_cuda_coro uses host stubs
  • test_cuda_coro CXX_INCLUDES = -I/workspace/include (no nvidia/cu13 -I)
  • test_cuda_coro prints [PASS] FlowCoro native CUDA coroutine awaiter passed!
  • ctest --test-dir build --label-exclude network_external: 24/24 passed, including test_cuda_coro
Open in Web Open in Cursor 

Stub cuMemcpy*Async used std::memcpy/std::malloc without <cstring>/<cstdlib>,
which broke GCC/ASAN/TSAN builds of test_cuda_coro. Also drop the hardcoded
developer-machine nvidia/cu13 include so default no-GPU CI compiles against
in-header Driver API stubs.

Co-authored-by: 李龙飞 <caixuf@users.noreply.github.com>
@cursor cursor Bot changed the title fix(cuda): CI stub build needs &lt;cstring&gt;; drop host CUDA -I fix(cuda): CI stub build needs cstring; drop host CUDA -I Sep 20, 2026
@caixuf
caixuf marked this pull request as ready for review September 20, 2026 01:03
@caixuf

caixuf commented Sep 20, 2026

Copy link
Copy Markdown
Owner Author

Merged to main as 05a92a6 (local squash push; API merge was flaky).

@caixuf caixuf closed this Sep 20, 2026
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

Successfully merging this pull request may close these issues.

2 participants