While CUDA has become a major parallel computing platform and programming model for general-purpose GPU computing, CUDA-induced bug patterns have not yet been well explored. In this paper, we conduct the first empirical study to reveal important categories of CUDA program bug patterns based on 319 bugs identified within 5 popular CUDA projects in GitHub. Our findings demonstrate that CUDA-specific characteristics may cause program bugs such as synchronization bugs that are rather difficult to detect. To efficiently detect such synchronization bugs, we establish the first lightweight general CUDA bug detection framework, namely Simulee, to simulate CUDA program execution by interpreting the corresponding llvm bytecode and collecting the memory-access information to automatically detect CUDA synchronization bugs. To evaluate the effectiveness and efficiency of Simulee, we conduct a set of experiments and the experimental results suggest that Simulee can detect 20 out of the 27 studied synchronization bugs and successfully detects 26 previously unknown synchronization bugs, 10 of which have been confirmed by the developers.
One closely-related work with is a test-amplification-based bug detection approach @cite_4 that amplified the result of a single running test to combine it with static analysis such that the set of all inputs and interleavings could be verified. Though the idea of injecting testing philosophy into CUDA programs is similar with , advances in (1) it is a general-purpose and fully automated bug detection framework that can detect various synchronization types while @cite_4 only handles data race and requires manual inputs; (2) only needs to run the code relevant to kernel function execution, while @cite_4 needs to run the whole program life cycle which leads to much larger overhead. (3) @cite_4 suffers from the incorrect input regarding synchronization and loss of effectiveness while does not have these limitations.
@cite_4
2167995056
We present a novel technique for verifying properties of data parallel GPU programs via test amplification. The key insight behind our work is that we can use the technique of static information flow to amplify the result of a single test execution over the set of all inputs and interleavings that affect the property being verified. We empirically demonstrate the effectiveness of test amplification for verifying race-freedom and determinism over a large number of standard GPU kernels, by showing that the result of verifying a single dynamic execution can be amplified over the massive space of possible data inputs and thread interleavings.