最近需要用到一台服务器的GPU跑实验,其间 COLMAP 编译过程出错,提示 cuda 版本不支持,cmake虽然通过了,但其实没有找到支持的CUDA架构。

cv@cv:~/mvs_project/colmap/build$ cmake ..
...
-- Automatic GPU detection failed. Building for common architectures.
-- Autodetected CUDA architecture(s): 3.0;3.5;5.0;5.2;6.0;6.1;7.0;7.0+PTX
-- Enabling CUDA support (version: 9.0, archs: sm_30 sm_35 sm_50 sm_52 sm_60 sm_61 sm_70 compute_70)
...
cv@cv:~/mvs_project/colmap/build$ make
[ %] Automatic rcc for target flann
[ %] Built target flann_automoc
[ %] Building CXX object lib/FLANN/CMakeFiles/flann.dir/flann.cpp.o
[ %] Building C object lib/FLANN/CMakeFiles/flann.dir/ext/lz4.c.o
[ %] Building C object lib/FLANN/CMakeFiles/flann.dir/ext/lz4hc.c.o
[ %] Linking CXX static library libflann.a
[ %] Built target flann
[ %] Automatic rcc for target graclus
[ %] Built target graclus_automoc
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/util.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mincover.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/kwayrefine.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/refine.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/ometis.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mmatch.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mutil.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mpmetis.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/balance.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mfm2.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mesh.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/compress.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/initpart.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/subdomains.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/kwayvolfm.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/fortran.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/pmetis.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/kwayfm.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/parmetis.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/coarsen.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mkwayfmh.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mbalance2.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mbalance.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mmd.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/pqueue.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/estmem.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/myqsort.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/kvmetis.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/fm.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/ccgraph.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/minitpart2.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/bucketsort.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/graph.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mrefine2.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/frename.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/stat.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/debug.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/srefine.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/meshpart.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mrefine.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/kwayvolrefine.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/match.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/kmetis.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mkwayrefine.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/metis.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mcoarsen.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/timing.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mfm.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/memory.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/minitpart.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/sfm.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mkmetis.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/separator.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/multilevelLib/wkkm.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/multilevelLib/mlkkm.c.o
[ %] Linking C static library libgraclus.a
[ %] Built target graclus
[ %] Automatic rcc for target lsd
[ %] Built target lsd_automoc
[ %] Building C object lib/LSD/CMakeFiles/lsd.dir/lsd.c.o
[ %] Linking C static library liblsd.a
[ %] Built target lsd
[ %] Automatic rcc for target pba
[ %] Built target pba_automoc
[ %] Building NVCC (Device) object lib/PBA/CMakeFiles/pba.dir/pba_generated_ProgramCU.cu.o
CMake Error at pba_generated_ProgramCU.cu.o.cmake: (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:: recipe for target 'lib/PBA/CMakeFiles/pba.dir/pba_generated_ProgramCU.cu.o' failed
make[]: *** [lib/PBA/CMakeFiles/pba.dir/pba_generated_ProgramCU.cu.o] Error
CMakeFiles/Makefile2:: recipe for target 'lib/PBA/CMakeFiles/pba.dir/all' failed
make[]: *** [lib/PBA/CMakeFiles/pba.dir/all] Error
Makefile:: recipe for target 'all' failed
make: *** [all] Error

colmap_build_error

于是又开始配置环境,首先根据自己机器配置NVIDIA官方网站下载 GeForce 驱动程序

>> 检查机器环境及配置

内核版本及操作系统信息

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. LTS
Release: 16.04
Codename: xenial cv@cv:~/mvs_project/colmap/build$ gcc --version
gcc (Ubuntu 5.4.-6ubuntu1~16.04.) 5.4.
Copyright (C) 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 命令显示显卡型号和驱动版本信息

cv@cv:~/mvs_project/colmap/build$ nvidia-smi
Sat Nov ::
+-----------------------------------------------------------------------------+
| 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. |
|===============================+======================+======================|
| GeForce RTX Off | ::00.0 Off | N/A |
| % 65C P0 1W / 210W | 0MiB / 7952MiB | % Default |
+-------------------------------+----------------------+----------------------+ +-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| No running processes found |
+-----------------------------------------------------------------------------+

对尚未安装过显卡驱动的机器,可以通过 lspci 指令查询,grep -i 的意思是忽略后面匹配项的大小写

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

这里返回的是一串十六进制代码 1f07,跟我们平常所见略有不同,需要翻译一下,到 PCI devices 查询。打不开网页或者打开很慢的可以参考放在GitHub上的一份常见型号对应表

知道了自己的机器的配置就可以到上面给出的网站(https://www.geforce.cn/drivers)下载对应的驱动程序。

开始安装驱动之前的准备工作

>> 卸载旧版本或安装失败的驱动

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=
alias nouveau off
alias lbm-nouveau off

然后执行下面的指令,禁用 nouveau 内核模块,更新配置,重启

cv@cv:~$ echo options nouveau modeset= | 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..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..243_418..00_linux.run
cv@cv:~$ sudo ./cuda_10..243_418..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

这是应该已经可以查看CUDA安装版本了

cv@cv:~$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 20xx-20xx NVIDIA Corporation
Built on Tue_Jan_10_13::03_CST_20xx
Cuda compilation tools, release 10.1, V10..x

>> 接着安装 cuDNN

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

>> 打开图形界面

cv@cv:~$ sudo service lightdm start

验证安装是否成功

>> CUDA 测试,进入到 CUDA 例程路径下,编译并测试

cv@cv:~$ cd NVIDIA_CUDA-.1_Samples/
cv@cv:~/NVIDIA_CUDA-.1_Samples$ make
cv@cv:~/NVIDIA_CUDA-.1_Samples$ cd bin/x86_64/linux/release/
cv@cv:~/NVIDIA_CUDA-.1_Samples/bin/x86_64/linux/release$ ./deviceQuery
./deviceQuery Starting... CUDA Device Query (Runtime API) version (CUDART static linking) Detected CUDA Capable device(s) Device : "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: MBytes ( bytes)
() Multiprocessors, ( ) CUDA Cores/MP: CUDA Cores
GPU Max Clock rate: MHz (1.71 GHz)
Memory Clock rate: Mhz
Memory Bus Width: -bit
L2 Cache Size: bytes
Maximum Texture Dimension Size (x,y,z) 1D=(), 2D=(, ), 3D=(, , )
Maximum Layered 1D Texture Size, (num) layers 1D=(), layers
Maximum Layered 2D Texture Size, (num) layers 2D=(, ), layers
Total amount of constant memory: bytes
Total amount of shared memory per block: bytes
Total number of registers available per block:
Warp size:
Maximum number of threads per multiprocessor:
Maximum number of threads per block:
Max dimension size of a thread block (x,y,z): (, , )
Max dimension size of a grid size (x,y,z): (, , )
Maximum memory pitch: bytes
Texture alignment: bytes
Concurrent copy and kernel execution: Yes with 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: / /
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 =
Result = PASS
cv@cv:~/NVIDIA_CUDA-.1_Samples/bin/x86_64/linux/release$ ./bandwidthTest
[CUDA Bandwidth Test] - Starting...
Running on... Device : GeForce RTX
Quick Mode Host to Device Bandwidth, Device(s)
PINNED Memory Transfers
Transfer Size (Bytes) Bandwidth(GB/s)
12.8 Device to Host Bandwidth, Device(s)
PINNED Memory Transfers
Transfer Size (Bytes) Bandwidth(GB/s)
13.1 Device to Device Bandwidth, Device(s)
PINNED Memory Transfers
Transfer Size (Bytes) Bandwidth(GB/s)
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  -m
#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:
TARGET ARCH: x86_64
HOST_ARCH: x86_64
TARGET OS: linux
SMS:
/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() : , CUDNN_VERSION from cudnn.h : (7.6.)
Host compiler version : GCC 5.4.
There are CUDA capable devices on your machine :
device : sms Capabilities 7.5, SmClock 1710.0 Mhz, MemSize (Mb) , MemClock 7001.0 Mhz, Ecc=, boardGroupID=
Using device Testing single precision
Loading image data/one_28x28.pgm
Performing forward propagation ...
Testing cudnnGetConvolutionForwardAlgorithm ...
Fastest algorithm is Algo
Testing cudnnFindConvolutionForwardAlgorithm ...
^^^^ CUDNN_STATUS_SUCCESS for Algo : 0.039040 time requiring memory
^^^^ CUDNN_STATUS_SUCCESS for Algo : 0.100576 time requiring memory
^^^^ CUDNN_STATUS_SUCCESS for Algo : 0.122400 time requiring memory
^^^^ CUDNN_STATUS_SUCCESS for Algo : 0.130560 time requiring memory
^^^^ CUDNN_STATUS_SUCCESS for Algo : 0.173888 time requiring 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: Test passed! Testing half precision (math in single precision)
Loading image data/one_28x28.pgm
Performing forward propagation ...
Testing cudnnGetConvolutionForwardAlgorithm ...
Fastest algorithm is Algo
Testing cudnnFindConvolutionForwardAlgorithm ...
^^^^ CUDNN_STATUS_SUCCESS for Algo : 0.022528 time requiring memory
^^^^ CUDNN_STATUS_SUCCESS for Algo : 0.061344 time requiring memory
^^^^ CUDNN_STATUS_SUCCESS for Algo : 0.065536 time requiring memory
^^^^ CUDNN_STATUS_SUCCESS for Algo : 0.070208 time requiring memory
^^^^ CUDNN_STATUS_SUCCESS for Algo : 0.082592 time requiring 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: Test passed!

当这些配置好之后,COLMAP 的编译就很顺利地通过了。

cv@cv:~/mvs_project/colmap/build$ cmake ..
-- The C compiler identification is GNU 5.4.
-- The CXX compiler identification is GNU 5.4.
-- 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. 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. installed in: /usr/local with components: [EigenSparse, SparseLinearAlgebraLibrary, LAPACK, SuiteSparse, CXSparse, SchurSpecializations, OpenMP, Multithreading]
-- Boost version: 1.58.
-- 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.
-- 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
[ %] Automatic rcc for target flann
[ %] Built target flann_automoc
Scanning dependencies of target flann
[ %] Building CXX object lib/FLANN/CMakeFiles/flann.dir/flann.cpp.o
[ %] Building C object lib/FLANN/CMakeFiles/flann.dir/ext/lz4.c.o
[ %] Building C object lib/FLANN/CMakeFiles/flann.dir/ext/lz4hc.c.o
[ %] Linking CXX static library libflann.a
[ %] Built target flann
Scanning dependencies of target graclus_automoc
[ %] Automatic rcc for target graclus
[ %] Built target graclus_automoc
Scanning dependencies of target graclus
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/util.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mincover.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/kwayrefine.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/refine.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/ometis.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mmatch.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mutil.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mpmetis.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/balance.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mfm2.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mesh.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/compress.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/initpart.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/subdomains.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/kwayvolfm.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/fortran.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/pmetis.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/kwayfm.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/parmetis.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/coarsen.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mkwayfmh.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mbalance2.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mbalance.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mmd.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/pqueue.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/estmem.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/myqsort.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/kvmetis.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/fm.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/ccgraph.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/minitpart2.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/bucketsort.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/graph.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mrefine2.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/frename.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/stat.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/debug.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/srefine.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/meshpart.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mrefine.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/kwayvolrefine.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/match.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/kmetis.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mkwayrefine.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/metis.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mcoarsen.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/timing.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mfm.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/memory.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/minitpart.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/sfm.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/mkmetis.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/metisLib/separator.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/multilevelLib/wkkm.c.o
[ %] Building C object lib/Graclus/CMakeFiles/graclus.dir/multilevelLib/mlkkm.c.o
[ %] Linking C static library libgraclus.a
[ %] Built target graclus
Scanning dependencies of target lsd_automoc
[ %] Automatic rcc for target lsd
[ %] Built target lsd_automoc
Scanning dependencies of target lsd
[ %] Building C object lib/LSD/CMakeFiles/lsd.dir/lsd.c.o
[ %] Linking C static library liblsd.a
[ %] Built target lsd
Scanning dependencies of target pba_automoc
[ %] Automatic rcc for target pba
[ %] Built target pba_automoc
[ %] Building NVCC (Device) object lib/PBA/CMakeFiles/pba.dir/pba_generated_ProgramCU.cu.o
Scanning dependencies of target pba
[ %] Building CXX object lib/PBA/CMakeFiles/pba.dir/ConfigBA.cpp.o
[ %] Building CXX object lib/PBA/CMakeFiles/pba.dir/CuTexImage.cpp.o
[ %] Building CXX object lib/PBA/CMakeFiles/pba.dir/pba.cpp.o
[ %] Building CXX object lib/PBA/CMakeFiles/pba.dir/SparseBundleCPU.cpp.o
[ %] Building CXX object lib/PBA/CMakeFiles/pba.dir/SparseBundleCU.cpp.o
[ %] Linking CXX static library libpba.a
[ %] Built target pba
Scanning dependencies of target poisson_recon_automoc
[ %] Automatic rcc for target poisson_recon
[ %] Built target poisson_recon_automoc
Scanning dependencies of target poisson_recon
[ %] Building CXX object lib/PoissonRecon/CMakeFiles/poisson_recon.dir/CmdLineParser.cpp.o
[ %] Building CXX object lib/PoissonRecon/CMakeFiles/poisson_recon.dir/Factor.cpp.o
[ %] Building CXX object lib/PoissonRecon/CMakeFiles/poisson_recon.dir/Geometry.cpp.o
[ %] Building CXX object lib/PoissonRecon/CMakeFiles/poisson_recon.dir/MarchingCubes.cpp.o
[ %] Building CXX object lib/PoissonRecon/CMakeFiles/poisson_recon.dir/PlyFile.cpp.o
[ %] Building CXX object lib/PoissonRecon/CMakeFiles/poisson_recon.dir/PoissonRecon.cpp.o
[ %] Building CXX object lib/PoissonRecon/CMakeFiles/poisson_recon.dir/SurfaceTrimmer.cpp.o
[ %] Linking CXX static library libpoisson_recon.a
[ %] Built target poisson_recon
Scanning dependencies of target sift_gpu_automoc
[ %] Automatic rcc for target sift_gpu
[ %] Built target sift_gpu_automoc
[ %] Building NVCC (Device) object lib/SiftGPU/CMakeFiles/sift_gpu.dir/sift_gpu_generated_ProgramCU.cu.o
Scanning dependencies of target sift_gpu
[ %] Building CXX object lib/SiftGPU/CMakeFiles/sift_gpu.dir/FrameBufferObject.cpp.o
[ %] Building CXX object lib/SiftGPU/CMakeFiles/sift_gpu.dir/GlobalUtil.cpp.o
[ %] Building CXX object lib/SiftGPU/CMakeFiles/sift_gpu.dir/GLTexImage.cpp.o
[ %] Building CXX object lib/SiftGPU/CMakeFiles/sift_gpu.dir/ProgramGLSL.cpp.o
[ %] Building CXX object lib/SiftGPU/CMakeFiles/sift_gpu.dir/PyramidGL.cpp.o
[ %] Building CXX object lib/SiftGPU/CMakeFiles/sift_gpu.dir/ShaderMan.cpp.o
[ %] Building CXX object lib/SiftGPU/CMakeFiles/sift_gpu.dir/SiftGPU.cpp.o
[ %] Building CXX object lib/SiftGPU/CMakeFiles/sift_gpu.dir/SiftMatch.cpp.o
[ %] Building CXX object lib/SiftGPU/CMakeFiles/sift_gpu.dir/SiftPyramid.cpp.o
[ %] Building CXX object lib/SiftGPU/CMakeFiles/sift_gpu.dir/CuTexImage.cpp.o
[ %] Building CXX object lib/SiftGPU/CMakeFiles/sift_gpu.dir/PyramidCU.cpp.o
[ %] Building CXX object lib/SiftGPU/CMakeFiles/sift_gpu.dir/SiftMatchCU.cpp.o
[ %] Linking CXX static library libsift_gpu.a
[ %] Built target sift_gpu
Scanning dependencies of target sqlite3_automoc
[ %] Automatic rcc for target sqlite3
[ %] Built target sqlite3_automoc
Scanning dependencies of target sqlite3
[ %] Building C object lib/SQLite/CMakeFiles/sqlite3.dir/sqlite3.c.o
[ %] Linking C static library libsqlite3.a
[ %] Built target sqlite3
Scanning dependencies of target vlfeat_automoc
[ %] Automatic rcc for target vlfeat
[ %] 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.87、cuda10.1、cudnn7.6.4.38、anaconda、pytorch超详细解决

[7] Ubuntu 16.04 安装 CUDA10.1 (解决循环登陆的问题)

[8] 【目标检测】Ubuntu16.04+RTX2070+CUDA10.0+pytorch1.1搭建CenterNet环境

Ubuntu16.04+GTX2070+Driver418.43+CUDA10.1+cuDNN7.6的更多相关文章

  1. 深度学习环境配置:Ubuntu16.04下安装GTX1080Ti+CUDA9.0+cuDNN7.0完整安装教程(多链接多参考文章)

    本来就对Linux不熟悉,经过几天惨痛的教训,参考了不知道多少篇文章,终于把环境装好了,每篇文章或多或少都有一些用,但没有一篇完整的能解决我安装过程碰到的问题,所以决定还是自己写一篇我安装过程的教程, ...

  2. Ubuntu16.04下nvidia驱动+nvidia-docker+cuda9+cudnn7安装

    一.宿主机安装nvidia驱动 打开终端,先删除旧的驱动: sudo apt-get purge nvidia* 禁用自带的 nouveau nvidia驱动 sudo gedit /etc/modp ...

  3. (解决某些疑难杂症)Ubuntu16.04 + NVIDIA显卡驱动 + cuda10 + cudnn 安装教程

    一.NVIDIA显卡驱动 打开终端,输入: sudo nautilus 在新打开的文件夹中,进入以下路径(不要用命令行): 左下角点计算机,lib,modules 这时会有几个文件夹,对每个文件夹都进 ...

  4. ubuntu16.04 安装NVIDIA和CUDA9.2 cudNN7.1

    1.安装NVIDIA驱动 (1)查询NVIDIA驱动 首先去官网(http://www.nvidia.com/Download/index.aspx?lang=en-us)查看适合自己显卡的驱动(下载 ...

  5. 【MindSpore】Ubuntu16.04上成功安装GPU版MindSpore1.0.1

    本文是在宿主机Ubuntu16.04上拉取cuda10.1-cudnn7-ubuntu18.04的镜像,在容器中通过Miniconda3创建python3.7.5的环境并成功安装mindspore_g ...

  6. ubuntu16.04配置tensorflow-gpu环境

    1.安装驱动 参考: 史上最全的ubuntu16.04安装nvidia驱动+cuda9.0+cuDnn7.0 https://blog.csdn.net/qq_31215157/article/det ...

  7. Ubuntu16.04 + CUDA9.0 + cuDNN7.3 + Tensorflow-gpu-1.12 + Jupyter Notebook 深度学习环境配置

    目录 一.Ubuntu16.04 LTS系统的安装 二.设置软件源的国内镜像 1. 设置方法 2.关于ubuntu镜像的小知识 三.Nvidia显卡驱动的安装 1. 首先查看显卡型号和推荐的显卡驱动 ...

  8. Ubuntu16.04安装cuda9.0+cudnn7.0

    Ubuntu16.04安装cuda9.0+cudnn7.0 这篇记录拖了好久,估计是去年6月份就已经安装过几遍,然后一方面因为俺比较懒,一方面后面没有经常在自己电脑上跑算法,比较少装cuda和cudn ...

  9. ubuntu16.04+cuda9+cudnn7+tensorflow+pycharm环境搭建

    安装环境:ubuntu16.04+cuda9+cudnn7+tensorflow+pycharm 1)前期搭建过程主要是按照这篇博文,对于版本选择,安装步骤都讲得很详细,亲测有效! https://b ...

随机推荐

  1. Java描述设计模式(24):备忘录模式

    本文源码:GitHub·点这里 || GitEE·点这里 一.生活场景 1.场景描述 常见的视频播放软件都具备这样一个功能:假设在播放视频西游记,如果这时候切换播放视频红楼梦,当再次切回播放西游记时, ...

  2. java之初见

    1.Java语言的了解: Java语言最早是由SUN公司创造出来的,1991年,SUN公司的green项目,Oak,随后SUN公司和后来的甲骨文公司又先后发布了java1.0,1.1,1.2,1.3, ...

  3. linux服务器cpu信息查看详解

    在linux系统中,提供了/proc目录下文件,显示系统的软硬件信息.如果想了解系统中CPU的提供商和相关配置信息,则可以查/proc/cpuinfo.但是此文件输出项较多,不易理解.例如我们想获取, ...

  4. SpringCloud Alibaba微服务实战一 - 基础环境准备

    Springcloud Aibaba现在这么火,我一直想写个基于Springcloud Alibaba一步一步构建微服务架构的系列博客,终于下定决心从今天开始本系列文章的第一篇 - 基础环境准备. 该 ...

  5. hadoop全分布式的搭建

    修改主机名:vim /etc/sysconfig/network 1 修改 hadoop-env.sh 2 修改core-site.xml /hadoop/tmpdir: 产生 namenode中fs ...

  6. easyui textbox 赋值

    $('#fireInfo').textbox('setValue', tempData.fireInfo); $('#fireStartTime').datetimebox('setValue', t ...

  7. day20191009jdbc学习笔记

    周三Wednesday JDBC(Java DataBase Connectivity,java数据库连接)是一种用于执行SQL语句的Java API,可以为多种关系数据库提供统一访问,它由一组用Ja ...

  8. 细说JVM内存模型

    细说JVM内存模型 前言 在正式学习 JVM 内存模型之前,先注意以下几个是问题: JVM 内存模型与 JAVA 内存模型不是同一个概念.JVM 内存模型是从运行时数据区的结构的角度描述的概念:而 J ...

  9. MySql简单的增删改查语句 js

    最近在项目中需要连接数据库,做增删改查的功能,sql语句整理做了以下记录(基于NodeJs,注:data为你的真实数据): (一)新增插入表中数据: sql: 'insert into work(表名 ...

  10. 怎么解决js中如滑动到最底端一次操作触发多次

    定义一个布尔类型到标志,处理中将起设置为true ,处理完改完false,逻辑: data{ isInProcessing:false } //逻辑函数过程中: if(isInProcessing){ ...