无法为 CUDA NVlabs SASSI 工具构建示例
Unable to build example for CUDA NVlabs SASSI tool
我正在尝试构建和 运行 来自 NVlabs 项目 SASSI 的示例代码,可用于检测 CUDA 代码。但是,我什至努力让包含的示例 Makefile
和 matrixMul.cu
正确构建和 运行。
我尝试添加 --maxrregcount=16
和 -rcd=true
nvcc 标志,但我认为我真正的问题是正确链接到 SASSI 库。下面 nvcc 输出中列出的所有库路径都解析为包含 .so
个文件的实际目录。
非常感谢任何提示或调试步骤。
$ make clean
rm -f -f matrixMul *.o
$ make branch
/usr/local/sassi7//bin/nvcc -I./inc -c -gencode
arch=compute_35,code=sm_35 -gencode arch=compute_50,code=sm_50
-Xlinker "--wrap=main" -Xlinker "--wrap=exit" -lineinfo -Xptxas --sassi-inst-before="cond-branches" -Xptxas --sassi-before-args="cond-branch-info" -g -O3 -dc -o matrixMul.o matrixMul.cu
*
* SASSI Instrumentation Details
*
* For the settings you passed in, you'll need to make sure that you have
* an instrumentation library with the following properties:
* - It MUST BE compiled using only 16 registers!! To accomplish this
* simply compile your library with the nvcc flag, --maxrregcount=16
* - It must define the following functions:
* device void sassi_before_handler(SASSIBeforeParams*,SASSICondBranchParams*)
*
*
* SASSI Instrumentation Details
*
* For the settings you passed in, you'll need to make sure that you have
* an instrumentation library with the following properties:
* - It MUST BE compiled using only 16 registers!! To accomplish this
* simply compile your library with the nvcc flag, --maxrregcount=16
* - It must define the following functions:
* device void sassi_before_handler(SASSIBeforeParams*,SASSICondBranchParams*)
*
****************************************************************************** /usr/local/sassi7//bin/nvcc -o matrixMul matrixMul.o -gencode
arch=compute_35,code=sm_35 -gencode arch=compute_50,code=sm_50
-Xlinker "--wrap=main" -Xlinker "--wrap=exit" -L../instlibs/lib -lbranch -L/usr/local/sassi7//extras/CUPTI/lib64 -lcupti -lcudadevrt -Xlinker -rpath,/usr/local/sassi7//extras/CUPTI/lib64 -L/lib -lboost_regex -lcrypto -Xlinker -rpath,/lib nvlink error : Undefined reference to
'_Z20sassi_before_handlerP17SASSIBeforeParamsP21SASSICondBranchParams'
in 'matrixMul.o' make: * [matrixMul] Error 255**
解决方案是安装 Boost,在 instlibs/env.mk
和 运行 make all
中设置适当的路径,然后再尝试构建示例代码。路径设置正确,但并未生成所有必需的 SASSI 库。
我正在尝试构建和 运行 来自 NVlabs 项目 SASSI 的示例代码,可用于检测 CUDA 代码。但是,我什至努力让包含的示例 Makefile
和 matrixMul.cu
正确构建和 运行。
我尝试添加 --maxrregcount=16
和 -rcd=true
nvcc 标志,但我认为我真正的问题是正确链接到 SASSI 库。下面 nvcc 输出中列出的所有库路径都解析为包含 .so
个文件的实际目录。
非常感谢任何提示或调试步骤。
$ make clean
rm -f -f matrixMul *.o
$ make branch
/usr/local/sassi7//bin/nvcc -I./inc -c -gencode arch=compute_35,code=sm_35 -gencode arch=compute_50,code=sm_50 -Xlinker "--wrap=main" -Xlinker "--wrap=exit" -lineinfo -Xptxas --sassi-inst-before="cond-branches" -Xptxas --sassi-before-args="cond-branch-info" -g -O3 -dc -o matrixMul.o matrixMul.cu
* * SASSI Instrumentation Details * * For the settings you passed in, you'll need to make sure that you have * an instrumentation library with the following properties: * - It MUST BE compiled using only 16 registers!! To accomplish this * simply compile your library with the nvcc flag, --maxrregcount=16 * - It must define the following functions: * device void sassi_before_handler(SASSIBeforeParams*,SASSICondBranchParams*) *
* * SASSI Instrumentation Details * * For the settings you passed in, you'll need to make sure that you have * an instrumentation library with the following properties: * - It MUST BE compiled using only 16 registers!! To accomplish this * simply compile your library with the nvcc flag, --maxrregcount=16 * - It must define the following functions: * device void sassi_before_handler(SASSIBeforeParams*,SASSICondBranchParams*) * ****************************************************************************** /usr/local/sassi7//bin/nvcc -o matrixMul matrixMul.o -gencode arch=compute_35,code=sm_35 -gencode arch=compute_50,code=sm_50 -Xlinker "--wrap=main" -Xlinker "--wrap=exit" -L../instlibs/lib -lbranch -L/usr/local/sassi7//extras/CUPTI/lib64 -lcupti -lcudadevrt -Xlinker -rpath,/usr/local/sassi7//extras/CUPTI/lib64 -L/lib -lboost_regex -lcrypto -Xlinker -rpath,/lib nvlink error : Undefined reference to '_Z20sassi_before_handlerP17SASSIBeforeParamsP21SASSICondBranchParams' in 'matrixMul.o' make: * [matrixMul] Error 255**
解决方案是安装 Boost,在 instlibs/env.mk
和 运行 make all
中设置适当的路径,然后再尝试构建示例代码。路径设置正确,但并未生成所有必需的 SASSI 库。