报错与解决

报错1. sudo apt install libXXX 报错与解决 E: 无法定位软件包

sudo apt install libjasper-dev
报错.

sudo apt install libjasper-dev
正在读取软件包列表... 完成
正在分析软件包的依赖关系树       
正在读取状态信息... 完成       
E: 无法定位软件包 libjasper-dev

解决方案:

# 无法找到libjasper包,所以添加以下源
sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main"
sudo apt-get update
sudo apt install libjasper-dev

3080卡 cuda11.3 编译caffe报错与解决
首先需要把cudnn关闭. cuda11只支持cudnn8,caffe支持7.X. 这个暂时解决不了,所以先关闭,不用cudnn加速.

另外补充一下,一开始还不知道我机器是3080卡,用nvidia-smi命令看不到显卡型号,用lspci |grep -i vga显示如下
01:00.0 VGA compatible controller: NVIDIA Corporation Device 2208 (rev a1)
我一看就认为是20卡了,然后电脑就装cuda10.0,cudnn7.5. 然后编译caffe,解决若干问题确实能够编译成功,但是运行的时候加载caffe模型的时候卡住:
net = caffe.Net(path_deploy, path_caffe_model, caffe.TEST)
运行这句话加载模型权重,加载第一层卷积层的时候就卡住,卡很久,能卡15min左右才能出来.

然后找问题无解,然后看机箱里面卡是3080的,大坑啊!

报错2.error: constexpr function return is non-constant

./3rdparty/half_float/half.hpp(3070): error: constexpr function return is non-constant

./3rdparty/half_float/half.hpp(3073): error: constexpr function return is non-constant

./3rdparty/half_float/half.hpp(3076): error: constexpr function return is non-constant

./3rdparty/half_float/half.hpp(3079): error: constexpr function return is non-constant

./3rdparty/half_float/half.hpp(3083): error: constexpr function return is non-constant

./3rdparty/half_float/half.hpp(3086): error: constexpr function return is non-constant

./3rdparty/half_float/half.hpp(3089): error: constexpr function return is non-constant

./3rdparty/half_float/half.hpp(3092): error: constexpr function return is non-constant

./3rdparty/half_float/half.hpp(3095): error: constexpr function return is non-constant

解决方案
./3rdparty/half_float/half.hpp

//support constexpr
#if HALF_ENABLE_CPP11_CONSTEXPR
	//#define HALF_CONSTEXPR			constexpr   
	//#define HALF_CONSTEXPR_CONST	constexpr
         //上面2行注释掉,用下面2行取代
        #define HALF_CONSTEXPR			
	#define HALF_CONSTEXPR_CONST	 const  
#else
	#define HALF_CONSTEXPR
	#define HALF_CONSTEXPR_CONST	const
#endif

报错3. error The version of CUB in your include path is not compatible with this release of Thrust. CUB is now included in the CUDA Toolkit, so you no longer need to use your own checkout of CUB. Define THRUST_IGNORE_CUB_VERSION_CHECK to ignore this.

error The version of CUB in your include path is not compatible with this release of Thrust. CUB is now included in the CUDA Toolkit, so you no longer need to use your own checkout of CUB. Define THRUST_IGNORE_CUB_VERSION_CHECK to ignore this.

解决方案1:这个是用make编译的,换cmake编译就不会报这个错误
解决方案2: make这个错误解决,按照提示Define THRUST_IGNORE_CUB_VERSION_CHECK to ignore this.
在Makefile文件中添加 -DTHRUST_IGNORE_CUB_VERSION_CHECK,如下:
NVCCFLAGS += -ccbin=$(CXX) -Xcompiler -fPIC -DTHRUST_IGNORE_CUB_VERSION_CHECK $(COMMON_FLAGS)

posted @ 2022-02-08 14:49  无左无右  阅读(991)  评论(0编辑  收藏  举报