Did you try following the steps from https://retropie.org.uk/docs/Controller-Configuration/ ?