Skip to content
eiichiromomma edited this page Aug 17, 2014 · 1 revision

(PCL) kinfu

Kinect Fusionクローン

ビルド方法メモ

CUDA Capability Major/Minor version number

実行時にCUDA Capability Major/Minor version numberが問題となるらしい。 1.2のGeForce GT 240で実行すると

Error: invalid device function

と出てコケる。

Ver. 1.2用にCMakeで

CUDA_ARCH_BIN 12

としてみたが__ballotがなくてmakeの最中にエラー。 デフォルトで出てくる20(2.0)以上のGPUが必要らしい。

ちなみにversion numberはNVIDIA_GPU_Computing_SDKでmakeした後にC/bin/linux/releaseの中にあるdeviceQueryを実行すれば確認できる。

Debian (r3579)

メモ

Mac OS X同様にbuild_cuda_*は全てOFF、OpenCVはアンインストールしてビルドする。 不足しているライブラリはソースから入れるかPCLのサイトで配布しているパッケージを導入。

実行結果

$ kinfu_app 
Device 0:  "GeForce GTX 460"   768Mb, sm_21, 336 cores, Driver/Runtime ver.4.0/4.0

となって無事実行された。

deviceQueryの結果

./deviceQuery Starting...
Device 0: "GeForce GTX 460"
CUDA Driver Version / Runtime Version          4.0 / 4.0
CUDA Capability Major/Minor version number:    2.1
Total amount of global memory:                 768 MBytes (804978688 bytes)
( 7) Multiprocessors x (48) CUDA Cores/MP:     336 CUDA Cores
GPU Clock Speed:                               1.40 GHz
Memory Clock rate:                             1848.00 Mhz
Memory Bus Width:                              192-bit
L2 Cache Size:                                 393216 bytes
Max Texture Dimension Size (x,y,z)             1D=(65536), 2D=(65536,65535), 3D=(2048,2048,2048)
Max Layered Texture Size (dim) x layers        1D=(16384) x 2048, 2D=(16384,16384) x 2048
Total amount of constant memory:               65536 bytes
Total amount of shared memory per block:       49152 bytes
Total number of registers available per block: 32768
Warp size:                                     32
Maximum number of threads per block:           1024
Maximum sizes of each dimension of a block:    1024 x 1024 x 64
Maximum sizes of each dimension of a grid:     65535 x 65535 x 65535
Maximum memory pitch:                          2147483647 bytes
Texture alignment:                             512 bytes
Concurrent copy and execution:                 Yes with 1 copy engine(s)
Run time limit on kernels:                     No
Integrated GPU sharing Host Memory:            No
Support host page-locked memory mapping:       Yes
Concurrent kernel execution:                   Yes
Alignment requirement for Surfaces:            Yes
Device has ECC support enabled:                No
Device is using TCC driver mode:               No
Device supports Unified Addressing (UVA):      Yes
Device PCI Bus ID / PCI location ID:           4 / 0
Compute Mode:
   < Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >

Mac OS X(r3550)

Kinfuが入っているtrunkのPointCloudLibrary(PCL)はOpenCVが入っているとCUDA周りで干渉するのでuninstallしておく。

CMakeCache.txtを削除して、CMakeでBUILD_cuda_*を全てOFFにすればビルド可能。 但し存在しないImageViewer::setNameを参照しようとしているのでエラーが出る。ウィンドウの名称だけのようなので取り敢えずコメントアウトしたらmakeは通った。

が、Macbook AirのGPUでは非力すぎるのか

/usr/local/bin/kinfu_app 
Device 0:  "GeForce 320M"   253Mb, sm_12, 48 cores, Driver/Runtime ver.4.0/4.0
Error: out of memory /Users/xxx/sandbox/PCL/cuda/containers/src/device_memory.cpp:258

と出て終了。(追記: それ以前にCompute Capabilityが足りなかった。CUDA - Wikipedia, the free encyclopedia にある2.0以上のGPUを使えればMacでも?)

Clone this wiki locally