Waveguide displays based on a volume holographic grating (VHG) have the benefit of expanding the exit pupil. Exit pupil size and exit pupil uniformity are two important indicators of waveguide displays. Most current optimizations for exit pupil uniformity are based on the central viewing angle. However, this does not ensure satisfied exit pupil uniformity for other viewing angles. In this paper, a method based on a genetic algorithm to optimize the exit pupil uniformity under the whole horizontal field of view (HFOV) is proposed. First, the ray-tracing-based mathematical model to analyze the uniformity of the whole HFOV at all wavelengths is established. Based on the mathematical model, the objective function can be defined, which can optimize the refractive index modulation distribution on several regions of the out-coupling VHG. The simulation results show that for a holographic waveguide display with the exit pupil size of 16mm×12mm, the average exit pupil uniformity can reach 86.87% at a diagonal field of view (DFOV) of 30°, a 9.16% improvement over the previous method. The genetic-algorithm-based method proposed in the paper can effectively improve the exit pupil uniformity.