"--scale 2x2" in xrandr causes the monitor to not display anything
Solution 1
Just wanted to add that this is something I've been fighting with for a long time, and each time I just gave up - until I decided to figure it out once and for all. The solution below works for me, hope it does for you as well.
tl;dr: Configure ForceFullCompositionPipeline=On
Background
Some of this is also in hopes of providing more keywords in case someone with a similar problem ends up looking for the solution.
My setup is:
- ThinkPad P50 with a built-in 4K display at 3840×2160 (primary)
- An external monitor as a secondary display - Dell U2412M - 1920×1200
I use Ubuntu Gnome 16.04 LTS.
When I plug in the monitor via a HDMI cable + a HDMI-to-DVI converter (as the monitor doesn't have an HDMI input), everything was too large. Various articles online suggested using xrandr
to configure --scale 2x2
on that display, which resulted in it being almost completely black, with only a thin line visible on top.
I bumped into this question and while the 2x2.001
scaling solution enabled the monitor to actually display stuff, it also added an extra pixel below the X screen which resulted in slight up/down scrolling when the cursors reaches the top/bottom of the screen.
After a lot of Googling, much of which yielded problems and no solutions, I stumbled upon this: https://devtalk.nvidia.com/default/topic/891207/-355-11-358-09-viewportin-on-2nd-monitor-results-in-garbled-display-for-values-over-3211x1800
So to test it out, I configured this using the following commands - assume xrandr
hasn't been configured with scaling yet.
$ nvidia-settings -q CurrentMetaMode
Attribute 'CurrentMetaMode' (lilicorp:1.0): id=50, switchable=no, source=RandR :: DPY-4: nvidia-auto-select @3840x2160 +0+0 {ViewPortIn=3840x2160, ViewPortOut=3840x2160+0+0}, DPY-1: nvidia-auto-select @1920x1200 +3840+0 {ViewPortIn=1920x1200, ViewPortOut=1920x1200+0+0}
This displays the CurrentMetaMode
value and this is where I added the ForceFullCompositionPipeline=On
option to both displays. Note that DPY-4
is my built-in laptop display, whereas DPY-1
is the external monitor.
The actual string that needs to be configured is the one after ::
in the output of that command.
$ nvidia-settings --assign CurrentMetaMode="DPY-4: nvidia-auto-select @3840x2160 +0+0 {ViewPortIn=3840x2160, ViewPortOut=3840x2160+0+0, ForceFullCompositionPipeline=On}, DPY-1: nvidia-auto-select @1920x1200 +3840+0 {ViewPortIn=1920x1200, ViewPortOut=1920x1200+0+0, ForceFullCompositionPipeline=On}"
After this, I ran:
$ xrandr --output DP-1 --scale=2x2
Finally, the external display resolution was fine with no scrolling or any other issues.
Note that after running those commands, the CurrentMetaMode
is a bit different from what was assigned, probably due to the scaling getting applied:
$ nvidia-settings -q CurrentMetaMode
Attribute 'CurrentMetaMode' (lilicorp:1.0): id=50, switchable=no, source=RandR :: DPY-4: nvidia-auto-select @3840x2160 +0+0 {ViewPortIn=3840x2160, ViewPortOut=3840x2160+0+0, ForceCompositionPipeline=On, ForceFullCompositionPipeline=On}, DPY-1: nvidia-auto-select @3840x2400 +3840+0 {Transform=(2.000000,0.000000,0.000000,0.000000,2.000000,0.000000,0.000000,0.000000,1.000000), ViewPortIn=3840x2400, ViewPortOut=1920x1200+0+0, ResamplingMethod=Bilinear, ForceCompositionPipeline=On, ForceFullCompositionPipeline=On}
Hope this solves the problem for someone else too!
Solution 2
I had exactly the same problem. I got it resolved with --scale 2x2.001
. Oddly enough, --scale 2x1.999
or 2x2.0001
didn't work, so be sure to try several numbers around 2.
Solution 3
Thank you Milos for your excellent solution, which worked well for me!
I've a small addition. Besides using the command line you can also comfortably set the ForceFullCompositionPipeline
in the Nvidia-Settings UI. For this you've to go to "X Server Display Configuration", click on "Advanced" and just activate the option "Force Full Composition Pipeline".
Please see https://imgur.com/a/3jE78 for an example.
PS: I'm using a triple-head setup with two external monitors (1920x1080; 1680x1050) and an internal 3k monitor (3840x2160). For this to work I apply the following xrandr-config:
xrandr --output eDP-1-1 --auto --output HDMI-0 --auto --scale 2x2 --above eDP-1-1 --output DP-1 --auto --scale 2x2 --rotate left --right-of eDP-1-1
Related videos on Youtube
m4p85r
Updated on September 18, 2022Comments
-
m4p85r over 1 year
I've got a 4k external main monitor and I'm trying to connect a 1680x1050 external monitor to the left of it.
I've tried using:
xrandr --output HDMI-0 --scale 2x2 --pos 0x0 --fb 7200x2160 --output DP-4 --pos 3360x0
which seems like it should work, and when I look at what the computer thinks is going on in nvidia-settings it correctly displays a 3200x2160 monitor to the left of my 4k one.
However on my external monitor just shows black with a flickering line at the top of it.
The only way I can correct this is to reset the scaling back to 1x1 at which point the image returns (while maintaining the X-server size. This means there's just deadspace that I have to scroll through to get between my monitors).
So I think the problem is specifically to do with the 2x2 scaling in xrandr. I'm not sure what to do?
The computer is running 14.04 and has a nvidia GTX960 in it with the recommended driver (352.63)
Here's my xrandr output:
Screen 0: minimum 8 x 8, current 7200 x 2160, maximum 16384 x 16384 DVI-I-0 disconnected (normal left inverted right x axis y axis) DVI-I-1 disconnected (normal left inverted right x axis y axis) DP-0 disconnected (normal left inverted right x axis y axis) DP-1 disconnected (normal left inverted right x axis y axis) DP-2 disconnected (normal left inverted right x axis y axis) DP-3 disconnected (normal left inverted right x axis y axis) HDMI-0 connected 1680x1050+0+0 (normal left inverted right x axis y axis) 474mm x 296mm 1680x1050 59.9*+ 60.0 1280x1024 75.0 60.0 1280x960 60.0 1152x864 75.0 1024x768 75.0 70.1 60.0 800x600 75.0 72.2 60.3 56.2 640x480 75.0 72.8 59.9 DP-4 connected primary 3840x2160+3360+0 (normal left inverted right x axis y axis) 527mm x 296mm 3840x2160 60.0*+ 30.0 2560x1440 60.0 2048x1280 60.0 1920x1200 59.9 1920x1080 60.0 60.0 59.9 50.0 24.0 60.0 50.0 1600x1200 60.0 1600x900 60.0 1280x1024 75.0 60.0 1280x720 60.0 59.9 50.0 1152x864 75.0 1024x768 75.0 60.0 800x600 75.0 60.3 720x576 50.0 50.1 720x480 59.9 60.1 640x480 75.0 59.9 59.9
-
Maciej Wozniak almost 8 yearsI'm having the same issue. It seems to be working up to scale 1.71x1.71. Everything bigger causes smaller display to go blank
-
m4p85r almost 8 yearsUnfortunately I never managed to fix this. I was trying to run two monitors, one with scaling and one without. If you're just trying to run at 2x scaling then it's very easy with Cinammon. I believe there's a way to get Unity to do it too.
-
-
juggernauthk108 over 7 yearsi had this problem too... brute force worked out for mr
-
m4p85r over 7 yearsWhat did you brute force? Values of 2?
-
m4p85r over 7 yearsAnd how strange! Thanks for the post. I ended up just giving up. I've actually got a second computer now connected via synergy. Works quite well for when I occasionally need windows applications (second computer is win)
-
Columbo over 6 yearsThis actually works. Someone should report that... anyway, big thank you!
-
Zach over 3 yearsFor me
nvidia-settings -q CurrentMetaMode
returnsAttribute 'CurrentMetaMode' (zach-dell:1.0): id=50, switchable=yes, source=xconfig :: NULL