kaldi+cuda安装

1.下载kaldi

2.在tools下面按照步骤安装

3.vim .bashrc修改环境变量

export PATH=/usr/local/cuda-8.0/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64$LD_LIBRARY_PATH

source .bashrc激活环境变量

4.到src目录下,在configure文件26%左右修改

for base in /usr/local/share/cuda /usr/loc /cuda-8.0 /usr/; do

调用自己的环境变量

5.在src目录下编译

make clean

./configure --shared

 make depend -j 8

make -j 8

 

6.单独编译 cudamatrix

cd kaldi/src/cudamatrix/

 把Makefile文件中的 TESTFILES 改成 BINFILES

make all

./cu-vector-test

如果不报错并显示如下信息,则说明 CUDA 进行矩阵运算了

./cu-vector-test 
LOG (cu-vector-test[5.4.105~2-4fda]:SelectGpuId():cu-device.cc:123) Manually selected to compute on CPU.
-1.05384e+09 -1.05384e+09
-2.15126e+08 -2.15126e+08
LOG (cu-vector-test[5.4.105~2-4fda]:main():cu-vector-test.cc:859) Tests without GPU use succeeded.
WARNING (cu-vector-test[5.4.105~2-4fda]:SelectGpuId():cu-device.cc:196) Not in compute-exclusive mode.  Suggestion: use 'nvidia-smi -c 3' to set compute exclusive mode
LOG (cu-vector-test[5.4.105~2-4fda]:SelectGpuIdAuto():cu-device.cc:315) Selecting from 1 GPUs
LOG (cu-vector-test[5.4.105~2-4fda]:SelectGpuIdAuto():cu-device.cc:330) cudaSetDevice(0): Tesla K40c    free:412M, used:11028M, total:11441M, free/total:0.0360703
LOG (cu-vector-test[5.4.105~2-4fda]:SelectGpuIdAuto():cu-device.cc:379) Trying to select device: 0 (automatically), mem_ratio: 0.0360703
LOG (cu-vector-test[5.4.105~2-4fda]:SelectGpuIdAuto():cu-device.cc:398) Success selecting device 0 free mem ratio: 0.0360703
LOG (cu-vector-test[5.4.105~2-4fda]:FinalizeActiveGpu():cu-device.cc:247) The active GPU is [0]: Tesla K40c    free:366M, used:11074M, total:11441M, free/total:0.0320389 version 3.5
4.52132e+08 4.52132e+08
1.38749e+09 1.38749e+09
LOG (cu-vector-test[5.4.105~2-4fda]:main():cu-vector-test.cc:861) Tests with GPU use (if available) succeeded.
LOG (cu-vector-test[5.4.105~2-4fda]:PrintProfile():cu-device.cc:449) -----
[cudevice profile]
CuVectorBase::ApplyCeiling    0.0205135s
CuVectorBase::MulTp    0.0229831s
AddTpVec    0.0262518s
Sum    0.0361161s
CuVector::CopyFromVecH2D    0.0428603s
CopyRowsFromVec    0.061161s
CuVectorBase::CopyColFromMat    0.077713s
AddVec    0.0862093s
CopyToVec    0.101046s
CopyFromVec    0.15156s
CuMatrix::Resize    0.159565s
VecVec    0.252803s
CuVector::SetZero    0.55053s
CuVector::Resize    0.782922s
RandGaussian    6.31372s
Total GPU time:    8.93733s (may involve some double-counting)
-----
LOG (cu-vector-test[5.4.105~2-4fda]:PrintMemoryUsage():cu-allocator.cc:127) Memory usage: 16257160 bytes currently allocated (max: 16348884); 0 currently in use by user (max: 12585152); 1292/2299 calls to Malloc* resulted in CUDA calls.
LOG (cu-vector-test[5.4.105~2-4fda]:PrintMemoryUsage():cu-allocator.cc:136) Time taken in cudaMallocPitch=0.0663958, in cudaMalloc=0.106217, in cudaFree=0.113429, in this->MallocPitch()=0.346224
LOG (cu-vector-test[5.4.105~2-4fda]:PrintMemoryUsage():cu-device.cc:422) Memory used (according to the device): 20447232 bytes.
 

 

 

    

  • 2
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值