Linux GUI NVIDIA Setup and Hacks: Difference between revisions

From WikiMLT
mNo edit summary
m (Стадий: 6 [Фаза:Утвърждаване, Статус:Утвърден]; Категория:Linux Desktop)
 
(11 intermediate revisions by the same user not shown)
Line 1: Line 1:
<noinclude>{{ContentArticleHeader/Linux_Desktop|toc=off}}{{ContentArticleHeader/Hardware}}</noinclude>
<noinclude>{{ContentArticleHeader/Linux_Desktop|toc=off}}{{ContentArticleHeader/Hardware}}</noinclude>{{Media
 
| n = 1
| img = NVIDIA.525.X Server Settings.PowerMizer.PerformanceLevel.webp
| sz = 300
}}
== Performance mode ==
== Performance mode ==
You can change the performance mode either from the GUI via <code>NVIDIA X Server Settings</code> tool: <code>PowerMizer</code> > <code>Performance Mode</code> - see {{Media-cite|f|1}}. You can change the default performance mode by changing <code>[https://forums.developer.nvidia.com/t/how-to-automatically-set-powermizer-to-prefer-maximum-performace-with-340-and-346-drivers/37980 xorg.conf]</code> or you can change it via the CLI by the following [https://forums.developer.nvidia.com/t/always-put-gpu-in-full-speed-p0/41182 commands].  
You can change the performance mode either from the GUI via <code>NVIDIA X Server Settings</code> tool: <code>PowerMizer</code> > <code>Performance Mode</code> - see {{Media-cite|f|1}}. You can change the default performance mode by changing <code>[https://forums.developer.nvidia.com/t/how-to-automatically-set-powermizer-to-prefer-maximum-performace-with-340-and-346-drivers/37980 xorg.conf]</code> or you can change it via the CLI by the following [https://forums.developer.nvidia.com/t/always-put-gpu-in-full-speed-p0/41182 commands].  
{{Media
<syntaxhighlight lang="shell" line="1">
| n = 1
| img = NVIDIA.525.X Server Settings.DisplayConfiguration.ForceCompositionPipeline.webp
}}<syntaxhighlight lang="shell" line="1">
nvidia-settings -a [gpu:0]/GPUPowerMizerMode=0  # Adaptive
nvidia-settings -a [gpu:0]/GPUPowerMizerMode=0  # Adaptive
nvidia-settings -a [gpu:0]/GPUPowerMizerMode=1  # Prefer Maximum Performance
nvidia-settings -a [gpu:0]/GPUPowerMizerMode=1  # Prefer Maximum Performance
nvidia-settings -a [gpu:0]/GPUPowerMizerMode=2  # Auto
nvidia-settings -a [gpu:0]/GPUPowerMizerMode=2  # Auto
nvidia-settings -a [gpu:0]/GPUPowerMizerMode=3  # Prefer Consistent Performance
nvidia-settings -a [gpu:0]/GPUPowerMizerMode=3  # Prefer Consistent Performance
</syntaxhighlight>{{Media
| n = 1
| img = NVIDIA.525.X Server Settings.DisplayConfiguration.ForceCompositionPipeline.webp
| sz = 300
}}
== Deal with the bad vSync on full screen video ==
Topics about such issue could be found in Internet back to 2010. Most of the proposed solutions doesn't do anything with latest NVIDIA driver (525 2003y). The only discussion that was helpful to me was [https://ubuntuforums.org/showthread.php?t=2235382&p=13079406#post13079406 NVIDIA Video Tearing at Ubuntu forums] and especially the advice related to <code>xorg.conf</code>. Also I didn't changed the OpenGL related settings proposed in the linked comment.
In addition I've forced the full composition pipeline - see {{Media-cite|f|2}}, which I was found as advice somewhere within my research...
So the steps that (I hope) solved the problem for me was:
# Run: <code>sudo nvidia-xconfig</code>
# Open <code>nvidia-settings</code> and check the <code>Force Full Composition Pipeline</code> option - {{Media-cite|f|2|4=Fig}}, you will need to enable <code>Advanced</code> options.
# Generate new <code>xorg.conf</code> from within <code>nvidia-settings</code> and copy the the line <code>Option "me&shy;ta&shy;modes" ...</code> from the <code>Screen</code> section.
# Modify the <code>Device</code> section in that file <code>xorg.conf</code>, as it is proposed in the mentioned discussion [https://ubuntuforums.org/showthread.php?t=2235382&p=13079406#post13079406 NVIDIA Video Tearing].
# Place the new configuration file in its place: <code>/etc/X11/xorg.conf</code> and reboot the system, just to be sure the settings are permanently applied.
Here is my final <code>xorg.conf</code> configuration.
<syntaxhighlight lang="shell" class="code-continue">
/etc/X11/xorg.conf
</syntaxhighlight>
</syntaxhighlight>
<syntaxhighlight lang="ini">
# 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 1 ==
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


<noinclude>
</syntaxhighlight><noinclude>
<div id='devStage'>
<div id='devStage'>
{{devStage  
{{devStage  
  | Прндл  = Linux Desktop
  | Прндл  = Linux Desktop
  | Прндл1 = Hardware
  | Прндл1 = Hardware
  | Стадий = 3
  | Стадий = 6
  | Фаза  = Разработване
  | Фаза  = Утвърждаване
  | Статус = Разработван
  | Статус = Утвърден
  | ИдтПт  = Spas
  | ИдтПт  = Spas
  | РзбПт  = {{REVISIONUSER}}
  | РзбПт = Spas
| АвтПт  = Spas
| УтвПт = {{REVISIONUSER}}
  | ИдтДт  = 29.04.2023
  | ИдтДт  = 29.04.2023
  | РзбДт  = {{Today}}
  | РзбДт = 29.04.2023
| АвтДт  = 29.04.2023
| УтвДт = {{Today}}
  | ИдтРв  = [[Special:Permalink/32458|32458]]
  | ИдтРв  = [[Special:Permalink/32458|32458]]
  | РзбРв  = {{REVISIONID}}
  | РзбРв = [[Special:Permalink/32475|32475]]
| АвтРв  = [[Special:Permalink/32476|32476]]
| УтвРв = {{REVISIONID}}
}}
}}
</div>
</div>
</noinclude>
</noinclude>

Latest revision as of 12:07, 29 April 2023

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