安裝mxnet仍是遇到很多麻煩事,如今簡單記一下,挖個坑,後續詳細補充,打算寫一下個人mxnet探索之旅。html
更新: 具體安裝mxnet,cuda,opencv過程已經補坑——點擊進入git
不知道爲何,在cuda7.5+ubuntu14.04amd64 + opencv2.4.13時,會顯卡驅動有問題,沒法顯示桌面.可是能夠正常使用。後續我改成16.04+cuda8.0rc+opencv2.4.13,解決了桌面顯示問題且正常使用,可是在想把opencv2.4.13換爲opencv3.10時,編譯opencv3.10時會報錯,關於cudalegacy模塊,以下; github
/home/ecarx/opencv-3.1.0/modules/cudalegacy/src/graphcuts.cpp:120:54: error: ‘NppiGraphcutState’ has not been declared typedef NppStatus (*init_func_t)(NppiSize oSize, NppiGraphcutState** ppStat ^ /home/ecarx/opencv-3.1.0/modules/cudalegacy/src/graphcuts.cpp:135:18: error: ‘NppiGraphcutState’ does not name a type operator NppiGraphcutState*() ^ /home/ecarx/opencv-3.1.0/modules/cudalegacy/src/graphcuts.cpp:141:9: error: ‘NppiGraphcutState’ does not name a type NppiGraphcutState* pState; ^ In file included from /home/ecarx/opencv-3.1.0/build/modules/cudalegacy/precomp.hpp:75:0: /home/ecarx/opencv-3.1.0/modules/cudalegacy/src/graphcuts.cpp: In constructor ‘{anonymous}::NppiGraphcutStateHandler::NppiGraphcutStateHandler(NppiSize, Npp8u*, {anonymous}::init_func_t)’: /home/ecarx/opencv-3.1.0/modules/cudalegacy/src/graphcuts.cpp:127:39: error: ‘pState’ was not declared in this scope nppSafeCall( func(sznpp, &pState, pDeviceMem) ); ^ /home/ecarx/opencv-3.1.0/modules/core/include/opencv2/core/private.cuda.hpp:165:52: note: in definition of macro ‘nppSafeCall’ #define nppSafeCall(expr) cv::cuda::checkNppError(expr, __FILE__, __LINE__, CV ^ /home/ecarx/opencv-3.1.0/modules/cudalegacy/src/graphcuts.cpp: In destructor ‘{anonymous}::NppiGraphcutStateHandler::~NppiGraphcutStateHandler()’: /home/ecarx/opencv-3.1.0/modules/cudalegacy/src/graphcuts.cpp:132:43: error: ‘pState’ was not declared in this scope nppSafeCall( nppiGraphcutFree(pState) ); ^ /home/ecarx/opencv-3.1.0/modules/core/include/opencv2/core/private.cuda.hpp:165:52: note: in definition of macro ‘nppSafeCall’ #define nppSafeCall(expr) cv::cuda::checkNppError(expr, __FILE__, __LINE__, CV ^ /home/ecarx/opencv-3.1.0/modules/cudalegacy/src/graphcuts.cpp:132:49: error: ‘nppiGraphcutFree’ was not declared in this scope nppSafeCall( nppiGraphcutFree(pState) ); ^ /home/ecarx/opencv-3.1.0/modules/core/include/opencv2/core/private.cuda.hpp:165:52: note: in definition of macro ‘nppSafeCall’ #define nppSafeCall(expr) cv::cuda::checkNppError(expr, __FILE__, __LINE__, CV ^ /home/ecarx/opencv-3.1.0/modules/cudalegacy/src/graphcuts.cpp: In function ‘void cv::cuda::graphcut(cv::cuda::GpuMat&, cv::cuda::GpuMat&, cv::cuda::GpuMat&, cv::cuda::GpuMat&, cv::cuda::GpuMat&, cv::cuda::GpuMat&, cv::cuda::GpuMat&, cv::cuda::Stream&)’: /home/ecarx/opencv-3.1.0/modules/cudalegacy/src/graphcuts.cpp:174:51: error: ‘nppiGraphcutGetSize’ was not declared in this scope nppSafeCall( nppiGraphcutGetSize(sznpp, &bufsz) ); ^ /home/ecarx/opencv-3.1.0/modules/core/include/opencv2/core/private.cuda.hpp:165:52: note: in definition of macro ‘nppSafeCall’ #define nppSafeCall(expr) cv::cuda::checkNppError(expr, __FILE__, __LINE__, CV ^ /home/ecarx/opencv-3.1.0/modules/cudalegacy/src/graphcuts.cpp:182:61: error: ‘nppiGraphcutInitAlloc’ was not declared in this scope NppiGraphcutStateHandler state(sznpp, buf.ptr<Npp8u>(), nppiGraphcutInitAll ^ In file included from /home/ecarx/opencv-3.1.0/build/modules/cudalegacy/precomp.hpp:75:0: /home/ecarx/opencv-3.1.0/modules/cudalegacy/src/graphcuts.cpp:191:146: error: ‘nppiGraphcut_32s8u’ was not declared in this scope nsp.step), sznpp, labels.ptr<Npp8u>(), static_cast<int>(labels.step), state) ); ^ /home/ecarx/opencv-3.1.0/modules/core/include/opencv2/core/private.cuda.hpp:165:52: note: in definition of macro ‘nppSafeCall’ #define nppSafeCall(expr) cv::cuda::checkNppError(expr, __FILE__, __LINE__, CV ^ /home/ecarx/opencv-3.1.0/modules/cudalegacy/src/graphcuts.cpp:196:146: error: ‘nppiGraphcut_32f8u’ was not declared in this scope nsp.step), sznpp, labels.ptr<Npp8u>(), static_cast<int>(labels.step), state) ); ^ /home/ecarx/opencv-3.1.0/modules/core/include/opencv2/core/private.cuda.hpp:165:52: note: in definition of macro ‘nppSafeCall’ #define nppSafeCall(expr) cv::cuda::checkNppError(expr, __FILE__, __LINE__, CV ^ /home/ecarx/opencv-3.1.0/modules/cudalegacy/src/graphcuts.cpp: In function ‘void cv::cuda::graphcut(cv::cuda::GpuMat&, cv::cuda::GpuMat&, cv::cuda::GpuMat&, cv::cuda::GpuMat&, cv::cuda::GpuMat&, cv::cuda::GpuMat&, cv::cuda::GpuMat&, cv::cuda::GpuMat&, cv::cuda::GpuMat&, cv::cuda::GpuMat&, cv::cuda::GpuMat&, cv::cuda::Stream&)’: /home/ecarx/opencv-3.1.0/modules/cudalegacy/src/graphcuts.cpp:246:52: error: ‘nppiGraphcut8GetSize’ was not declared in this scope nppSafeCall( nppiGraphcut8GetSize(sznpp, &bufsz) ); ^ /home/ecarx/opencv-3.1.0/modules/core/include/opencv2/core/private.cuda.hpp:165:52: note: in definition of macro ‘nppSafeCall’ #define nppSafeCall(expr) cv::cuda::checkNppError(expr, __FILE__, __LINE__, CV ^ /home/ecarx/opencv-3.1.0/modules/cudalegacy/src/graphcuts.cpp:254:61: error: ‘nppiGraphcut8InitAlloc’ was not declared in this scope NppiGraphcutStateHandler state(sznpp, buf.ptr<Npp8u>(), nppiGraphcut8InitAl ^ In file included from /home/ecarx/opencv-3.1.0/build/modules/cudalegacy/precomp.hpp:75:0: /home/ecarx/opencv-3.1.0/modules/cudalegacy/src/graphcuts.cpp:267:146: error: ‘nppiGraphcut8_32s8u’ was not declared in this scope nsp.step), sznpp, labels.ptr<Npp8u>(), static_cast<int>(labels.step), state) ); ^ /home/ecarx/opencv-3.1.0/modules/core/include/opencv2/core/private.cuda.hpp:165:52: note: in definition of macro ‘nppSafeCall’ #define nppSafeCall(expr) cv::cuda::checkNppError(expr, __FILE__, __LINE__, CV ^ /home/ecarx/opencv-3.1.0/modules/cudalegacy/src/graphcuts.cpp:274:146: error: ‘nppiGraphcut8_32f8u’ was not declared in this scope nsp.step), sznpp, labels.ptr<Npp8u>(), static_cast<int>(labels.step), state) ); ^ /home/ecarx/opencv-3.1.0/modules/core/include/opencv2/core/private.cuda.hpp:165:52: note: in definition of macro ‘nppSafeCall’ #define nppSafeCall(expr) cv::cuda::checkNppError(expr, __FILE__, __LINE__, CV ^ modules/cudalegacy/CMakeFiles/opencv_cudalegacy.dir/build.make:290: recipe for target 'modules/cudalegacy/CMakeFiles/opencv_cudalegacy.dir/src/graphcuts.cpp.o' failed make[2]: *** [modules/cudalegacy/CMakeFiles/opencv_cudalegacy.dir/src/graphcuts.cpp.o] Error 1 make[2]: *** 正在等待未完成的任務.... [ 73%] Linking CXX executable ../../bin/opencv_perf_photo CMakeFiles/Makefile2:9117: recipe for target 'modules/cudalegacy/CMakeFiles/opencv_cudalegacy.dir/all' failed make[1]: *** [modules/cudalegacy/CMakeFiles/opencv_cudalegacy.dir/all] Error 2 make[1]: *** 正在等待未完成的任務.... [ 73%] Built target opencv_perf_photo Makefile:160: recipe for target 'all' failed make: *** [all] Error 2
經屢次嘗試,都不成功。暫時放棄使用,初步猜想是由於,opencv3.10是2015年年底發行的,cuda8.0rc是2016.05發行的,因此自己opencv3.10不支持cuda8.0rc,可是我尚未去github問(opencv2.4.13是2016.05發行,使用正常),後續還會再嘗試,到時再更新。ubuntu
我我的是由於硬件問題,因此環境選ubuntu16.04+cuda8.0rc。若是沒這個限制最好選擇比最新版本低一個版本,以求穩定。ide
不得不說,搭建環境很耗時間,環境穩定後,不要輕易改變。ui