<sec>Grain boundary is one of the main defects, limiting the large-area application of CdZnTe nuclear radiation imaging detectors. In order to explore the ways to improve the electric field distribution properties near grain boundary, the effect of sub-bandgap illumination on the electric field distribution in CdZnTe detector with grain boundary is studied by Silvaco TCAD simulation technique. The grain boundary potential barrier and electric field dead zone are found in simulation results that significantly affect the carrier transport process in CdZnTe detector. The electric field dead zone caused by the grain boundary disappears under the bias of sub-bandgap illumination. Thus the electric field distribution tends to be linear. Meanwhile, the effects of different wavelengths and intensities of sub-bandgap illumination on the electric field distribution at the grain boundary are also investigated. The results show that the electric field of CdZnTe is distorted by sub-bandgap illumination at an intensity lower than 1×10<sup>–9</sup> W/cm<sup>2</sup>. In contrast, a flatter electric field distribution is achieved at a wavelength of 850 nm and an intensity of 1×10<sup>–7</sup> W/cm<sup>2</sup>. The carriers can be transported by drifting, reducing the probability of being captured or recombined by defects during transport, thus improving the charge collection efficiency of the detector.</sec><sec>In addition, the microscopic mechanism of the modulation of the electric field distribution by sub-bandgap illumination and the energy band model of CdZnTe crystal containing grain boundary are proposed. Owing to the existence of the grain boundary, two space charge regions are formed near the grain boundary. The energy band at the grain boundary is bent upward. Meanwhile, the metal-semiconductor contact forms a Schottky barrier, and the energy band near the electrode is bent upward. When the bias voltage is applied, the energy band structure of the CdZnTe tends to tilt from the cathode to the anode. The sub-bandgap illumination can lower the energy band barrier at the grain boundary and regulate the energy band on both sides of the grain boundary. It is believed that this discussion will also make some contributions to understanding of the effects of illumination and grain boundary in other types of optoelectronic devices, especially the applications of thin films in solar cells and detectors.</sec>