24

I'm testing out 14.04 on a partition to see if I want to use it as my main desktop for when it's fully released, but I've encountered some problems.

I have a 144Hz monitor, so in the the Nvidia X Server Settings window I set the refresh rate to 144Hz and it works just fine. However, when I restart my computer those settings revert back to "auto" and I have to reset the refresh rate back to 144Hz each time I log into Ubuntu. How do I make the Nvidia settings stay set to 144Hz?

The refresh rate settings also revert back to auto every time I go into full screen in Minecraft.

I've searched Google and can't seem to find any solution to these problems.

I'm not open to any lectures about how 144Hz is pointless because the eye supposedly can't see a difference beyond a certain refresh rate, so if you intend to lecture me on that incorrect knowledge then please be gone.

3
  • The answer below will give you 144Hz but the problem will stay. Now you will have windows that move at 144Hz when you move them slow but when you move them faster, the windows will start lagging behind your mouse. I guess this is a problem with xorg or compiz now. Too hot hardware for such old software. Have to wait for Mir or wayland.
    – Kaspar
    Apr 20, 2014 at 20:09
  • If either of the solutions solved at least as much as you can do about the issue I'd ask that you mark either of them as successful, unless you have other reasons. As much as I look forward to Wayland I have to say OpenGL relies quite heavily on X at the minute so hopefully the core has compatibility for Wayland before I start to write any code for it lol. Nov 10, 2015 at 14:15
  • I'm very sorry but that doesn't work... When I try to save xserver settings and reboot device, I have still the same problem...
    – user570933
    Jul 21, 2016 at 16:51

4 Answers 4

35

After reading 113 blog posts, SO questions, and other attempts at solving this problem, my refresh rate was still lost on reboot.

From there I combed through man pages and played with dozens of utilities. During that process I discovered the following one-liner works on my 64 bit machine with a GTX 760.

xrandr --output DVI-D-0 --mode 1920x1080 --rate 144

This targets the device connected via DVI-D-0, sets the resolution to 1920W by 1080H, and forces a refresh rate of 144 Hz.

To determine the value for --output, run the following command

xrandr -q

Which will display information like the following.

xrandr -q results

You can see the second to last entry is where I found the device name, as well as supported settings.

I call this script from "Startup Applications" to ensure that it runs immediately following log in. I'm not 100% happy with that solution, because the screens flickers immediately after entering my password. If you can live with that (I can), then this solves the issue.

3
  • 4
    This is the final and working answer! I also have been spending hours to fix a very similar problem: not being able to change the refresh rate from 60 to anything else for my VG248QE! I tried several commands, including many attempts with xrandr. Your oneliner works!
    – Timmos
    Sep 15, 2014 at 16:25
  • 7
    There is also a file called monitors.xml in every users .config folder. In there if you edit your monitors refresh rate to 144 Hz, then it will work also without using xrandr command.
    – Kaspar
    Jan 19, 2015 at 13:11
  • Holy f**ing shit I cant belive you got a solution for this!! THANKS. Just one thing. @Elad comment (se below his answer) avoids the need to add this script to the "Startup applications". After running xrandr command folloy the Elad's steps and it will generate monitors.xml. Tested and working on Ubuntu 18.04 on Gnome and Cinnamon too
    – Capy
    May 5, 2018 at 12:03
13

To set refresh rate permanently (tested with Ubuntu 16.04):

  • Open ~/.config/monitors.xml.
  • File may have multiple configuration sections which seems to be for different monitor setups there have been. I had most recent setup at most bottom.
  • If you have multiple displays make sure to edit correct output. Write xrandr to terminal and check by name of output that edited output really support wanted mode.
  • Insert refresh rate to rate element.

This method was found from a comment of Kaspar but I think this should be raised as answer.

2
  • Works on 14.04 also!
    – visoft
    Jul 26, 2017 at 20:51
  • I've tried every single thing on the internet and now after many many months I can finally keep 144hz after rebooting, turning monitor off and on and after exiting timeout black screen.
    – Nand
    Oct 31, 2020 at 13:20
5

To complement previous answers, if monitors.xml does not exist, set the refresh rate temporarily using xrandr, then enter the "Displays" configuration window and click "apply" to create the file with the correct refresh rate (no need to modify the settings).

1
  • Worked for me with unity-control-center > Screens > Apply. In my case monitors.xml already existed and got updated after apply. Thanks! Oct 1, 2018 at 12:29
1

Run nvidia-xconfig as root and save the configuration:

  1. Open a terminal and run

    sudo nvidia-xconfig 
    
  2. On the tab where you set up your screen, choose your settings and then hit save:

    enter image description here

  3. That should pop out a new window with the location to save to. The default should already be /etc/X11/xorg.conf, hit OK and that should be it.

1
  • 3
    Apparently the X config it generates does not force the session to use the chosen resolution nor refresh rate on X.server restart.
    – Kaspar
    Jan 19, 2015 at 13:09

Not the answer you're looking for? Browse other questions tagged or ask your own question.