BinFPE
is a tool that detects floating-point exceptions (NaN, infinity, and subnormal quantities) in NVIDIA GPU applications using binary instrumentation. It requires no re-compilation of the application and can analyze libraries. The tool extends NVBit, which is provided by NVIDIA Labs to analyze binaries. We provide a patch to NVBit to build BinFPE
.
We provide a Makefile to build the tool. It downloads NVBit and patches an NVBit tool to create BinFPE
. The patch is provided in binfpe-nvbit.patch
.
To build BinFPE
, simply run make
. It will build the following shared library:
./nvbit_release/tools/detect_fp_exceptions/detect_fp_exceptions.so
Simply preload the shared library detect_fp_exceptions.so
before running the application using the Linux LD_PRELOAD variable method:
$ LD_PRELOAD=/path/detect_fp_exceptions.so ./application input
You should see the following output:
#FPCHECKER: Initializing...
#FPCHECKER: kernel void RAJA::internal::CudaKernelLauncherFixed...
#FPCHECKER: kernel...
If a calculation that results in a NaN or infinity is found, you should see the following output:
#FPCHECKER: NaN found @ /tests/my_code/dot_product.cu:18
#FPCHECKER: INF found @ /tests/my_code/mult_matrix.cu:26
The GPU code must be compiled with the --generate-line-info
flag (see the nvcc options here).
Other requirements:
- SM compute capability: >= 3.5 && <= 8.6
- GCC version: >= 5.3.0
- CUDA version: >= 8.0 && <= 11.x
- nvcc version for tool compilation >= 10.2
For questions, contact Ignacio Laguna [email protected].
To cite BinFPE
please use
@inproceedings{soap22-binfpe,
author = {Ignacio Laguna and Xinyi Li and Ganesh Gopalakrishnan},
title = {{BinFPE: Accurate Floating-Point Exception Detection for GPU Applications}},
booktitle = {{11th ACM SIGPLAN International Workshop on the State Of the Art in Program Analysis (SOAP)}},
howpublished = {{\url{https://pldi22.sigplan.org/home/SOAP-2022#event-overview}}},
year = 2022
}
BinFPE
is distributed under the terms of the MIT license.
See LICENSE and NOTICE for details.
LLNL-CODE-833790