Created
May 14, 2016 02:17
-
-
Save morris821028/bedc7f19e6e3cc856d3441bd97c07744 to your computer and use it in GitHub Desktop.
CUDA Profiler Script on nVidia Driver
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
TEXT_RED=`tput setaf 1` | |
TEXT_GREEN=`tput setaf 2` | |
TEXT_RESET=`tput sgr0` | |
CONFIG_FILE=nvvp.cfg | |
if [ ! -f $CONFIG_FILE ]; | |
then | |
echo "[ERROR] Profile config file ${TEXT_RED}nvvp.cfg${TEXT_RESET} does not exist." | |
exit 1 | |
fi | |
time -p COMPUTE_PROFILE=1 COMPUTE_PROFILE_CONFIG=${CONFIG_FILE} $@ | |
if [ $? -eq 0 ]; | |
then | |
echo "[INFO] ${TEXT_GREEN}Profiler Successed.${TEXT_RESET}" | |
else | |
echo "[ERROR] ${TEXT_RED}Usage: ./nvprof.sh <execute-command>${TEXT_RESET}" | |
exit 1 | |
fi | |
cat cuda_profile_*.log > nvvp.log | |
if [ $? -eq 0 ]; | |
then | |
echo "[INFO] Create ${TEXT_GREEN}nvvp.log${TEXT_RESET} Successed" | |
else | |
echo "[ERROR] Create profile log Fail" | |
exit 1 | |
fi | |
rm cuda_profile_*.log | |
echo "[INFO] Now, use NVVP and import OpenCL profile log." | |
nvidia-smi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
profilelogformat CSV | |
streamid | |
gpustarttimestamp | |
gpuendtimestamp | |
gridsize | |
threadblocksize | |
dynsmemperblock | |
stasmemperblock | |
regperthread | |
memtransfersize |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment