Pink line on the left after switching VTs with UEFI graphics (GTX 1060)

OS: Debian GNU/Linux testing (stretch)
Kernel: 4.6.7 (both custom and stock Debian configurations)
X.org server: 1.18.4
Driver version: 367.44 and 370.28

Graphics: GeForce GTX 1060; monitor connected to the card’s own HDMI port
Motherboard: Gigabyte G1 Sniper M3

After switching from X to a text VT and then back to X, on a GeForce GTX 1060 (apparently booted into UEFI mode), a 2-4 pixels thick pink line appears on the left edge of the screen. The line reappears every time I switch to X from a text VT (but not the other way around), it doesn’t seem connected to any window manager in particular, and can even appear on a text VT if I use modprobe to load the NVIDIA modules manually when X isn’t running. Also, it goes away if I switch the monitor to any non-native resolution, and doesn’t reappear after switching back to the native resolution unless I switch VTs again.

I’ve seen this line appear during X startup/when loading the modules manually for quite a few releases, actually (possibly since around the time KMS support was formally announced), except that I didn’t get to see it stick around probably because of the way UEFI graphics were being handled on my system previously.

To elaborate, until a few days ago I was using a GT 610 card, and while I did have EFI console support on Linux, I was getting the “NVRM: Your system is not currently configured to drive a VGA console […]” warning in the kernel log, which based on previous posts on that particular warning leads me to believe that the system UEFI was using some kind of compatibility mode to interact with the GT 610. In particular, I did not have access to display modes other than 640x480, 800x600 and 1024x768 on e.g. GRUB, but now I do if I select “Windows 8” as my OS type in the UEFI configuration and disable CSM support. This last part is also a factor in removing the aforementioned warning and reproducing the pink line persistence bug, as it does not persist on VT switch if I revert to the previous configuration and get the warning back.

Even with the GT 610, I could see the pink line appear on text consoles when loading the NVIDIA modules by hand, or for half a second when X was starting, but it did not persist. It seems to me that with my new configuration the driver does not initiate a mode switch/reset when switching back to X from a text console because the console is already on the native resolution (with the contents scaled to fit), as evidenced by the monitor backlight not going off. When switching from X to a text console, the backlight goes off momentarily and the pink line disappears.

(I tried all the keywords I could think of to search for this issue but I couldn’t find anything involving NVIDIA’s driver, only Nouveau. Also, I attached a separate X.org server log from running startx -- -logverbose 6 as my user because nvidia-bug-report.sh seems to have only caught the system-wide one.)
nvidia-bug-report.log.gz (136 KB)
Xorg.0.log (287 KB)