Compile bug: Error building with with CUDA 11.8: cudaGridDependencySynchronize undefined in common.cuh

Open Beginner friendly
#26,591 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
cmake, cpp

Research direction

Start with ggml/src/ggml-cuda/common.cuh around the reported cudaGridDependencySynchronize and cudaTriggerProgrammaticLaunchCompletion references, then inspect the CUDA version checks introduced by commit e94722822. Reproduce with CUDA 11.8 using the issue's CMake command and verify that the build completes without undefined-identifier errors.

Written by the indexing model from the issue text.

Description

bug-unconfirmed
Git commit

1c3c9674d, current as of August 4

Operating systems

Linux

GGML backends

CUDA

Problem description & steps to reproduce

I'm building with CUDA 11.8 and g++ 11.4.0 on Ubuntu 22.04.
My CMake flags are -DGGML_CUDA=ON and -DGGML_CUDA_NCCL=ON -DGGML_CCACHE=OFF

The build fails around 29% with:

  /home/michael/ai/llama.cpp/ggml/src/ggml-cuda/common.cuh(126): error: identifier "cudaGridDependencySynchronize" is undefined
  /home/michael/ai/llama.cpp/ggml/src/ggml-cuda/common.cuh(132): error: identifier "cudaTriggerProgrammaticLaunchCompletion" is undefined

It looks like they are only declared in cuda_device_runtime_api.h starting with CUDA 12.6, but GGML_CUDA_USE_PDL is enabled for 11.8.

Thank you to the whole llama.cpp team for all the great work you do!

First Bad Commit

GIT bisect found the breaking commit, e94722822 (PR 22522)

Compile command
rm -rf build
cmake -B build -DBUILD_SHARED_LIBS=OFF -DGGML_CUDA=ON -DGGML_CUDA_NCCL=ON -DGGML_CCACHE=OFF
cmake --build build --parallel
Relevant log output
[ 28%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/fattn-vec-instance-q8_0-q8_0.cu.o                                                                                                                                                                                 
[ 28%] Building CUDA object ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/template-instances/fattn-vec-instance-bf16-bf16.cu.o                                                                                                                                                                                 
/home/michael/ai/llama.cpp/ggml/src/ggml-cuda/common.cuh(121): error: identifier "cudaGridDependencySynchronize" is undefined                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                             
/home/michael/ai/llama.cpp/ggml/src/ggml-cuda/common.cuh(127): error: identifier "cudaTriggerProgrammaticLaunchCompletion" is undefined                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                             
/home/michael/ai/llama.cpp/ggml/src/ggml-cuda/common.cuh(121): error: identifier "cudaGridDependencySynchronize" is undefined                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                             
/home/michael/ai/llama.cpp/ggml/src/ggml-cuda/common.cuh(127): error: identifier "cudaTriggerProgrammaticLaunchCompletion" is undefined

... and so on
Dominant language
C++
Stars
129k
Forks
23.5k
Avg merge
2d 11h
Merged PRs (30d)
411

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.

More from ggml-org/llama.cpp

All issues in ggml-org/llama.cpp

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.