Skip to content

bootstrap_tests still pull CUDA headers through unused includes #1045

@bdice

Description

@bdice

Summary

rapidsmpf bootstrap code is intended to stay CUDA-free, and #1034 helped by removing one unnecessary rapidsmpf/config.hpp include from slurm_backend.cpp. However, bootstrap_tests still fail in a devcontainers CI build because other bootstrap translation units or headers still pull cuda_runtime_api.h through unused rapidsmpf/config.hpp / rapidsmpf/error.hpp includes.

Failing job:
https://github.com/rapidsai/devcontainers/actions/runs/25934723879/job/76237259148?pr=701

Related PR:
#1034

Failure Examples

bootstrap.cpp:

[167/258] Building CXX object tests/CMakeFiles/bootstrap_tests.dir/__/src/bootstrap/bootstrap.cpp.o
FAILED: tests/CMakeFiles/bootstrap_tests.dir/__/src/bootstrap/bootstrap.cpp.o
/usr/bin/sccache /usr/bin/g++ -DRAPIDSMPF_HAVE_SLURM -I/home/coder/rapidsmpf/cpp/include ... -c /home/coder/rapidsmpf/cpp/src/bootstrap/bootstrap.cpp
In file included from /home/coder/rapidsmpf/cpp/include/rapidsmpf/error.hpp:17,
                 from /home/coder/rapidsmpf/cpp/include/rapidsmpf/config.hpp:16,
                 from /home/coder/rapidsmpf/cpp/src/bootstrap/bootstrap.cpp:14:
/home/coder/rapidsmpf/cpp/include/rapidsmpf/utils/misc.hpp:19:10: fatal error: cuda_runtime_api.h: No such file or directory
   19 | #include <cuda_runtime_api.h>
      |          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.

file_backend.cpp:

[117/258] Building CXX object tests/CMakeFiles/bootstrap_tests.dir/__/src/bootstrap/file_backend.cpp.o
FAILED: tests/CMakeFiles/bootstrap_tests.dir/__/src/bootstrap/file_backend.cpp.o
/usr/bin/sccache /usr/bin/g++ -DRAPIDSMPF_HAVE_SLURM -I/home/coder/rapidsmpf/cpp/include ... -c /home/coder/rapidsmpf/cpp/src/bootstrap/file_backend.cpp
In file included from /home/coder/rapidsmpf/cpp/include/rapidsmpf/error.hpp:17,
                 from /home/coder/rapidsmpf/cpp/src/bootstrap/file_backend.cpp:25:
/home/coder/rapidsmpf/cpp/include/rapidsmpf/utils/misc.hpp:19:10: fatal error: cuda_runtime_api.h: No such file or directory
   19 | #include <cuda_runtime_api.h>
      |          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.

slurm_backend.cpp via slurm_backend.hpp:

[196/258] Building CXX object tests/CMakeFiles/bootstrap_tests.dir/__/src/bootstrap/slurm_backend.cpp.o
FAILED: tests/CMakeFiles/bootstrap_tests.dir/__/src/bootstrap/slurm_backend.cpp.o
/usr/bin/sccache /usr/bin/g++ -DRAPIDSMPF_HAVE_SLURM -I/home/coder/rapidsmpf/cpp/include ... -c /home/coder/rapidsmpf/cpp/src/bootstrap/slurm_backend.cpp
In file included from /home/coder/rapidsmpf/cpp/include/rapidsmpf/error.hpp:17,
                 from /home/coder/rapidsmpf/cpp/include/rapidsmpf/config.hpp:16,
                 from /home/coder/rapidsmpf/cpp/include/rapidsmpf/bootstrap/slurm_backend.hpp:8,
                 from /home/coder/rapidsmpf/cpp/src/bootstrap/slurm_backend.cpp:15:
/home/coder/rapidsmpf/cpp/include/rapidsmpf/utils/misc.hpp:19:10: fatal error: cuda_runtime_api.h: No such file or directory
   19 | #include <cuda_runtime_api.h>
      |          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.

Expected Behavior

bootstrap_tests should continue to compile without requiring CUDA include directories. The bootstrap-only sources should avoid including headers that pull in cuda_runtime_api.h unless CUDA is actually required.

Notes

The remaining observed include chains are:

bootstrap.cpp -> rapidsmpf/config.hpp -> rapidsmpf/error.hpp -> rapidsmpf/utils/misc.hpp -> cuda_runtime_api.h
file_backend.cpp -> rapidsmpf/error.hpp -> rapidsmpf/utils/misc.hpp -> cuda_runtime_api.h
slurm_backend.cpp -> slurm_backend.hpp -> rapidsmpf/config.hpp -> rapidsmpf/error.hpp -> rapidsmpf/utils/misc.hpp -> cuda_runtime_api.h

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions