I flashed the latest Retropie image (4.4) and it boots with a resolution of 640x480 when connected over HDMI to my 4k TV.
I used the correct Retropie image for my Pi 3. I confirmed the screen resolution using tvservice -s.
How can I get it to run at 1080p?