Surface nanopatterning of semiconductor optoelectronic devices is recognized powerful for improving their quality and performance. However, photoelectric devices' inherent stress sensitivity and inevitable warpage pose a huge challenge on fabricating nanostructures large-scale. Electric-driven flexible-roller nanoimprint lithography for nanopatterning the optoelectronic wafer is proposed in this study. The flexible nanoimprint template twining around a roller is continuously released and recovered, controlled by the roller’s simple motion. The electric field between the template and the substrate provides the all driving force. Under the electric field, the contact line of the template and the substrate gradually moves with the roller to enable scanning and adapting to the entire warped substrate. On the other hand, the driving force generated from electric field is acted on the substrate surface, so the substrate is free from external pressure. Furthermore, liquid resist completely fills in microcavities on the template by powerful electric field force, to ensure the fidelity of the nanostructures. The proposed nanoimprint technology is validated on the prototype. Finally, nano-grating structures are fabricated on a gallium nitride light-emitting diode chip using the proposed solution, achieving the polarization of the light source.