Skip to content

Compile bug: common.cuh defines clash with winAPI #10575

@aendk

Description

@aendk

Git commit

5a89877

Operating systems

Windows

GGML backends

CUDA

Problem description & steps to reproduce

Whilst trying to improve performance on windows, I tried to include nvtx3/nvToolsExt.h in ggml-cuda.cu.

This breaks compilation, because there is a naming clash between common.cuh and oaidl.h(winapi, enum tagCALLCONV @ Line 812).

To be specific, CC_PASCAL is set to 600. At this place, the GPU arch pascal is referenced. In WinAPI, an identical name exists for pascal calling conventions.

On windows, this could create issues for many libraries who interface with winAPI

I would suggest prefixing or renaming CC_PASCAL et al.

First Bad Commit

No response

Relevant log output

FAILED: ggml/src/ggml-cuda/CMakeFiles/ggml-cuda.dir/ggml-cuda.cu.obj 
C:\PROGRA~1\NVIDIA~2\CUDA\v12.6\bin\nvcc.exe -forward-unknown-to-host-compiler -DGGML_BACKEND_BUILD -DGGML_BACKEND_SHARED -DGGML_CUDA_PEER_MAX_BATCH_SIZE=128 -DGGML_CUDA_USE_GRAPHS -DGGML_SCHED_MAX_COPIES=4 -DGGML_SHARED -D_CRT_SECURE_NO_WARNINGS -D_XOPEN_SOURCE=600 -Dggml_cuda_EXPORTS -IC:\Users\akieslinger\CLionProjects\llama.cpp\ggml\src\ggml-cuda\. -IC:\Users\akieslinger\CLionProjects\llama.cpp\ggml\src\ggml-cuda\.. -IC:\Users\akieslinger\CLionProjects\llama.cpp\ggml\src\..\include -isystem "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\include" -D_WINDOWS -Xcompiler=" /GR /EHsc" -Xcompiler="-MD  -Zi -O2 -Ob1" -DNDEBUG "--generate-code=arch=compute_89,code=[compute_89,sm_89]" -use_fast_math -MD -MT ggml\src\ggml-cuda\CMakeFiles\ggml-cuda.dir\ggml-cuda.cu.obj -MF ggml\src\ggml-cuda\CMakeFiles\ggml-cuda.dir\ggml-cuda.cu.obj.d -x cu -c C:\Users\akieslinger\CLionProjects\llama.cpp\ggml\src\ggml-cuda\ggml-cuda.cu -o ggml\src\ggml-cuda\CMakeFiles\ggml-cuda.dir\ggml-cuda.cu.obj -Xcompiler=-Fdggml\src\ggml-cuda\CMakeFiles\ggml-cuda.dir\,-FS
C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\um\oaidl.h(812): error: expected an identifier
          600	= CC_MSCPASCAL,

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions