2017-10-12 121 views
0

我是nvprof的新用户,当我尝试使用nvprof来剖析我的代码时出现错误。我在代码中添加了一些OpenACC指令。我使用的cuda工具包是Cuda8.0。我的代码是用fortran90 + OpenMPI编写的。我使用16个核心进行并行计算。下面是我用来提交代码的脚本:Nvidia Visual Profiler错误:无法创建性能分析文件

#!/bin/bash -l 
# 
#SBATCH --nodes=1 
#SBATCH --ntasks=16 
#SBATCH --ntasks-per-node=24 
#SBATCH --ntasks-per-core=2 
#SBATCH --cpus-per-task=1 
#SBATCH --constraint=gpu 
#SBATCH --time=24:00:00 
#SBATCH --account=s807 

export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK 
export CRAY_CUDA_MPS=1 
export TMPDIR=/scratch/snx3000/guow/Incompact3d_GPU/test1 
export PGI_ACC_TIME=1 

set -ex 

# set some parameters 
OUT=log.txt 
#WMIN=1400 
NP=16 


# tasks: $SLURM_NTASKS 
# tasks-per-node: $SLURM_NTASKS_PER_NODE 
# cpus-per-task: $SLURM_CPUS_PER_TASK 
srun nvprof -o nvprof.out ./incompact3d $WMIN >> $OUT 

的作业几秒钟后运行结束,我得到了以下错误信息:生成nvprof.out文件

+ OUT=log.txt 
+ NP=16 
+ srun nvprof -o nvprof.out ./incompact3d 
==20144== NVPROF is profiling process 20144, command: ./incompact3d 
==20148== NVPROF is profiling process 20148, command: ./incompact3d 
==20140== NVPROF is profiling process 20140, command: ./incompact3d 
==20133== NVPROF is profiling process 20133, command: ./incompact3d 
==20134== NVPROF is profiling process 20134, command: ./incompact3d 
==20150== NVPROF is profiling process 20150, command: ./incompact3d 
==20146== NVPROF is profiling process 20146, command: ./incompact3d 
==20128== NVPROF is profiling process 20128, command: ./incompact3d 
==20154== NVPROF is profiling process 20154, command: ./incompact3d 
==20156== NVPROF is profiling process 20156, command: ./incompact3d 
==20152== NVPROF is profiling process 20152, command: ./incompact3d 
==20136== NVPROF is profiling process 20136, command: ./incompact3d 
==20130== NVPROF is profiling process 20130, command: ./incompact3d 
==20158== NVPROF is profiling process 20158, command: ./incompact3d 
==20138== NVPROF is profiling process 20138, command: ./incompact3d 
==20142== NVPROF is profiling process 20142, command: ./incompact3d 
==20146== Error: Cannot create profiling file: /scratch/snx3000/guow/Incompact3d_GPU/test2_OpenAcc/nvprof.out 
==20142== Error: Cannot create profiling file: /scratch/snx3000/guow/Incompact3d_GPU/test2_OpenAcc/nvprof.out 
==20138== Error: Cannot create profiling file: /scratch/snx3000/guow/Incompact3d_GPU/test2_OpenAcc/nvprof.out 
==20133== Error: Cannot create profiling file: /scratch/snx3000/guow/Incompact3d_GPU/test2_OpenAcc/nvprof.out 
==20134== Error: Cannot create profiling file: /scratch/snx3000/guow/Incompact3d_GPU/test2_OpenAcc/nvprof.out 
==20136== Error: Cannot create profiling file: /scratch/snx3000/guow/Incompact3d_GPU/test2_OpenAcc/nvprof.out 
==20156== Error: Cannot create profiling file: /scratch/snx3000/guow/Incompact3d_GPU/test2_OpenAcc/nvprof.out 
srun: First task exited 30s ago 
srun: tasks 0,4,6-7,9-13: running 
srun: tasks 1-3,5,8,14-15: exited 
srun: Terminating job step 3892463.0 
slurmstepd: error: *** STEP 3892463.0 ON nid04439 CANCELLED AT 2017-10-12T15:04:00 *** 
srun: Job step aborted: Waiting up to 32 seconds for job step to finish. 
srun: error: nid04439: tasks 0,4,6-7,9-13: Killed 
srun: Terminating job step 3892463.0 

但当我使用命令“nvvp nvprof.out”来检查它时什么都没有显示。你以前遇到过这种情况吗?任何建议将不胜感激!

回答

2

尝试使用下面的命令:

srun nvprof -o nvprof.%p.out ./incompact3d $WMIN >> $OUT 

“%P”将得到与每个MPI排名的进程ID所以每个级别将输出它的配置文件,不同的文件填写。否则,所有的等级都试图使用可能导致问题的相同文件。

+0

嗨,谢谢你的回复。它在我添加%p时起作用。它可以生成16个输出文件。但是,当我将这16个输出文件导入nvprof时,GPU细节,CPU细节标签中没有显示任何内容。我只能看到OpenACC的时间表行。在“分析”标签中,单击“检查GPU使用情况”时,结果显示“无GPU设备”。但代码在CPU和GPU上运行。你能告诉我如何显示GPU,CPU细节和其他时间线信息? –

+0

如果您的代码在GPU上运行,那么应该有GPU信息。但是,如果节点没有安装“libcupti.so”,那可以解释为什么信息丢失。 CUPTI是与设备连接的分析器库。另一种可能性是您没有为您使用的设备构建OpenACC代码。你传递给编译器的是什么“-ta”选项?你使用什么设备?对于CPU分析,您需要将“--cpu-profiling on”选项添加到nvprof,或使用默认情况下启用CPU分析的pgprof。 –

+0

感谢您的回复!我使用的-ta选项是-ta = tesla:cuda8.0。我正在Cray XC50上运行我的模拟。计算节点为Intel®Xeon®E5-2690 v3 @ 2.60GHz(12核,64GB RAM)和NVIDIA®Tesla®P100 16GB。我添加了“--cpu-profilling on”选项,并使用单个核心进行计算。现在我可以看到CPU分析。 –

相关问题