Linux GUI NVIDIA Setup and Hacks

From WikiMLT
Revision as of 11:05, 29 April 2023 by Spas (talk | contribs) (Стадий: 4 [Фаза:Авторизиране, Статус:Разработен]; Категория:Linux Desktop)
Figure 1. Change NVIDIA X Serv­er Set­tings > Pow­er Miz­er > Per­for­mance Lev­el via GUI (NVIDIA dri­ver ver­sion 525).

Per­for­mance mode

You can change the per­for­mance mode ei­ther from the GUI via NVIDIA X Serv­er Set­tings tool: Pow­er­Miz­er > Per­for­mance Mode – see Fig­ure 1. You can change the de­fault per­for­mance mode by chang­ing xorg.conf or you can change it via the CLI by the fol­low­ing com­mands.

nvidia-settings -a [gpu:0]/GPUPowerMizerMode=0  # Adaptive
nvidia-settings -a [gpu:0]/GPUPowerMizerMode=1  # Prefer Maximum Performance
nvidia-settings -a [gpu:0]/GPUPowerMizerMode=2  # Auto
nvidia-settings -a [gpu:0]/GPUPowerMizerMode=3  # Prefer Consistent Performance
Figure 1. Change NVIDIA X Serv­er Set­tings > Dis­play Con­fig­u­ra­tion > Force Com­po­si­tion Pipeline (NVIDIA dri­ver ver­sion 525) to im­prove v‑sync per­for­mance on ful screen video play­ing.

Deal with the bad vSync on full screen video

Top­ics about such is­sue could be found in In­ter­net back to 2010. Most of the pro­posed so­lu­tions doesn't do any­thing with lat­est NVIDIA dri­ver (525 2003y). The on­ly dis­cus­sion that was help­ful to me was NVIDIA Video Tear­ing at Ubun­tu fo­rums and es­pe­cial­ly the ad­vice re­lat­ed to xorg.conf. Al­so I didn't changed the OpenGL re­lat­ed set­tings pro­posed in the linked com­ment.

In ad­di­tion I've forced the full com­po­si­tion pipeline – see Fig­ure 2, which I was found as ad­vice some­where with­in my re­search…

So the steps that (I hope) solved the prob­lem for me was:

  1. Run: su­do nvidia-xcon­fig
  2. Open nvidia-set­tings and check the Force Full Com­po­si­tion Pipeline op­tion – Fig 2, you will need to en­able Ad­vanced op­tions.
  3. Gen­er­ate new xorg.conf from with­in nvidia-set­tings and copy the the line Op­tion "me­ta­modes" … from the Screen sec­tion.
  4. Mod­i­fy the De­vice sec­tion in that file xorg.conf, as it is pro­posed in the men­tioned dis­cus­sion NVIDIA Video Tear­ing.
  5. Place the new con­fig­u­ra­tion file in its place: /etc/X11/xorg.conf and re­boot the sys­tem, just to be sure the set­tings are per­ma­nent­ly ap­plied.

Here is my fi­nal xorg.conf con­fig­u­ra­tion.

/etc/X11/xorg.conf
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 525.105.17


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

Section "Files"
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"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    Option         "DPMS"
EndSection

Section "Device"
    # Nvidia Video Tearing: https://ubuntuforums.org/showthread.php?t=2235382&p=13079406#post13079406
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "NVIDIA T600"
    Option         "RegistryDwords" "PerfLevelSrc=0x2222"
    Option         "TripleBuffer" "True"
    # PowerMizer: https://forums.developer.nvidia.com/t/how-to-automatically-set-powermizer-to-prefer-maximum-performace-with-340-and-346-drivers/37980
    # Option         "Coolbits" "13"
    # Option         "RegistryDwords" "PowerMizerEnable=0x1; PerfLevelSrc=0x2222; PowerMizerDefaultAC=0x1"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "metamodes" "DP-7: nvidia-auto-select +2560+0 {ForceCompositionPipeline=On, ForceFullCompositionPipeline=On}, DP-1: nvidia-auto-select +0+0 {ForceCompositionPipeline=On, ForceFullCompositionPipeline=On}; DP-7: nvidia-auto-select +0+0, DP-1: nvidia-auto-select +0+0; DP-7: nvidia-auto-select +0+0, DP-1: 1920x1080 +0+0; DP-7: nvidia-auto-select +0+0, DP-1: 1920x1080_60_0 +0+0; DP-7: nvidia-auto-select +0+0, DP-1: 1920x1080_50 +0+0; DP-7: nvidia-auto-select +0+0, DP-1: 1920x1080_30 +0+0; DP-7: nvidia-auto-select +0+0, DP-1: 1680x1050 +0+0; DP-7: nvidia-auto-select +0+0, DP-1: 1600x900 +0+0; DP-7: nvidia-auto-select +0+0, DP-1: 1280x1024 +0+0; DP-7: nvidia-auto-select +0+0, DP-1: 1280x1024_60 +0+0; DP-7: nvidia-auto-select +0+0, DP-1: 1280x720 +0+0; DP-7: nvidia-auto-select +0+0, DP-1: 1280x720_60_0 +0+0; DP-7: nvidia-auto-select +0+0, DP-1: 1280x720_50 +0+0; DP-7: nvidia-auto-select +0+0, DP-1: 1152x864 +0+0; DP-7: nvidia-auto-select +0+0, DP-1: 1024x768 +0+0; DP-7: nvidia-auto-select +0+0, DP-1: 1024x768_60 +0+0; DP-7: nvidia-auto-select +0+0, DP-1: 800x600 +0+0; DP-7: nvidia-auto-select +0+0, DP-1: 800x600_60 +0+0; DP-7: nvidia-auto-select +0+0, DP-1: 720x576 +0+0; DP-7: nvidia-auto-select +0+0, DP-1: 720x480 +0+0; DP-7: nvidia-auto-select +0+0, DP-1: 640x480 +0+0; DP-7: nvidia-auto-select +0+0, DP-1: 640x480_60 +0+0; DP-7: nvidia-auto-select +0+0, DP-1: 640x480_60_0 +0+0; DP-7: nvidia-auto-select +0+0, DP-1: nvidia-auto-select +0+0 {viewportin=1440x900, viewportout=1728x1080+416+0}; DP-7: nvidia-auto-select +0+0, DP-1: nvidia-auto-select +0+0 {viewportin=1366x768, viewportout=1920x1080+320+0}; DP-7: nvidia-auto-select +0+0, DP-1: nvidia-auto-select +0+0 {viewportin=1280x800, viewportout=1728x1080+416+0}"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection