From 600d517cde8e3ee00bd349e9fbb92822aca4978a Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Mon, 19 Feb 2024 09:37:42 +0100 Subject: [PATCH] ci: add g++-10 and gcc-10 to the main-cuda This commit contains an attempt to work around an issue with CUDA 11.7.1 and gcc-11. The motivation for this change is that currently the following compilation error occurs when building the main-cuda image: ```console 219.4 ggml-cuda.cu(675): warning #177-D: function "warp_reduce_max(half2)" was declared but never referenced 219.4 243.1 /usr/include/c++/11/type_traits:79:52: error: redefinition of 'constexpr const _Tp std::integral_constant<_Tp, __v>::value' 243.1 79 | template 243.1 | ^ 243.1 /usr/include/c++/11/type_traits:67:29: note: 'constexpr const _Tp value' previously declared here 243.1 67 | static constexpr _Tp value = __v; 243.1 | ^~~~~ 243.9 make: *** [Makefile:447: ggml-cuda.o] Error 1 ``` Downgrading to gcc-10 and g++-10 seems to work around the issue. I'm not sure about the root cause of the issue, but will try to investigate further and see what proper fix might be. Signed-off-by: Daniel Bevenius --- .devops/main-cuda.Dockerfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.devops/main-cuda.Dockerfile b/.devops/main-cuda.Dockerfile index 2b7faf7c1..16aca08a6 100644 --- a/.devops/main-cuda.Dockerfile +++ b/.devops/main-cuda.Dockerfile @@ -11,8 +11,12 @@ FROM ${BASE_CUDA_DEV_CONTAINER} as build # Unless otherwise specified, we make a fat build. ARG CUDA_DOCKER_ARCH=all +# Install gcc-10 and g++-10 to work around and issue CUDA 11.7.1 and gcc-11 RUN apt-get update && \ - apt-get install -y build-essential git + apt-get install -y build-essential git g++-10 gcc-10 +RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 && \ + update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 100 + WORKDIR /app