没有GPU的Nvcc

问题描述 投票:0回答:1

我正试图从更快的RCNN获得一个区域提案。我在github中找到了这个漂亮而又整洁的回购,但每当我执行shell命令sh make.sh时,它会吐出一个cffi.error.VerificationError: LinkError: command 'gcc' failed with exit status 1错误,这是我从未听说过的。当我搜索它时,它似乎与错误的CUDA_ARCH设置有关,但我的本地机器中没有GPU。

#!/usr/bin/env bash

# CUDA_PATH=/usr/local/cuda/

export CUDA_PATH=/usr/local/cuda/
#You may also want to ad the following
#export C_INCLUDE_PATH=/opt/cuda/include

export CXXFLAGS="-std=c++11"
export CFLAGS="-std=c99"

python setup.py build_ext --inplace
rm -rf build

CUDA_ARCH="-gencode arch=compute_30,code=sm_30 \
       -gencode arch=compute_35,code=sm_35 \
       -gencode arch=compute_50,code=sm_50 \
       -gencode arch=compute_52,code=sm_52 \
       -gencode arch=compute_60,code=sm_60 \
       -gencode arch=compute_61,code=sm_61 "

# compile NMS
cd model/nms/src
echo "Compiling nms kernels by nvcc..."
nvcc -c -o nms_cuda_kernel.cu.o nms_cuda_kernel.cu \
-D GOOGLE_CUDA=1 -x cu -Xcompiler -fPIC $CUDA_ARCH

cd ../
python build.py

# compile roi_pooling
cd ../../
cd model/roi_pooling/src
echo "Compiling roi pooling kernels by nvcc..."
nvcc -c -o roi_pooling.cu.o roi_pooling_kernel.cu \
-D GOOGLE_CUDA=1 -x cu -Xcompiler -fPIC $CUDA_ARCH
cd ../
python build.py

# compile roi_align
cd ../../
cd model/roi_align/src
echo "Compiling roi align kernels by nvcc..."
nvcc -c -o roi_align_kernel.cu.o roi_align_kernel.cu \
-D GOOGLE_CUDA=1 -x cu -Xcompiler -fPIC $CUDA_ARCH
cd ../
python build.py

# compile roi_crop
cd ../../
cd model/roi_crop/src
echo "Compiling roi crop kernels by nvcc..."
nvcc -c -o roi_crop_cuda_kernel.cu.o roi_crop_cuda_kernel.cu \
-D GOOGLE_CUDA=1 -x cu -Xcompiler -fPIC $CUDA_ARCH
cd ../
python build.py

我已经搜索了如何在没有GPU的情况下编译CUDA代码,但它没有给我完美的解决方案。我也删除了CUDA_ARCH,并将GOOGLE_CUDA设置为0,但这一切都失败了。任何帮助将非常感激。

shell cuda computer-vision
1个回答
1
投票

你可以在没有GPU的情况下进行构建。但这并不是很有用。 nvcc编译器生成GPU代码,因此无论如何都无法运行生成的代码。

话虽如此,对于遇到同一问题的其他人:你可以通过安装CUDA meta-packages来实现这一点,特别是编译器和开发库,而不是驱动程序和运行时。

© www.soinside.com 2019 - 2024. All rights reserved.