运行nvprof:nvprof ./a.out
但是结果是:
NMF: Non-negative Matrix Factorization
Options:
Parameters for training:
-train <file>
Use data from <file> to train the model;
-factor <int>
factor number; default is 3
-maxiter <int>
maxiter for main loop; default is 100
-timelimit <int>
timelimit for training; default is 1000s
-tol <float>
tolerance of stop condition; default is 0.001
-gpuid <int>
which gpu to use; default is 0
Examples:
./NMF_gd -train test.txt -factor 3 -maxiter 10 -timelimit 100 -gpuid 0
======== Warning: No CUDA application was profiled, exiting
原因:可能是因为系统中存在不止一个nvprof。
解决:/usr/local/cuda-9.0/bin/nvprof ./xx_1 -train test.txt("-train test.txt"是运行参数,根据实际情况)
但是也会出错。
需要编译的时候,把nvcc的全局地址也加上:
/usr/local/cuda-9.0/bin/nvcc NMF_xx.cu -o xx_1
【在windows上视图化Visual Profiler】
在远程服务器上, 运行:
$ nvprof -o prof.nvvp ./xx_1 -train test.txt
复制prof.nvp到windows上:
方法一:$ scp username@服务器IP:端口号:地址/地址/prof.nvvp (这里有一个空格)/(local 地址)F:/… .
方法二:用xshell打开,然后 sz prof.nvvp
(哈哈哈,方法一不知道为什么密码总是不对,只能用老办法传到windows上啦)
然后打开nvvp,然后open prof.nvvp
【开始分析…】