Drivers [SOLVED]: Edits to nvidia-xconfig not taking hold after restart?

Drivers [SOLVED]: Edits to nvidia-xconfig not taking hold after restart?

Home Forums Drivers Drivers [SOLVED]: Edits to nvidia-xconfig not taking hold after restart?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #36913

    Anonymous

    QuestionQuestion

    I’m building up a set of bash scripts to enable the overclocking of GPUs installed in my Ubuntu 16.04 system using the NVidia 384.98 driver.

    For my first script I am trying to set the cool-bits (Bottom of linked page) option via nvidia-xconfig. My script is below

    #!/bin/bash
    
    # Secure required privledges
    [ "$UID" -eq 0 ] || exec sudo bash "$0" "$@"
    
    #== Enable overclocking in NVidia X settings (Replace/Add cool-bits for all GPUs installed)
    # - 1 (bit 0) - Enables overclocking of older (pre-Fermi) cores on the Clock Frequencies page in nvidia-settings.
    # - 2 (bit 1) - Driver will "attempt to initialize SLI when using GPUs with different amounts of video memory".
    # - 4 (bit 2) - Enables manual configuration of GPU fan speed on the Thermal Monitor page in nvidia-settings.
    # - 8 (bit 3) - Enables overclocking on the PowerMizer page in nvidia-settings. 
    # - 16(bit 4) - Enables overvoltage using nvidia-settings CLI options. 
    echo "============ CoolBits12_AllCards.sh: Started ============"
    echo ">> Setting nvidia-xconfig cool-bits=12..."
    sudo nvidia-xconfig -a --cool-bits=12 --allow-empty-initial-configuration
    echo ">> ! Please restart for changes to take effect !"
    echo "=========== CoolBits12_AllCards.sh: Completed ==========="
    

    I am basically only running the command

    sudo nvidia-xconfig -a --cool-bits=12 --allow-empty-initial-configuration
    

    My initial etc/X11/xorg.conf looks as such

    Section "ServerLayout"
        Identifier "layout"
        Screen 0 "nvidia"
        Inactive "intel"
    EndSection
    
    Section "Device"
        Identifier "intel"
        Driver "modesetting"
        BusID "PCI:0@0:2:0"
        Option "AccelMethod" "None"
    EndSection
    
    Section "Screen"
        Identifier "intel"
        Device "intel"
    EndSection
    
    Section "Device"
        Identifier "nvidia"
        Driver "nvidia"
        BusID "PCI:5@0:0:0"
        Option "ConstrainCursor" "off"
    EndSection
    
    Section "Screen"
        Identifier "nvidia"
        Device "nvidia"
        Option "AllowEmptyInitialConfiguration" "on"
        Option "IgnoreDisplayDevices" "CRT"
    EndSection
    
    Section "Device"
        Identifier "nvidia"
        Driver "nvidia"
        BusID "PCI:6@0:0:0"
        Option "ConstrainCursor" "off"
    EndSection
    
    Section "Screen"
        Identifier "nvidia"
        Device "nvidia"
        Option "AllowEmptyInitialConfiguration" "on"
        Option "IgnoreDisplayDevices" "CRT"
    EndSection
    

    (Though mind you, I have ran the script a few times trying to get it to work, this might not be what it was originally. This reflects the script after a restart)

    The output of running the script

    ============ CoolBits12_AllCards.sh: Started ============
    >> Setting nvidia-xconfig cool-bits=12...
    
    Using X configuration file: "/etc/X11/xorg.conf".
    
    WARNING: Unable to find CorePointer in X configuration; attempting to add new
             CorePointer section.
    
    
    WARNING: The CorePointer device was not specified explicitly in the layout;
             using the first mouse device.
    
    
    WARNING: Unable to find CoreKeyboard in X configuration; attempting to add new
             CoreKeyboard section.
    
    
    WARNING: The CoreKeyboard device was not specified explicitly in the layout;
             using the first keyboard device.
    
    Option "AllowEmptyInitialConfiguration" "True" added to Screen "Screen0".
    Option "AllowEmptyInitialConfiguration" "True" added to Screen "Screen1".
    Backed up file '/etc/X11/xorg.conf' as
    '/etc/X11/xorg.conf.nvidia-xconfig-original'
    Backed up file '/etc/X11/xorg.conf' as '/etc/X11/xorg.conf.backup'
    New X configuration file written to '/etc/X11/xorg.conf'
    
    >> ! Please restart for changes to take effect !
    =========== CoolBits12_AllCards.sh: Completed ===========
    

    And after running the script my /etc/X11/xorg.conf looks like so

    # nvidia-xconfig: X configuration file generated by nvidia-xconfig
    # nvidia-xconfig:  version 384.98  (buildmeister@swio-display-x86-rhel47-02)  Thu Oct 26 15:56:05 PDT 2017
    
    Section "ServerLayout"
        Identifier     "layout"
        Screen      0  "Screen0"
        Screen      1  "Screen1" RightOf "Screen0"
        Inactive       "intel"
        InputDevice    "Keyboard0" "CoreKeyboard"
        InputDevice    "Mouse0" "CorePointer"
    EndSection
    
    Section "InputDevice"
        # generated from default
        Identifier     "Keyboard0"
        Driver         "keyboard"
    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 "Monitor"
        Identifier     "Monitor0"
        VendorName     "Unknown"
        ModelName      "Unknown"
        HorizSync       28.0 - 33.0
        VertRefresh     43.0 - 72.0
        Option         "DPMS"
    EndSection
    
    Section "Monitor"
        Identifier     "Monitor1"
        VendorName     "Unknown"
        ModelName      "Unknown"
        HorizSync       28.0 - 33.0
        VertRefresh     43.0 - 72.0
        Option         "DPMS"
    EndSection
    
    Section "Device"
        Identifier     "Device0"
        Driver         "nvidia"
        VendorName     "NVIDIA Corporation"
        BoardName      "GeForce GTX 1060 3GB"
        BusID          "PCI:5:0:0"
    EndSection
    
    Section "Device"
        Identifier     "Device1"
        Driver         "nvidia"
        VendorName     "NVIDIA Corporation"
        BoardName      "GeForce GTX 1060 3GB"
        BusID          "PCI:6:0:0"
    EndSection
    
    Section "Screen"
        Identifier     "Screen0"
        Device         "Device0"
        Monitor        "Monitor0"
        DefaultDepth    24
        Option         "AllowEmptyInitialConfiguration" "True"
        Option         "Coolbits" "12"
        SubSection     "Display"
            Depth       24
        EndSubSection
    EndSection
    
    Section "Screen"
        Identifier     "Screen1"
        Device         "Device1"
        Monitor        "Monitor1"
        DefaultDepth    24
        Option         "AllowEmptyInitialConfiguration" "True"
        Option         "Coolbits" "12"
        SubSection     "Display"
            Depth       24
        EndSubSection
    EndSection
    

    I have verified, that after restarting the computer the first /etc/X11/xorg.conf file contents listed first in the question are in place; the altered file/file contents did not hold.

    Why do my changes to the /etc/X11/xorg.conf file not hold?


    At some point I ran the script above twice prior to a restart, for completion sake, and potentially more information the output of the script is shown below

    ============ CoolBits12_AllCards.sh: Started ============
    >> Setting nvidia-xconfig cool-bits=12...
    
    Using X configuration file: "/etc/X11/xorg.conf".
    
    VALIDATION ERROR: Data incomplete in file /etc/X11/xorg.conf.
                      Undefined Device "intel" referenced by Screen "layout".
    
    Package xorg-server was not found in the pkg-config search path.
    Perhaps you should add the directory containing `xorg-server.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'xorg-server' found
    Option "AllowEmptyInitialConfiguration" "True" added to Screen "Screen0".
    Option "AllowEmptyInitialConfiguration" "True" added to Screen "Screen1".
    Backed up file '/etc/X11/xorg.conf' as
    '/etc/X11/xorg.conf.nvidia-xconfig-original'
    Backed up file '/etc/X11/xorg.conf' as '/etc/X11/xorg.conf.backup'
    New X configuration file written to '/etc/X11/xorg.conf'
    
    >> ! Please restart for changes to take effect !
    =========== CoolBits12_AllCards.sh: Completed ===========
    

    #36914

    Anonymous

    Accepted AnswerAnswer

    I had a similar problem repairing screen tearing for nVidia. Even if I deleted /etc/X11/xorg.conf it would be recreated on reboot. The solution is to put your custom changes into:

    /etc/X11/xorg.conf.d/20-nvidia.conf
    

    A thorough write-up of nVidia modifications can be found here.

    Source: https://askubuntu.com/questions/989746/edits-to-nvidia-xconfig-not-taking-hold-after-restart
    Author: WinEunuuchs2Unix
    Creative Commons License
    This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.