Proceedings of the IEEE 44th Annual Computers, Software and Applications Conference (COMPSAC '20),
IEEE Computer Society, Los Alamitos, CA (2020)
CUDAsmith: A Fuzzer for CUDA Compilers 1

Bo Jiang 2 , Xiaoyan Wang 3 , W.K. Chan 4 , T.H. Tse 5 ,
Na Li 6 , Yongfeng Yin 3 , and Zhenyu Zhang 7

[paper from IEEE Xplore | paper from IEEE digital library | technical report TR-2020-05]

 ABSTRACT

CUDA is a parallel computing platform and programming model for the graphics processing unit (GPU) of NVIDIA. With CUDA programming, general purpose computing on GPU (GPGPU) is possible. However, the correctness of CUDA programs relies on the correctness of CUDA compilers, which is difficult to test due to its complexity. In this work, we propose CUDAsmith, a fuzzing framework for CUDA compilers. Our tool can randomly generate deterministic and valid CUDA kernel code with several different strategies. Moreover, it adopts random differential testing and EMI testing techniques to solve the test oracle problems of CUDA compiler testing. In particular, we lift live code injection to CUDA compiler testing to help generate EMI variants. Our fuzzing experiments with both the NVCC compiler and the Clang compiler for CUDA have detected thousands of failures, some of which have been confirmed by compiler developers. Finally, the cost-effectiveness of CUDAsmith is also thoroughly evaluated in our fuzzing experiment.

Index Terms: Compiler, compute unified device architecture (CUDA), differential testing, equivalence modulo inputs (EMI) testing, fuzzing, general purpose computing on graphics processing unit (GPGPU)

1. This work is supported in part by the NSFC of China (project nos. 61772056, 61690202, and U1633125), the foundation of No.61400020404, the GRF of HKSAR Research Grants Council (project nos. 11214116 and 11200015), the HKSAR ITF (project no. ITS/378/18), the CityU MF EXT(project no. 9678180), the CityU SRG (project nos. 7004882, 7005216, and 7005122), and the Key Research Program of Frontier Sciences, CAS (Grant No. ZDBSLY-7006).
2. (Corresponding author.)
School of Computer Science and Engineering, Beihang University, Beijing, China.
Email:
3. School of Computer Science and Engineering, Beihang University, Beijing, China.
4. Department of Computer Science, City University of Hong Kong, Tat Chee Avenue, Hong Kong.
5. Department of Computer Science, The University of Hong Kong, Pokfulam, Hong Kong.
6. New Navigation Technology Institute, CAST, Beijing, China.
7. State Key Laboratory of Computer Science, Institute of Software, Chinese Academy of Sciences, Beijing, China.

 EVERY VISITOR COUNTS:

  Cumulative visitor count