Skip to content

[BUG] early_gpufj.cu fails to compile with GCC 14: '*.Lsrc_loc167' not specified in enclosing 'task' #1776

Description

@ramakrishnap-nv

Describe the bug

cpp/src/mip_heuristics/feasibility_jump/early_gpufj.cu fails to compile with newer GCC (14.4.0) as a host compiler for nvcc:

/cpp/src/mip_heuristics/feasibility_jump/early_gpufj.cu: In member function 'void cuopt::mathematical_optimization::mip::early_gpufj_t<i_t, f_t>::start() [with i_t = int; f_t = double]':
/cpp/src/mip_heuristics/feasibility_jump/early_gpufj.cu:66:23: error: '*.Lsrc_loc167' not specified in enclosing 'task'
/cpp/src/mip_heuristics/feasibility_jump/early_gpufj.cu:63:9: note: enclosing 'task'

This was introduced by #1683 (commit 380f7ee), which changed the body of a #pragma omp task default(none) shared(fj_ptr_) ... block at early_gpufj.cu:63-68 from a plain function-call macro to constructing a local RAII guard:

-    RAFT_CUDA_TRY(cudaSetDevice(this->device_id_));
+    raft::device_setter guard(this->device_id_);

With default(none), GCC requires every entity referenced inside the task body — including compiler-generated temporaries from a local object's constructor/destructor — to be covered by an explicit data-sharing clause. *.Lsrc_loc167 is GCC's internal name for a hidden temporary (likely from source-location tracking inside raft::device_setter's constructor/destructor), which isn't covered by the existing shared(fj_ptr_) clause. -Xcompiler=-Werror on this build turns the resulting warning into a hard error.

I suspect this hasn't shown up on main's regular CI yet because the CI container's GCC version is likely older/less strict than 14.4.0 and doesn't emit this diagnostic — but it reproduces 100% deterministically with GCC 14.4.0, so it's likely to surface there too once the CI image's toolchain advances.

Steps/Code to reproduce bug

  1. Check out main at or after commit 380f7ee (Block Bounded Value Elimination presolving pass for binary problems #1683).
  2. Build libcuopt locally with a GCC 14.x toolchain, e.g.:
    mamba env create -n cuopt_gcc14 -f conda/environments/all_cuda-133_arch-x86_64.yaml
    conda activate cuopt_gcc14
    ./build.sh libcuopt --skip-grpc-build --skip-tests-build --skip-routing-build
    
  3. Build fails compiling cuopt_objs.dir/src/mip_heuristics/feasibility_jump/early_gpufj.cu.o with the error above.

Expected behavior

early_gpufj.cu compiles cleanly regardless of GCC version. The #pragma omp task clause at line 63-64 likely needs to be updated (e.g. explicitly listing what the RAII guard touches, or restructuring so the guard doesn't introduce an implicitly-captured temporary under default(none)).

Environment details:

  • Environment location: Bare-metal (also reproduced via GitHub Actions ubuntu-latest-triggered self-hosted CI runner build)
  • Method of cuOpt install: from source (./build.sh libcuopt)
  • Compiler: gcc/g++ (conda-forge gcc 14.4.0-3), CUDA 13.3.73 (nvcc), CMake 4.4.2, Ninja
  • GPU arch used for the local repro: sm_75 (auto-detected); CI failure was on sm_70/75/80/86/90a/100f/120a/120 multi-arch build

Additional context

First observed while dispatching build.yaml from a feature branch for unrelated testing (a Kitmaker Portal wheel-publishing POC, #1763) — wheel-build-libcuopt and cpp-build both failed with this identical error across multiple matrix jobs (amd64/arm64, CUDA 12.9/13.3) in that same run. Confirmed as a real, deterministic compile failure (not a flaky/cache issue) via a from-scratch local build with no shared cache.

Introduced by #1683 / commit 380f7ee.

Metadata

Metadata

Assignees

Labels

awaiting responseThis expects a response from maintainer or contributor depending on who requested in last comment.bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions