Ubuntu16.04+GTX2070+Driver418.43+CUDA10.1+cuDNN7.6

最近須要用到一臺服務器的GPU跑實驗,其間 COLMAP 編譯過程出錯,提示 cuda 版本不支持html

cv@cv:~/mvs_project/colmap/build$ make
[  0%] Automatic rcc for target flann
[  0%] Built target flann_automoc
[  0%] Building CXX object lib/FLANN/CMakeFiles/flann.dir/flann.cpp.o
[  0%] Building C object lib/FLANN/CMakeFiles/flann.dir/ext/lz4.c.o
[  1%] Building C object lib/FLANN/CMakeFiles/flann.dir/ext/lz4hc.c.o
[  1%] Linking CXX static library libflann.a
[  1%] Built target flann
[  1%] Automatic rcc for target graclus
[  1%] Built target graclus_automoc
[  1%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/util.c.o
[  1%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mincover.c.o
[  3%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/kwayrefine.c.o
[  3%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/refine.c.o
[  3%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/ometis.c.o
[  3%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mmatch.c.o
[  3%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mutil.c.o
[  3%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mpmetis.c.o
[  5%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/balance.c.o
[  5%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mfm2.c.o
[  5%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mesh.c.o
[  5%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/compress.c.o
[  5%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/initpart.c.o
[  7%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/subdomains.c.o
[  7%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/kwayvolfm.c.o
[  7%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/fortran.c.o
[  7%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/pmetis.c.o
[  7%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/kwayfm.c.o
[  9%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/parmetis.c.o
[  9%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/coarsen.c.o
[  9%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mkwayfmh.c.o
[  9%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mbalance2.c.o
[  9%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mbalance.c.o
[ 11%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mmd.c.o
[ 11%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/pqueue.c.o
[ 11%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/estmem.c.o
[ 11%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/myqsort.c.o
[ 11%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/kvmetis.c.o
[ 13%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/fm.c.o
[ 13%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/ccgraph.c.o
[ 13%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/minitpart2.c.o
[ 13%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/bucketsort.c.o
[ 13%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/graph.c.o
[ 15%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mrefine2.c.o
[ 15%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/frename.c.o
[ 15%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/stat.c.o
[ 15%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/debug.c.o
[ 15%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/srefine.c.o
[ 17%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/meshpart.c.o
[ 17%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mrefine.c.o
[ 17%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/kwayvolrefine.c.o
[ 17%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/match.c.o
[ 17%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/kmetis.c.o
[ 19%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mkwayrefine.c.o
[ 19%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/metis.c.o
[ 19%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mcoarsen.c.o
[ 19%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/timing.c.o
[ 19%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mfm.c.o
[ 19%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/memory.c.o
[ 21%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/minitpart.c.o
[ 21%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/sfm.c.o
[ 21%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mkmetis.c.o
[ 21%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/separator.c.o
[ 21%] Building C object lib/Graclus/CMakeFiles/graclus.dir/multilevelLib/wkkm.c.o
[ 23%] Building C object lib/Graclus/CMakeFiles/graclus.dir/multilevelLib/mlkkm.c.o
[ 23%] Linking C static library libgraclus.a
[ 23%] Built target graclus
[ 25%] Automatic rcc for target lsd
[ 25%] Built target lsd_automoc
[ 25%] Building C object lib/LSD/CMakeFiles/lsd.dir/lsd.c.o
[ 25%] Linking C static library liblsd.a
[ 25%] Built target lsd
[ 25%] Automatic rcc for target pba
[ 25%] Built target pba_automoc
[ 25%] Building NVCC (Device) object lib/PBA/CMakeFiles/pba.dir/pba_generated_ProgramCU.cu.o
CMake Error at pba_generated_ProgramCU.cu.o.cmake:207 (message):
  Error generating
  /home/cv/mvs_project/colmap/build/lib/PBA/CMakeFiles/pba.dir//./pba_generated_ProgramCU.cu.o

lib/PBA/CMakeFiles/pba.dir/build.make:63: recipe for target 'lib/PBA/CMakeFiles/pba.dir/pba_generated_ProgramCU.cu.o' failed
make[2]: *** [lib/PBA/CMakeFiles/pba.dir/pba_generated_ProgramCU.cu.o] Error 1
CMakeFiles/Makefile2:485: recipe for target 'lib/PBA/CMakeFiles/pba.dir/all' failed
make[1]: *** [lib/PBA/CMakeFiles/pba.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
colmap_build_error

因而又開始配置環境,首先根據本身機器配置NVIDIA官方網站下載 GeForce 驅動程序linux

>> 檢查機器環境及配置c++

內核版本及操做系統信息git

cv@cv:~/mvs_project/colmap/build$ uname -r
4.15.0-65-generic

cv@cv:~/mvs_project/colmap/build$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 16.04.6 LTS Release: 16.04 Codename: xenial cv@cv:~/mvs_project/colmap/build$ gcc --version gcc (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609 Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

已經安裝過顯卡驅動的機器能夠直接經過 nvidia-smi 命令顯示顯卡型號和驅動版本信息sql

cv@cv:~/mvs_project/colmap/build$ nvidia-smi
Sat Nov 30 10:49:14 2019
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 418.43       Driver Version: 418.43       CUDA Version: 10.1     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce RTX 2070    Off  | 00000000:01:00.0 Off |                  N/A |
|  0%   65C    P0     1W / 210W |      0MiB /  7952MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

對還沒有安裝過顯卡驅動的機器,能夠經過 lspci 指令查詢,grep -i 的意思是忽略後面匹配項的大小寫ubuntu

cv@cv:~/mvs_project/colmap/build$ lspci | grep -i vga | grep -i nvidia
01:00.0 VGA compatible controller: NVIDIA Corporation Device 1f07 (rev a1)

這裏返回的是一串十六進制代碼 1f07,跟咱們日常所見略有不一樣,須要翻譯一下,到 PCI devices 查詢。打不開網頁或者打開很慢的能夠參考放在GitHub上的一份常見型號對應表vim

知道了本身的機器的配置就能夠到上面給出的網站(https://www.geforce.cn/drivers)下載對應的驅動程序。bash

開始安裝驅動以前的準備工做服務器

>> 卸載舊版本或安裝失敗的驅動架構

cv@cv:~/mvs_project/colmap/build$ cd
cv@cv:~$ sudo ./NVIDIA-Linux-x86_64-418.43.run --uninstall

>> 安裝可能須要的依賴

cv@cv:~$ sudo apt update
cv@cv:~$ sudo apt install dkms build-essential linux-headers-generic
cv@cv:~$ sudo apt install gcc-multilib xorg-dev
cv@cv:~$ sudo apt install freeglut3-dev libx11-dev libxmu-dev libxi-dev
cv@cv:~$ sudo apt install libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev

>> 禁用 NOUVEAU 驅動

直接使用 VIM 打開,沒有該文件時自動新建

cv@cv:~$ sudo vim /etc/modprobe.d/blacklist-nouveau.conf

在文件中添加以下內容,保存退出

blacklist nouveau
blacklist lbm-nouveau
options nouveau modeset=0
alias nouveau off
alias lbm-nouveau off

而後執行下面的指令,禁用 nouveau 內核模塊,更新配置,重啓

cv@cv:~$ echo options nouveau modeset=0 | sudo tee -a /etc/modprobe.d/nouveau-kms.conf
cv@cv:~$ sudo update-initramfs -u
cv@cv:~$ sudo reboot

CTRL+ALT+F1 進入命令行模式,輸入下面的命令,若是沒有任何顯示則代表禁用驅動成功了。而後關閉圖形界面,後面要記得從新打開。

cv@cv:~$ lsmod | grep nouveau
cv@cv:~$ sudo service lightdm stop

而後開始安裝顯卡驅動

cv@cv:~$ chmod a+x NVIDIA-Linux-x86_64-418.43.run
cv@cv:~$ sudo ./NVIDIA-Linux-x86_64-418.43.run --dkms --no-opengl-files

-dkms  默認開啓。在 kernel 自行更新時將驅動程序安裝至模塊中,從而阻止驅動程序從新安裝。

–no-opengl-files  表示只安裝驅動文件,不安裝OpenGL文件。這個參數不可省略,不然會致使登錄界面死循環。由於NVIDIA的驅動默認會安裝OpenGL,而Ubuntu的內核自己也有OpenGL且與GUI顯示息息相關,

  一旦NVIDIA的驅動覆蓋了OpenGL,在GUI須要動態連接OpenGL庫的時候就會出現問題。

–no-x-check  表示安裝驅動時不檢查X服務,非必需,已經禁用圖形界面。

–no-nouveau-check  表示安裝驅動時不檢查nouveau,非必需,已經禁用nouveau驅動。

–disable-nouveau  禁用nouveau。非必需,由於以前已經手動禁用了nouveau。

安裝過程當中彈出pre-install script failed的信息,繼續安裝便可,沒有影響。

dkms 選項選yes

32位兼容 選項選yes

x-org 選項保持默認選no

安裝完成後打開圖形桌面。

cv@cv:~$ sudo service lightdm start
cv@cv:~$ nvidia-smi

若是有顯示GPU相關信息表示驅動安裝成功。

卸載CUDA

首先卸載之前安裝的或安裝失敗的CUDA,以便咱們順利進行下面的步驟,直接執行CUDA自帶的卸載腳本。

cv@cv:~$ sudo /usr/local/cuda-9.0/bin/uninstall_cuda_9.0.pl

卸載完成後,清除殘留文件夾。

cv@cv:~$ sudo rm -rf /usr/local/cuda-9.0/

安裝CUDA和CUDNN

>> 首先下載安裝文件,咱們要安裝的是CUDA10.1和CUDNN7.6

根據對應關係到 CUDA 下載頁面尋找本身須要的版本,好比我下載的是 CUDA Toolkit 10.1 update2,選擇好操做系統,系統架構和安裝類型以後下載便可。

 CUDA Toolkit Archive 網站上下載

cuda_10.1.243_418.87.00_linux.run

而後下載CUDNN,須要註冊或登陸NVIDIA帳號,看清楚版本,到 cuDNN Download 網站上 for CUDA 10.1 下載裏面的三個deb安裝包

libcudnn7_7.6.5.32-1+cuda10.1_amd64.deb

libcudnn7-dev_7.6.5.32-1+cuda10.1_amd64.deb

libcudnn7-doc_7.6.5.32-1+cuda10.1_amd64.deb

>> 而後開始安裝 CUDA

cv@cv:~$ sudo service lightdm stop
cv@cv:~$ chmod a+x cuda_10.1.243_418.87.00_linux.run
cv@cv:~$ sudo ./cuda_10.1.243_418.87.00_linux.run

是否贊成條款 accept

選擇安裝界面,除了418.87取消勾選以外其餘保持默認

剩下的都保持默認便可

而後打開配置文件,並在末尾添加連接路徑,保存退出

cv@cv:~$ vim ~/.bashrc
export PATH=/usr/local/cuda-10.1/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH

使生效

cv@cv:~$ source ~/.bashrc

>> 接着安裝 cuDNN

cv@cv:~$ sudo dpkg -i libcudnn7_7.6.5.32-1+cuda10.1_amd64.deb
cv@cv:~$ sudo dpkg -i libcudnn7-dev_7.6.5.32-1+cuda10.1_amd64.deb
cv@cv:~$ sudo dpkg -i libcudnn7-doc_7.6.5.32-1+cuda10.1_amd64.deb

>> 打開圖形界面

cv@cv:~$ sudo service lightdm start

驗證安裝是否成功

>> CUDA 測試,進入到 CUDA 例程路徑下,編譯並測試

cv@cv:~$ cd NVIDIA_CUDA-10.1_Samples/
cv@cv:~/NVIDIA_CUDA-10.1_Samples$ make
cv@cv:~/NVIDIA_CUDA-10.1_Samples$ cd bin/x86_64/linux/release/
cv@cv:~/NVIDIA_CUDA-10.1_Samples/bin/x86_64/linux/release$ ./deviceQuery
./deviceQuery Starting...

 CUDA Device Query (Runtime API) version (CUDART static linking)

Detected 1 CUDA Capable device(s)

Device 0: "GeForce RTX 2070"
  CUDA Driver Version / Runtime Version          10.1 / 10.1
  CUDA Capability Major/Minor version number:    7.5
  Total amount of global memory:                 7952 MBytes (8338604032 bytes)
  (36) Multiprocessors, ( 64) CUDA Cores/MP:     2304 CUDA Cores
  GPU Max Clock rate:                            1710 MHz (1.71 GHz)
  Memory Clock rate:                             7001 Mhz
  Memory Bus Width:                              256-bit
  L2 Cache Size:                                 4194304 bytes
  Maximum Texture Dimension Size (x,y,z)         1D=(131072), 2D=(131072, 65536), 3D=(16384, 16384, 16384)
  Maximum Layered 1D Texture Size, (num) layers  1D=(32768), 2048 layers
  Maximum Layered 2D Texture Size, (num) layers  2D=(32768, 32768), 2048 layers
  Total amount of constant memory:               65536 bytes
  Total amount of shared memory per block:       49152 bytes
  Total number of registers available per block: 65536
  Warp size:                                     32
  Maximum number of threads per multiprocessor:  1024
  Maximum number of threads per block:           1024
  Max dimension size of a thread block (x,y,z): (1024, 1024, 64)
  Max dimension size of a grid size    (x,y,z): (2147483647, 65535, 65535)
  Maximum memory pitch:                          2147483647 bytes
  Texture alignment:                             512 bytes
  Concurrent copy and kernel execution:          Yes with 3 copy engine(s)
  Run time limit on kernels:                     No
  Integrated GPU sharing Host Memory:            No
  Support host page-locked memory mapping:       Yes
  Alignment requirement for Surfaces:            Yes
  Device has ECC support:                        Disabled
  Device supports Unified Addressing (UVA):      Yes
  Device supports Compute Preemption:            Yes
  Supports Cooperative Kernel Launch:            Yes
  Supports MultiDevice Co-op Kernel Launch:      Yes
  Device PCI Domain ID / Bus ID / location ID:   0 / 1 / 0
  Compute Mode:
     < Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >

deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 10.1, CUDA Runtime Version = 10.1, NumDevs = 1
Result = PASS
cv@cv:~/NVIDIA_CUDA-10.1_Samples/bin/x86_64/linux/release$ ./bandwidthTest
[CUDA Bandwidth Test] - Starting...
Running on...

 Device 0: GeForce RTX 2070
 Quick Mode

 Host to Device Bandwidth, 1 Device(s)
 PINNED Memory Transfers
   Transfer Size (Bytes)        Bandwidth(GB/s)
   32000000                     12.8

 Device to Host Bandwidth, 1 Device(s)
 PINNED Memory Transfers
   Transfer Size (Bytes)        Bandwidth(GB/s)
   32000000                     13.1

 Device to Device Bandwidth, 1 Device(s)
 PINNED Memory Transfers
   Transfer Size (Bytes)        Bandwidth(GB/s)
   32000000                     382.0

Result = PASS

NOTE: The CUDA Samples are not meant for performance measurements. Results may vary when GPU Boost is enabled.

>> cuDNN 測試

cv@cv:~$ cat /usr/include/cudnn.h | grep CUDNN_MAJOR -A 2 -m 1
#define CUDNN_MAJOR 7
#define CUDNN_MINOR 6
#define CUDNN_PATCHLEVEL 5
cv@cv:~$ cp -r /usr/src/cudnn_samples_v7/ .
cv@cv:~$ cd cudnn_samples_v7/mnistCUDNN/
cv@cv:~$ make
Linking agains cublasLt = true
CUDA VERSION: 10010
TARGET ARCH: x86_64
HOST_ARCH: x86_64
TARGET OS: linux
SMS: 30 35 50 53 60 61 62 70 72 75
/usr/local/cuda/bin/nvcc -ccbin g++ -I/usr/local/cuda/include -I/usr/local/cuda/include -IFreeImage/include -m64
-gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_50,code=sm_50
-gencode arch=compute_53,code=sm_53 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61
-gencode arch=compute_62,code=sm_62 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_72,code=sm_72
-gencode arch=compute_75,code=sm_75 -gencode arch=compute_75,code=compute_75 -o fp16_dev.o -c fp16_dev.cu
g++ -I/usr/local/cuda/include -I/usr/local/cuda/include -IFreeImage/include   -o fp16_emu.o -c fp16_emu.cpp
g++ -I/usr/local/cuda/include -I/usr/local/cuda/include -IFreeImage/include   -o mnistCUDNN.o -c mnistCUDNN.cpp
/usr/local/cuda/bin/nvcc -ccbin g++   -m64
-gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_50,code=sm_50
-gencode arch=compute_53,code=sm_53 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61
-gencode arch=compute_62,code=sm_62 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_72,code=sm_72
-gencode arch=compute_75,code=sm_75 -gencode arch=compute_75,code=compute_75 -o mnistCUDNN fp16_dev.o fp16_emu.o mnistCUDNN.o
-I/usr/local/cuda/include -I/usr/local/cuda/include -IFreeImage/include
-L/usr/local/cuda/lib64 -L/usr/local/cuda/lib64 -lcublasLt -LFreeImage/lib/linux/x86_64
-LFreeImage/lib/linux -lcudart -lcublas -lcudnn -lfreeimage -lstdc++ -lm
cv@cv:~/cudnn_samples_v7/mnistCUDNN$ ./mnistCUDNN
cudnnGetVersion() : 7605 , CUDNN_VERSION from cudnn.h : 7605 (7.6.5)
Host compiler version : GCC 5.4.0
There are 1 CUDA capable devices on your machine :
device 0 : sms 36  Capabilities 7.5, SmClock 1710.0 Mhz, MemSize (Mb) 7952, MemClock 7001.0 Mhz, Ecc=0, boardGroupID=0
Using device 0

Testing single precision
Loading image data/one_28x28.pgm
Performing forward propagation ...
Testing cudnnGetConvolutionForwardAlgorithm ...
Fastest algorithm is Algo 0
Testing cudnnFindConvolutionForwardAlgorithm ...
^^^^ CUDNN_STATUS_SUCCESS for Algo 0: 0.039040 time requiring 0 memory
^^^^ CUDNN_STATUS_SUCCESS for Algo 1: 0.100576 time requiring 3464 memory
^^^^ CUDNN_STATUS_SUCCESS for Algo 7: 0.122400 time requiring 2057744 memory
^^^^ CUDNN_STATUS_SUCCESS for Algo 5: 0.130560 time requiring 203008 memory
^^^^ CUDNN_STATUS_SUCCESS for Algo 2: 0.173888 time requiring 57600 memory
Resulting weights from Softmax:
0.0000000 0.9999399 0.0000000 0.0000000 0.0000561 0.0000000 0.0000012 0.0000017 0.0000010 0.0000000
Loading image data/three_28x28.pgm
Performing forward propagation ...
Resulting weights from Softmax:
0.0000000 0.0000000 0.0000000 0.9999288 0.0000000 0.0000711 0.0000000 0.0000000 0.0000000 0.0000000
Loading image data/five_28x28.pgm
Performing forward propagation ...
Resulting weights from Softmax:
0.0000000 0.0000008 0.0000000 0.0000002 0.0000000 0.9999820 0.0000154 0.0000000 0.0000012 0.0000006

Result of classification: 1 3 5

Test passed!

Testing half precision (math in single precision)
Loading image data/one_28x28.pgm
Performing forward propagation ...
Testing cudnnGetConvolutionForwardAlgorithm ...
Fastest algorithm is Algo 0
Testing cudnnFindConvolutionForwardAlgorithm ...
^^^^ CUDNN_STATUS_SUCCESS for Algo 0: 0.022528 time requiring 0 memory
^^^^ CUDNN_STATUS_SUCCESS for Algo 1: 0.061344 time requiring 3464 memory
^^^^ CUDNN_STATUS_SUCCESS for Algo 2: 0.065536 time requiring 28800 memory
^^^^ CUDNN_STATUS_SUCCESS for Algo 5: 0.070208 time requiring 203008 memory
^^^^ CUDNN_STATUS_SUCCESS for Algo 4: 0.082592 time requiring 207360 memory
Resulting weights from Softmax:
0.0000001 1.0000000 0.0000001 0.0000000 0.0000563 0.0000001 0.0000012 0.0000017 0.0000010 0.0000001
Loading image data/three_28x28.pgm
Performing forward propagation ...
Resulting weights from Softmax:
0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000714 0.0000000 0.0000000 0.0000000 0.0000000
Loading image data/five_28x28.pgm
Performing forward propagation ...
Resulting weights from Softmax:
0.0000000 0.0000008 0.0000000 0.0000002 0.0000000 1.0000000 0.0000154 0.0000000 0.0000012 0.0000006

Result of classification: 1 3 5

Test passed!

當這些配置好以後,COLMAP 的編譯就很順利地經過了。

cv@cv:~/mvs_project/colmap/build$ cmake ..
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found installed version of Eigen: /usr/lib/cmake/eigen3
-- Found required Ceres dependency: Eigen version 3.2.92 in /usr/include/eigen3
-- Found required Ceres dependency: glog
-- Performing Test GFLAGS_IN_GOOGLE_NAMESPACE
-- Performing Test GFLAGS_IN_GOOGLE_NAMESPACE - Success
-- Found required Ceres dependency: gflags
-- Found Ceres version: 1.14.0 installed in: /usr/local with components: [EigenSparse, SparseLinearAlgebraLibrary, LAPACK, SuiteSparse, CXSparse, SchurSpecializations, OpenMP, Multithreading]
-- Boost version: 1.58.0
-- Found the following Boost libraries:
--   program_options
--   filesystem
--   graph
--   regex
--   system
--   unit_test_framework
-- Found Eigen3: /usr/include/eigen3 (Required is at least version "2.91.0")
-- Found Eigen
--   Includes : /usr/include/eigen3
-- Found FreeImage
--   Includes : /usr/include
--   Libraries : /usr/lib/x86_64-linux-gnu/libfreeimage.so
-- Found Glog
--   Includes : /usr/include
--   Libraries : /usr/lib/x86_64-linux-gnu/libglog.so
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libGL.so
-- Found Glew
--   Includes : /usr/include
--   Libraries : /usr/lib/x86_64-linux-gnu/libGLEW.so
-- Found Git: /usr/bin/git (found version "2.7.4")
-- Found Threads: TRUE
-- Found Qt
--   Module : /usr/lib/x86_64-linux-gnu/cmake/Qt5Core
--   Module : /usr/lib/x86_64-linux-gnu/cmake/Qt5OpenGL
--   Module : /usr/lib/x86_64-linux-gnu/cmake/Qt5Widgets
-- Found CGAL
--   Includes : /usr/include
--   Libraries : /usr/lib/x86_64-linux-gnu/libCGAL.so.11.0.1
-- Build type not specified, using Release
-- Enabling SIMD support
-- Enabling OpenMP support
-- Disabling interprocedural optimization
-- Autodetected CUDA architecture(s):  7.5
-- Enabling CUDA support (version: 10.1, archs: sm_75)
-- Enabling OpenGL support
-- Disabling profiling support
-- Enabling CGAL support
-- Configuring done
-- Generating done
-- Build files have been written to: /home/cv/mvs_project/colmap/build

cv@cv:~/mvs_project/colmap/build$ make
Scanning dependencies of target flann_automoc
[  0%] Automatic rcc for target flann
[  0%] Built target flann_automoc
Scanning dependencies of target flann
[  0%] Building CXX object lib/FLANN/CMakeFiles/flann.dir/flann.cpp.o
[  0%] Building C object lib/FLANN/CMakeFiles/flann.dir/ext/lz4.c.o
[  1%] Building C object lib/FLANN/CMakeFiles/flann.dir/ext/lz4hc.c.o
[  1%] Linking CXX static library libflann.a
[  1%] Built target flann
Scanning dependencies of target graclus_automoc
[  1%] Automatic rcc for target graclus
[  1%] Built target graclus_automoc
Scanning dependencies of target graclus
[  1%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/util.c.o
[  1%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mincover.c.o
[  3%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/kwayrefine.c.o
[  3%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/refine.c.o
[  3%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/ometis.c.o
[  3%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mmatch.c.o
[  3%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mutil.c.o
[  3%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mpmetis.c.o
[  5%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/balance.c.o
[  5%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mfm2.c.o
[  5%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mesh.c.o
[  5%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/compress.c.o
[  5%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/initpart.c.o
[  7%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/subdomains.c.o
[  7%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/kwayvolfm.c.o
[  7%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/fortran.c.o
[  7%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/pmetis.c.o
[  7%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/kwayfm.c.o
[  9%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/parmetis.c.o
[  9%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/coarsen.c.o
[  9%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mkwayfmh.c.o
[  9%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mbalance2.c.o
[  9%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mbalance.c.o
[ 11%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mmd.c.o
[ 11%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/pqueue.c.o
[ 11%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/estmem.c.o
[ 11%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/myqsort.c.o
[ 11%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/kvmetis.c.o
[ 13%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/fm.c.o
[ 13%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/ccgraph.c.o
[ 13%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/minitpart2.c.o
[ 13%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/bucketsort.c.o
[ 13%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/graph.c.o
[ 15%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mrefine2.c.o
[ 15%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/frename.c.o
[ 15%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/stat.c.o
[ 15%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/debug.c.o
[ 15%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/srefine.c.o
[ 17%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/meshpart.c.o
[ 17%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mrefine.c.o
[ 17%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/kwayvolrefine.c.o
[ 17%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/match.c.o
[ 17%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/kmetis.c.o
[ 19%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mkwayrefine.c.o
[ 19%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/metis.c.o
[ 19%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mcoarsen.c.o
[ 19%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/timing.c.o
[ 19%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mfm.c.o
[ 19%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/memory.c.o
[ 21%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/minitpart.c.o
[ 21%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/sfm.c.o
[ 21%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mkmetis.c.o
[ 21%] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/separator.c.o
[ 21%] Building C object lib/Graclus/CMakeFiles/graclus.dir/multilevelLib/wkkm.c.o
[ 23%] Building C object lib/Graclus/CMakeFiles/graclus.dir/multilevelLib/mlkkm.c.o
[ 23%] Linking C static library libgraclus.a
[ 23%] Built target graclus
Scanning dependencies of target lsd_automoc
[ 25%] Automatic rcc for target lsd
[ 25%] Built target lsd_automoc
Scanning dependencies of target lsd
[ 25%] Building C object lib/LSD/CMakeFiles/lsd.dir/lsd.c.o
[ 25%] Linking C static library liblsd.a
[ 25%] Built target lsd
Scanning dependencies of target pba_automoc
[ 25%] Automatic rcc for target pba
[ 25%] Built target pba_automoc
[ 25%] Building NVCC (Device) object lib/PBA/CMakeFiles/pba.dir/pba_generated_ProgramCU.cu.o
Scanning dependencies of target pba
[ 25%] Building CXX object lib/PBA/CMakeFiles/pba.dir/ConfigBA.cpp.o
[ 25%] Building CXX object lib/PBA/CMakeFiles/pba.dir/CuTexImage.cpp.o
[ 25%] Building CXX object lib/PBA/CMakeFiles/pba.dir/pba.cpp.o
[ 27%] Building CXX object lib/PBA/CMakeFiles/pba.dir/SparseBundleCPU.cpp.o
[ 27%] Building CXX object lib/PBA/CMakeFiles/pba.dir/SparseBundleCU.cpp.o
[ 27%] Linking CXX static library libpba.a
[ 27%] Built target pba
Scanning dependencies of target poisson_recon_automoc
[ 27%] Automatic rcc for target poisson_recon
[ 27%] Built target poisson_recon_automoc
Scanning dependencies of target poisson_recon
[ 27%] Building CXX object lib/PoissonRecon/CMakeFiles/poisson_recon.dir/CmdLineParser.cpp.o
[ 29%] Building CXX object lib/PoissonRecon/CMakeFiles/poisson_recon.dir/Factor.cpp.o
[ 29%] Building CXX object lib/PoissonRecon/CMakeFiles/poisson_recon.dir/Geometry.cpp.o
[ 29%] Building CXX object lib/PoissonRecon/CMakeFiles/poisson_recon.dir/MarchingCubes.cpp.o
[ 29%] Building CXX object lib/PoissonRecon/CMakeFiles/poisson_recon.dir/PlyFile.cpp.o
[ 29%] Building CXX object lib/PoissonRecon/CMakeFiles/poisson_recon.dir/PoissonRecon.cpp.o
[ 31%] Building CXX object lib/PoissonRecon/CMakeFiles/poisson_recon.dir/SurfaceTrimmer.cpp.o
[ 31%] Linking CXX static library libpoisson_recon.a
[ 31%] Built target poisson_recon
Scanning dependencies of target sift_gpu_automoc
[ 31%] Automatic rcc for target sift_gpu
[ 31%] Built target sift_gpu_automoc
[ 31%] Building NVCC (Device) object lib/SiftGPU/CMakeFiles/sift_gpu.dir/sift_gpu_generated_ProgramCU.cu.o
Scanning dependencies of target sift_gpu
[ 31%] Building CXX object lib/SiftGPU/CMakeFiles/sift_gpu.dir/FrameBufferObject.cpp.o
[ 33%] Building CXX object lib/SiftGPU/CMakeFiles/sift_gpu.dir/GlobalUtil.cpp.o
[ 33%] Building CXX object lib/SiftGPU/CMakeFiles/sift_gpu.dir/GLTexImage.cpp.o
[ 33%] Building CXX object lib/SiftGPU/CMakeFiles/sift_gpu.dir/ProgramGLSL.cpp.o
[ 33%] Building CXX object lib/SiftGPU/CMakeFiles/sift_gpu.dir/PyramidGL.cpp.o
[ 33%] Building CXX object lib/SiftGPU/CMakeFiles/sift_gpu.dir/ShaderMan.cpp.o
[ 35%] Building CXX object lib/SiftGPU/CMakeFiles/sift_gpu.dir/SiftGPU.cpp.o
[ 35%] Building CXX object lib/SiftGPU/CMakeFiles/sift_gpu.dir/SiftMatch.cpp.o
[ 35%] Building CXX object lib/SiftGPU/CMakeFiles/sift_gpu.dir/SiftPyramid.cpp.o
[ 35%] Building CXX object lib/SiftGPU/CMakeFiles/sift_gpu.dir/CuTexImage.cpp.o
[ 35%] Building CXX object lib/SiftGPU/CMakeFiles/sift_gpu.dir/PyramidCU.cpp.o
[ 35%] Building CXX object lib/SiftGPU/CMakeFiles/sift_gpu.dir/SiftMatchCU.cpp.o
[ 37%] Linking CXX static library libsift_gpu.a
[ 37%] Built target sift_gpu
Scanning dependencies of target sqlite3_automoc
[ 37%] Automatic rcc for target sqlite3
[ 37%] Built target sqlite3_automoc
Scanning dependencies of target sqlite3
[ 37%] Building C object lib/SQLite/CMakeFiles/sqlite3.dir/sqlite3.c.o
[ 37%] Linking C static library libsqlite3.a
[ 37%] Built target sqlite3
Scanning dependencies of target vlfeat_automoc
[ 39%] Automatic rcc for target vlfeat
[ 39%] Built target vlfeat_automoc
...
colmap_build

參考資料

[1] NVIDIA DEVELOPER

[2] CUDA TOOLKIT DOCUMENTATION

[3] Linux(Ubuntu)系統查看顯卡型號

[4] 最全面解析 Ubuntu 16.04 安裝nvidia驅動 以及各類錯誤

[5] Ubuntu安裝和卸載CUDA和CUDNN

[6] Ubuntu server16.04安裝配置驅動418.8七、cuda10.一、cudnn7.6.4.3八、anaconda、pytorch超詳細解決

[7] Ubuntu 16.04 安裝 CUDA10.1 (解決循環登錄的問題)

[8] 【目標檢測】Ubuntu16.04+RTX2070+CUDA10.0+pytorch1.1搭建CenterNet環境

相關文章
相關標籤/搜索
本站公眾號
   歡迎關注本站公眾號,獲取更多信息