Problem
My laptop has a 4k screen and it has a Nvidia GPU and an integrated GPU, I want to conect to an external 1080p monitor via HDMI. The external monitor is recognized via xrandr and arandr, but it is over-scaled (not blurry, just too big). I cannot change the resolution of the second screen with xrandr --addmode as it always returns bad parameters.
Solution
Pre-requsite
softwares
nvidia-primenvidia-settingsarandr
make sure Nivida GPU is selected as prime with
sudo prime-select nvidia, and checkNVIDIA (Performance Mode)is selected innvidia-settings. Then log-out and log-in again, runnvidia-settings, confirm there is aX Server Display Configurationoption.
Procedures
The following procedures are required after every reboot:
run
nvidia-settingsand clickX Server Display Configurationselect the external monitor and click
Advancedin the bottommodify
ViewPortInto3840x2160and clickApplyrun
arandrto adjust the layout
Important note
Although there is a Save to X Configuration File option in nvidia-settings (requires sudo to write the file), it will only save the external screen information, which means once reboot, only the external screen will be detected and the laptop screen cannot be used.
Therefore, do not save xorg.conf until I figure out how to modify the file to support multiple screens.