Need some help with a script to enable NVIDIA forcefullcompositing automatically



So currently, I have the following script I use to set up my displays and then load the correct color settings by loading the NVIDIA config only:

xrandr --output DVI-D-0 --mode 1920x1080 --pos 0x0 --rotate left -r 119.98 --output HDMI-0 --mode 3840x2160 --pos 3000x440 --rotate normal -r 60.00 --output DP-4 --primary --mode 1920x1080 --pos 1080x440 --rotate normal -r 143.98
exec nvidia-settings --load-config-only

Now, I also want to add to this script so that ForceFullCompositionPipeline is on, on all 3 display’s.

Anyone have any experience with this? Getting really annoying having to check NVIDIA settings every reboot or every time I went away and turn my monitors back on to see if it is still enabled.

Is there also a reason why so many settings never stick on Linux? Why does my refresh always revert back to 60Hz after a reboot and why are the color settings also lost after every reboot?

I like tweaking and fiddling but this is on another level.


You need to configure your settings in config files. Otherwise you get the default.

With this command, only a very small part of settings restored.

You can either create a X11/xorg.conf.d config file to set the correct metamodes. Make sure to check out all files in X11/xorg.conf.d so you don’t create conflicts. I think you will have a link to the mhwd file. This file is created by mhwd. It is not recommended to change it, but it can be a good template.

If you don’t want to mess with your xorg.conf, try the nvidia-settings --assign CurrentMetaMode="..." command. Read more in the Arch Wiki.


As xabbu said, put your options in a config file for Xorg.
That way, the settings will stay and you don’t have to mess with nvidia-settings.

Are you sure you need FFCP?
I know I’m extremely annoying when it comes to FFCP, because it seems I am the only nvidia user who does not need that setting to avoid tearing… :thinking:


Thanks for the info all.

I did created a “20-nvidia.conf” at the location “/etc/X11/xorg.conf.d”, but it seems that doesnt help.

That file is the one NVIDIA made when I went and saved a X config.

I shall try the " nvidia-settings --assign CurrentMetaMode="…" " and see if I can make that work together with my script.


I wanted to do this since I read that with it, there is less input lag. I don’t have any screen tearing issues though!

But the wiki is pretty confusing, I just want to enable the composition, do I really need to also do autoselect and the 0+0? I already setup my monitors with my other script.

Guess I will not do it for now until I am more experienced with Linux. Don’t want to ■■■■ things up again.


Where did you get that?
What you have to tweak with the suggested edits is the file /etc/X11/mhwd.d/nvidia.conf


There is more input lag with FFCP.


Good to know. I do wonder if I would notice any with my 144Hz 1ms gaming monitor though.

That’s my issue actually, trying to improve things or tweak things when everything already works correctly.


Before doing what I am about to recommend I would suggest you back-up your current settings in you /etc/X11 folder.

Run sudo nvidia-settings and click on “Advanced…” in the “X Server Display Configuration” menu.
Check the “Force Compositiion Pipeline” and “Force Full composition Pipeline”. Do this for all the monitors if you want. Then make sure all the other settings are as you want them.

SORRY,I edited the ln -s command and the config location. I made a mistake with the files.

Click on “Save to X configuration File”, and save it as /etc/X11/mhwd.d/nvidia.conf.

Run sudo ln -s /etc/X11/mhwd.d/nvidia.conf /etc/X11/xorg.conf.d/90-mhwd.conf.
Make sure that there isn’t already a /etc/X11/mhwd.d/90-mhwd.conf file.
If there is either delete it or sudo mv /etc/X11/mhwd.d/90-mhwd.conf /etc/X11/mhwd.d/90-mhwd.conf.old to back it up.

For reference, in my /etc/X11/mhwd.d directory I have 3 files:

  • nvidia.conf
  • nvidia.conf.backup
  • nvidia.conf.nvidia-xconfig-original

And in /etc/X11/xorg.conf.d/ I have 2:

  • 00-keyboard.conf
  • 90-mhwd.conf (which is a symlink of the /etc/X11/mhwd.d/nvidia.conf I mentioned above.)

This way I never had to use exec nvidia-settings --load-config-only.

Furthermore (edited), you could add your xrandr command in you ~/.xinitrc in the end, like this:

xrandr --output DVI-D-0 --mode 1920x1080 --pos 0x0 --rotate left -r 119.98 --output HDMI-0 --mode 3840x2160 --pos 3000x440 --rotate normal -r 60.00 --output DP-4 --primary --mode 1920x1080 --pos 1080x440 --rotate normal -r 143.98 &

Add it above exec $(get_session). I’m 99% sure it will work :stuck_out_tongue:. I can’t tell you for sure, because I have modified my ~/.xinitrc a lot, and I have deleted the part which finds which DE/WM you use, and replaced it with just exec i3. But if the xrandr command didn’t work for me I would do this:
exec i3 && xrandr <*my_options_here*>.


Good that you edited the post :wink: Yet, since 90-mhwd.conf is a symlink to nvidia.conf, it doesn’t need a backup :slight_smile: nvidia.conf needs a backup


I got a phone call in the middle if writing the post. I should have checked again before posting. At least if he followed my advice, he could restore the previous settings.


No worries. You where quick and on point :wink: I don’t think the OP saw it yet …


I have yet to do the tweak so no harm done yet! Thanks for the detailed explanation. I will test it tonight. Your instructions are pretty clear so I shall report back when I have done the deed!

Edit: I will do xrandr first and reboot and then do the other tweak. Step by step!


When you say you will do xrandr, you mean adding it to your .xinitrc? IF it doen’t work like that, don’t be disappointed, we will make it work. I’m sure.
I would also like to note that if you have more files in the etc/X11/xorg.conf.d/ directory you may want to move them somewhere else and keep just the 00-keyboard.conf, and the symlink you create. Just to make sure that the settings in the other config files don’t conflict with the settings the nvidia-settings create. And remember that use have to use sudo. Those files can’t be edited by your user and if you open the Nvidia settings without sudo, it will fail to save the file.


Thanks for the heads up! And I will move the files away to a safe location before doing any changes.


Currently at work so I edited the xinit and and the end I have this now. The get_session was the last line and I made a new line with my xrandr. That is correct right? Can’t restart my computer until tonight though!

exec $(get_session)
exec xrandr --output DVI-D-0 --mode 1920x1080 --pos 0x0 --rotate left -r 119.98 --output HDMI-0 --mode 3840x2160 --pos 3000x423 --rotate normal -r 60.00 --output DP-4 --primary --mode 1920x1080 --pos 1080x423 --rotate normal -r 143.98


seems fine I guess. If it doesn’t work try:

exec $(get_session) && exec xrandr --output DVI-D-0 --mode 1920x1080 --pos 0x0 --rotate left -r 119.98 --output HDMI-0 --mode 3840x2160 --pos 3000x423 --rotate normal -r 60.00 --output DP-4 --primary --mode 1920x1080 --pos 1080x423 --rotate normal -r 143.98

But it should work.


I used to have a *.desktop file in $HOME/.config/autostart to do this:

18# cat 'NVIDIA set ForceFullCompositionPipeline=On.desktop'
[Desktop Entry]
Exec=/usr/bin/nvidia-settings  --assign CurrentMetaMode="nvidia-auto-select +0+0 { ForceFullCompositionPipeline = On }"
Name[de_DE]=NVIDIA set ForceFullCompositionPipeline=On
Comment[de_DE]=Keine Beschreibung


You can/should not have anything after an exec command in xinitrc.


I read through the page but where do you see nothing can be after a exec? I don’t see it.

But does my command work, or will my login be broken if I do the above?