Skip to content

CUDA: fix __builtin_assume for CUDA < 11.2 - #2669

Closed
JohannesGaessler wants to merge 1 commit into
ggml-org:masterfrom
JohannesGaessler:cuda-fix-builtin-assume
Closed

JohannesGaessler wants to merge 1 commit into
ggml-org:masterfrom
JohannesGaessler:cuda-fix-builtin-assume

Conversation

@JohannesGaessler

Copy link
Copy Markdown
Contributor

Reportedly there are compilation issues on old CUDA versions due to __builtin_assume, see #2458 (comment) . This PR attempts to fix the issue by defining a dummy implementation for old CUDA versions. I don't have old CUDA versions installed on any of my old machines, so I did not test that the dummy implementation actually fixes the compilation issues (but the code seemed to work correctly with CUDA 12 when using the dummy implementation). @whoreson please confirm that this fixes the compilation issue for you.

Comment thread ggml-cuda.cu Resolved
@whoreson

Copy link
Copy Markdown
Contributor

It does compile now, and seems to be working too. BTW, this patch is also needed: ggml-org/whisper.cpp#1018 (comment)

And because the older nvcc doesn't support the --forward-unknown-to-host-compiler option:

  •   NVCCFLAGS = --forward-unknown-to-host-compiler
    
  •   NVCCFLAGS := --compiler-options="$(CFLAGS)"
    

@JohannesGaessler

Copy link
Copy Markdown
Contributor Author

Closed in favor of #3132

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.

4 participants