kaidi中 install cuda

1,   官網網址, cuda  nvidia   ubuntu-linux  install

http://docs.nvidia.com/cuda/cuda-getting-started-guide-for-linux/index.html#ubuntu-installation



2 ,  lspci | grep -i nvidia

GeForce GTX 750

3,  https://developer.nvidia.com/cuda-gpus  , 查看 GeForce GTX 750

得到 GeForce GTX 750  5.0 (Compute Capability )

4,  


dpkg -i cuda-repo-ubuntu1504_7.5-14_amd64.deb  (注意 根據官網,和自身機器型號來裝)

 apt-get update

安裝 cuda:apt-get install cuda

check cuda install: nvcc --version



5,  ./tools  ./src 都重新裝一遍

其中  

src/cudamatrix 中 Makefile 中修改 CUDA_ARCH =-gencode 那一行.我用的是 geforce 750 顯卡計算能力爲 5,

則修改compute=50,code=sm_50,把TESTFILES 改爲 BINFILES(根據官網的數據修改, 第三步來)



在cudamatrix 中測試

./cu-vector-test

LOG (cu-vector-test:SelectGpuId():cu-device.cc:103) Manually selected to compute on CPU.

2.474e+09 2.474e+09

5.69062e+07 5.69062e+07

LOG (cu-vector-test:main():cu-vector-test.cc:765) Tests without GPU use succeeded.

LOG (cu-vector-test:SelectGpuIdAuto():cu-device.cc:288) Selecting from 1 GPUs

LOG (cu-vector-test:SelectGpuIdAuto():cu-device.cc:303) cudaSetDevice(0): GeForce GTX 750    free:1630M, used:416M, total:2047M, free/total:0.796639

LOG (cu-vector-test:SelectGpuIdAuto():cu-device.cc:352) Trying to select device: 0 (automatically), mem_ratio: 0.796639

LOG (cu-vector-test:SelectGpuIdAuto():cu-device.cc:371) Success selecting device 0 free mem ratio: 0.796639

LOG (cu-vector-test:FinalizeActiveGpu():cu-device.cc:213) The active GPU is [0]: GeForce GTX 750    free:1622M, used:424M, total:2047M, free/total:0.792731 version 5.0

2.61506e+08 2.61506e+08

2.12365e+09 2.12365e+09

LOG (cu-vector-test:main():cu-vector-test.cc:767) Tests with GPU use (if available) succeeded.

LOG (cu-vector-test:PrintProfile():cu-device.cc:415) -----

[cudevice profile]

CuMatrix::CopyToMatD2H    0.00232148s

CuVector::CopyFromVecH2D    0.00253987s

AddVec    0.00312328s

CopyRowsFromMat    0.0035851s

CopyFromVec    0.00370455s

CopyToVec    0.00441456s

AddMatMat    0.00453591s

CuVectorBase::CopyColFromMat    0.0058372s

CopyRowsFromVec    0.00752211s

CuVectorBase::CopyRowsFromMat    0.00919819s

CuMatrix::Resize    0.0107021s

VecVec    0.0123014s

CuVector::SetZero    0.0161092s

CuVector::Resize    0.0247462s

RandGaussian    0.555742s

Total GPU time:    0.679858s (may involve some double-counting)

-----

LOG (cu-vector-test:PrintMemoryUsage():cu-allocator.cc:127) Memory usage: 4991268 bytes currently allocated (max: 4991268); 0 currently in use by user (max: 3462368); 1757/3466 calls to Malloc* resulted in CUDA calls.

LOG (cu-vector-test:PrintMemoryUsage():cu-allocator.cc:134) Time taken in cudaMallocPitch=0.00498128, in cudaMalloc=0.0170541, in cudaFree=0.0164499, in this->MallocPitch()=0.0405507

LOG (cu-vector-test:PrintMemoryUsage():cu-device.cc:388) Memory used (according to the device): 10485760 bytes.


這樣cuda在kaldi就裝好了。




export PATH=/usr/local/cuda/bin:$PATH

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章