Tencent / ncnn

ncnn is a high-performance neural network inference framework optimized for the mobile platform
Other
20.14k stars 4.14k forks source link

cmake .. 命令运行不了 #5684

Open Airgods opened 1 week ago

Airgods commented 1 week ago

所题所述,在安装ncnn架构时,无法使用cmake .. 命令,经过我的调查,是因为cuda版本不够,但是我并不确定,请问有大佬能看是具体是因为什么报错: (ncnn) llm@161-amax:~/open-source/ncnn/tools/pnnx/build$ cmake .. -- Using cached Torch root = /data1/llm/anaconda3/envs/ncnn/lib/python3.8/site-packages/torch/share/cmake CMake Error at /usr/local/share/cmake-3.19/Modules/CMakeDetermineCompilerId.cmake:642 (message): Compiling the CUDA compiler identification source file "CMakeCUDACompilerId.cu" failed.

Compiler: /usr/bin/nvcc

Build flags:

Id flags: --keep;--keep-dir;tmp;-gencode=arch=compute_50,code=sm_50;-gencode=arch=compute_60,code=sm_60;-gencode=arch=compute_80,code=sm_80 -v

The output was:

1

nvcc fatal : Unsupported gpu architecture 'compute_80'

Call Stack (most recent call first): /usr/local/share/cmake-3.19/Modules/CMakeDetermineCompilerId.cmake:34 (CMAKE_DETERMINE_COMPILER_ID_BUILD) /usr/local/share/cmake-3.19/Modules/CMakeDetermineCUDACompiler.cmake:262 (CMAKE_DETERMINE_COMPILER_ID) /data1/llm/anaconda3/envs/ncnn/lib/python3.8/site-packages/torch/share/cmake/Caffe2/public/cuda.cmake:47 (enable_language) /data1/llm/anaconda3/envs/ncnn/lib/python3.8/site-packages/torch/share/cmake/Caffe2/Caffe2Config.cmake:92 (include) /data1/llm/anaconda3/envs/ncnn/lib/python3.8/site-packages/torch/share/cmake/Torch/TorchConfig.cmake:68 (find_package) CMakeLists.txt:45 (find_package)

-- Configuring incomplete, errors occurred! See also "/data1/llm/open-source/ncnn/tools/pnnx/build/CMakeFiles/CMakeOutput.log". See also "/data1/llm/open-source/ncnn/tools/pnnx/build/CMakeFiles/CMakeError.log".

nihui commented 1 week ago

错误是cuda相关,可以安装 cpu only 的 torch 编译pnnx pnnx 不需要gpu支持的