kaidi中 install cuda
生活随笔
收集整理的這篇文章主要介紹了
kaidi中 install cuda
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
1,?? 官網(wǎng)網(wǎng)址, 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? (注意 根據(jù)官網(wǎng),和自身機(jī)器型號(hào)來裝)
?apt-get update
安裝 cuda:apt-get install cuda
check cuda install: nvcc --version
5,? ./tools? ./src 都重新裝一遍
其中 ?
src/cudamatrix 中 Makefile 中修改 CUDA_ARCH =-gencode 那一行.我用的是 geforce 750 顯卡計(jì)算能力為 5,
則修改compute=50,code=sm_50,把TESTFILES 改為 BINFILES(根據(jù)官網(wǎng)的數(shù)據(jù)修改, 第三步來)
在cudamatrix 中測(cè)試
./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
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? (注意 根據(jù)官網(wǎng),和自身機(jī)器型號(hào)來裝)
?apt-get update
安裝 cuda:apt-get install cuda
check cuda install: nvcc --version
5,? ./tools? ./src 都重新裝一遍
其中 ?
src/cudamatrix 中 Makefile 中修改 CUDA_ARCH =-gencode 那一行.我用的是 geforce 750 顯卡計(jì)算能力為 5,
則修改compute=50,code=sm_50,把TESTFILES 改為 BINFILES(根據(jù)官網(wǎng)的數(shù)據(jù)修改, 第三步來)
在cudamatrix 中測(cè)試
./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
總結(jié)
以上是生活随笔為你收集整理的kaidi中 install cuda的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: git stash 缓存 简介
- 下一篇: linux查看正在运行的窗口,获取lin