Skip to content

CMAKE error nvcc fatal : Unknown option '-Wall' #5542

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
clibdev opened this issue Feb 17, 2024 · 0 comments · Fixed by #5570
Closed

CMAKE error nvcc fatal : Unknown option '-Wall' #5542

clibdev opened this issue Feb 17, 2024 · 0 comments · Fixed by #5570

Comments

@clibdev
Copy link
Contributor

clibdev commented Feb 17, 2024

On Ubuntu 22.04, using CMAKE and -DLLAMA_CUBLAS=ON I'm getting the following error:

Cannot get compiler information:
	Compiler exited with error code 1: /usr/local/cuda/bin/nvcc -DGGML_CUDA_DMMV_X=32 -DGGML_CUDA_MMV_Y=1 -DGGML_CUDA_PEER_MAX_BATCH_SIZE=128 -DGGML_USE_CUBLAS -DK_QUANTS_PER_ITERATION=2 -D_GNU_SOURCE -D_XOPEN_SOURCE=600 -isystem=/usr/local/cuda/include -O3 -DNDEBUG -std=c++11 --generate-code=arch=compute_52,code=[compute_52,sm_52] --generate-code=arch=compute_61,code=[compute_61,sm_61] --generate-code=arch=compute_70,code=[compute_70,sm_70] -Wall -Wextra -Wpedantic -Wcast-qual -Wno-unused-function -Wmissing-declarations -Wmissing-noreturn -use_fast_math -Wno-pedantic -Xcompiler "-Wno-array-bounds -Wno-format-truncation -Wextra-semi -march=native" --dryrun /tmp/compiler-file17262593416218535232.cu
	nvcc fatal   : Unknown option '-Wall'

The problem can be solved by replacing the following lines in the CMakeLists.txt:

set(CUDA_FLAGS ${CXX_FLAGS} -use_fast_math)
if (NOT MSVC)
    list(APPEND CUDA_FLAGS -Wno-pedantic)
endif()

to:

set(CUDA_FLAGS -use_fast_math)
if (NOT MSVC)
    list(APPEND CUDA_FLAGS --compiler-options=-Wno-pedantic)
endif()

Maybe someone have better idea how to include "${CXX_FLAGS}" for CUDA_FLAGS?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant