-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Fix compilation on Pop!_OS 22.04 LTS CUDA #10835
base: master
Are you sure you want to change the base?
Conversation
Downgrade the C++ version from 17 to 14, and also update the code to remove compilation warnings.
Making C++ standard conditional on some backend is not a good idea. PopOS is based on Ubuntu.
Then build llama.cpp with
|
I did not know I can build it with clang. Clang should work with C++17 no problem. I'll try to rebuild it with clang. Before I try, one question. I suspect the problem might be with CUDA because it is failing to build .cu file? |
I played around with nvcc a bit and reprod the issue. #include <iostream>
#include <functional>
__global__ void hello() {
if constexpr (true) {
printf("C++17 is supported!\n");
}
}
int main() {
hello<<<1, 1>>>();
cudaDeviceSynchronize();
return 0;
} $ nvcc -std=c++17 -o main main.cu I suspect using clang would not help. I need to upgrade nvcc.
Maybe there is a way build nvcc on C++14 and rest on C++17. I am not expert in cmake. |
Ah. Yeah, sorry, my bad. You need newer CUDA toolkit. CUDA 12 should work (it does on Ubuntu 24.04). Technically you can explicitly specify the host compiler to use ( |
Thanks for the suggestion. I'll try to update to CUDA 12. |
Downgrade the C++ version from 17 to 14, and also update the code to remove compilation warnings.
Without that fix the build fails with the following error.
Make sure to read the contributing guidelines before submitting a PR