-
- 報錯1. sudo apt install libXXX 報錯與解決 E: 無法定位軟件包
- 報錯2.error: constexpr function return is non-constant
- 報錯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. 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)