Need some help with a script to enable NVIDIA forcefullcompositing automatically


#21

When an exec command is executed, nothing else after that command is executed, UNTIL that command ends/exits.
Use exec only for the last command in xinitrc.
Which one, I don’t know …


#22

Ahh, like that. Yeah that I did read in the link and that makes sense.

Do A and when that is done, do B, but it never get’s there. Maybe if I do my line with exec-session && my-exec, it works?


#23

Sh@# I had forgotten about it. A friend of mine has done something that way and he hadn’t noticed that it didn’t work.

Right above the line that has the exec $(get_session) add the xrandr command like this:

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 &

However, now that I think of it, are you 100% sure you cant set those values using nvidia-settings? If you can set those settings there, they will be added to the nvidia.conf file and you wont have to used xrandr.


#24

Well, I just tried it, with just the nvidia.conf at the moment, did it exactly as you said but after a reboot, force compo… was not enabled and the refresh rate was back at 60hz as well.

Linux/NVIDIA is so strange.


#25

Can you post them Nvidia.conf file?


#26

Offcourse,

# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings:  version 415.18

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
    Option         "Xinerama" "0"
EndSection

Section "Files"
EndSection

Section "Module"
    Load           "dbe"
    Load           "extmod"
    Load           "type1"
    Load           "freetype"
    Load           "glx"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"
    # HorizSync source: edid, VertRefresh source: edid
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "BenQ XL2410T"
    HorizSync       30.0 - 140.0
    VertRefresh     56.0 - 120.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GTX 1080"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "nvidiaXineramaInfoOrder" "DFP-6"
    Option         "metamodes" "DVI-D-0: 1920x1080_120 +0+0 {rotation=left, ForceCompositionPipeline=On, ForceFullCompositionPipeline=On, AllowGSYNC=Off}, HDMI-0: nvidia-auto-select +3000+423 {ForceCompositionPipeline=On, ForceFullCompositionPipeline=On, AllowGSYNC=Off}, DP-4: 1920x1080_144 +1080+423 {ForceCompositionPipeline=On, ForceFullCompositionPipeline=On, AllowGSYNC=Off}"
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

I am at least happy to see the settings aren’t erased/resetted after a reboot.

This is also how the folders look:

Left = /etc/X11/mhwd.d & right = /etc/X11/xorg.conf.d


#27

I’m not very familiar with the configs, but did you change the settings for the refresh rate in the Nvidia settings or left them at Auto?

The composition is enabled in the confing. This is buffaloing. I that same thing works fine for me. Where did you check to see that composition was disabled?


#28

In the nvidia-settings app.

If I leave the refresh at auto it always picks 60hz. Hence I made my xrandr to set the correct refresh rates.

After I did my xrander I made the nvidia-settings config so the refresh rate would also be included together with the forcecompositing.

It’s these small quirks that makes Linux feel imperfect. But it seems it works for you?

I always had this problem with my display settings. Even when I was using Ubuntu flavors of Linux.

Hell, on Manjaro I have file explorer that always defaults to a small window size. Thunderbird is the same. I can make them larger vertically just fine, but making them wider only works for when I have the window open.

When I re-open them the horizontal size is resetted back to a smaller size.

My laptop does not have that issue so I assume this bug is because of my left vertical monitor.

But that is another tech support thread. :wink:


#29

I’ll have to get back to you. I don’t have a high refresh rate monitor but I have 2monitors. FPC was one of the things I would set end forget… I don’t know how it works for me and not for you.


#30

No rush. If you have a answer, let me know and if not, so be it. :stuck_out_tongue:

I will keep looking around for a solution in the meantime.


#31

Have you read the posted links on Archwiki-nvidia?
It may not be possible to have the refresh rate different on each monitor.
You haven’t mentioned what DE you use, or any other info.
There are at least three ways to configure what you want.
Nvidia settings have a cli tool and you can save your user nvidia profile/config either as ~/.nvidia-settings-rc or a autostart script in more than one place and it still depends on your DE.

Please spend some time reading at the wiki articles, it’s all there… :wink:

Multiple monitors and


#32

I haven’t used that location for settings, so help me get that straight. Instead of saving the configurations in the /etc/... folder he can save them there with the nvidia-settings? Same way he did before, but in another location.

If that’s the case then @Sojiro84 can add

nvidia-settings --load-config-only &

above the xrandr command in the ~/.xinitrc file, instead of an autostart script. It’s also recommended here. I don’t think it will perform any faster, but it works the same on every DE/WM.


#33

I already did that, but nvidia-settings file doesn’t contain the display settings. It only contains the more basic stuff like flipping allowed, color settings etc.

Display settings like rotation and refresh rate are in the nvidi.conf file.

Also, I made the nvidia settings read-only because if I didn’t do that, nvidia-settings would reset the display color settings.

I wonder if AMD users have the same problem.

BTW, I use the Cinnamon DE. Also, I would find it strange if Linux can’t handle multiple monitors at different refresh rates. if that is the case then it’s a serious flaw if the OS.


#34

BTW, is it only 1 & and not 2 && ?


#35

I only mentioned it, because my monitors are 60Hz so even if I wanted to I couldn’t increase the refresh rate. I have only done that on Windows, but it was an overclock from 60 to 73Hz. By the way when you say "already did ‘that’ " what do you mean?

Never occurred to me that it could happen, but I didn’t even think that what worked for me with a 1050ti and the same drivers wouldn’t work for you. (regarding the composition)

The meaning of && and & are intrinsically different.

  • What is && in bash ? In bash —and many other programming languages— && means “AND”. And in command execution context like this, it means items to the left as well as right of && should be run in sequence in this case.
  • What is & in bash ? And a single & means that the preceding commands—to the immediate left of the & —should simply be run in the background.

https://stackoverflow.com/questions/26770568/vs-with-the-test-command-in-bash

I don’t know if there are cases where you would need " && " in the xinitrc file. All of the ~/.xinitrc files I’ve seen on youtube and github use a single ‘&’.