In this article, Harris hawks' optimization (HHO) for selective harmonic elimination method (SHEM) of a voltage source inverter has been applied to a traction motor drive for light rail transportation. The main objective of SHEM's pulsewidth modulation (PWM) strategy is to remove the low-order harmonics by solving nonlinear equations while satisfying the required fundamental component's magnitude. The HHO applied in this article to a two-level, three-phase inverter aims at solving the associated nonlinear equations with a high accuracy and convergence probability as a strong metaheuristic algorithm. SHEM simulations are carried out via MATLAB/Simulink on a 125 kW traction motor drive platform for various SHEM angles to verify its performance in comparison with the SHEM with sinusoidal PWM (and space vector modulation (SVM) techniques. Experimental results obtained on a physical simulator of the light rail transportation system in the laboratory have shown remarkable findings in view of the dc-link voltage magnitude on the performance of the associated traction motor drive. In the light of different fundamental frequency operations, number of SHEM angles, and operating dc-link voltages, a general evaluation of the SHEM has been made in considering its application to a light rail traction motor drive. It has also been shown that the application of online SHEM on a GPU framework is possible in real-time.