ztxz16 / fastllm

纯c++的全平台llm加速库,支持python调用,chatglm-6B级模型单卡可达10000+token / s,支持glm, llama, moss基座,手机端流畅运行
Apache License 2.0
3.28k stars 332 forks source link

也报了 make -j 错误 #131

Open seniornut opened 1 year ago

seniornut commented 1 year ago

开始报错是nvcc fatal : Unsupported gpu architecture 'compute_89' 把CMakeList.txt的的set(CMAKE_CUDA_ARCHITECTURES "native") 改为了80, 同样的错误 改成75后报下面的错误: [ 71%] Building CUDA object CMakeFiles/fastllm.dir/src/devices/cuda/fastllm-cuda.cu.o /usr/include/c++/11/bits/std_function.h:435:145: error: parameter packs not expanded with ‘...’: 435 | function(_Functor&& f) | ^ /usr/include/c++/11/bits/std_function.h:435:145: note: ‘_ArgTypes’ /usr/include/c++/11/bits/std_function.h:530:146: error: parameter packs not expanded with ‘...’: 530 | operator=(_Functor&& f) | ^ /usr/include/c++/11/bits/std_function.h:530:146: note: ‘_ArgTypes’ make[2]: [CMakeFiles/fastllm.dir/build.make:217: CMakeFiles/fastllm.dir/src/devices/cuda/fastllm-cuda.cu.o] Error 1 make[2]: Waiting for unfinished jobs.... /usr/include/c++/11/bits/std_function.h:435:145: error: parameter packs not expanded with ‘...’: 435 | function(_Functor&& f) | ^ /usr/include/c++/11/bits/std_function.h:435:145: note: ‘_ArgTypes’ /usr/include/c++/11/bits/std_function.h:530:146: error: parameter packs not expanded with ‘...’: 530 | operator=(_Functor&& f) | ^ /usr/include/c++/11/bits/std_function.h:530:146: note: ‘_ArgTypes’ make[1]: [CMakeFiles/Makefile2:93: CMakeFiles/fastllm.dir/all] Error 2 make[1]: Waiting for unfinished jobs.... make[2]: [CMakeFiles/fastllm_tools.dir/build.make:217: CMakeFiles/fastllm_tools.dir/src/devices/cuda/fastllm-cuda.cu.o] Error 1 make[2]: Waiting for unfinished jobs.... make[1]: [CMakeFiles/Makefile2:223: CMakeFiles/fastllm_tools.dir/all] Error 2 make: [Makefile:91: all] Error 2

walker83 commented 1 year ago

我也遇到了同样的问题,是由于

修改文件:CMakeLists.txt

整句话: CMAKE_CUDA_ARCHITECTURES

默认的这句话不好使:

set(CMAKE_CUDA_ARCHITECTURES "native") 命令告诉 CMake 为你系统的本地 GPU 架构生成设备代码。这将确保你的应用程序能够在你的 GPU 上以最佳性能运行。

native 参数是 CMake 3.24 中添加的新功能。在 CMake 3.23 之前,你必须指定具体的 GPU 架构。例如,要为架构 70 的 GPU 生成代码,你必须使用以下命令:

set(CMAKE_CUDA_ARCHITECTURES "90") native 参数使指定 GPU 架构变得更加容易。它还使你的代码更具移植性,因为它将针对你的系统的本地 GPU 架构进行编译。

如果你不确定应该使用哪个 GPU 架构,你可以使用 nvcc --list-gpu-arch 命令来查看你的系统支持的架构。

nvcc --list-gpu-arch compute_50 compute_52 compute_53 compute_60 compute_61 compute_62 compute_70 compute_72 compute_75 compute_80 compute_86 compute_87 compute_89 compute_90

wang-zhix commented 1 year ago

遇到了一模一样的错误,有解决办法了吗?

wang-zhix commented 1 year ago

image

GCC 换成 10 就通过了 gcc version 10.3.0 (Ubuntu 10.3.0-1ubuntu1~18.04~1)

ybh618 commented 1 year ago

我用debian没有问题

TylunasLi commented 1 year ago

请尝试降低gcc版本或升级CUDA版本。某些CUDA11.x版本虽然号称支持gcc11,但似乎有问题。

nzinfo commented 1 year ago

参考 Issue https://github.com/stotko/stdgpu/issues/337

CC=gcc-10 CXX=g++-10 cmake .. -DUSE_CUDA=ON -DCMAKE_CUDA_HOST_COMPILER=/usr/bin/g++-10