Enable overclocking for Nvidia GPU

I broke my kernel and couldn’t fix it, so I had to reinstall my Manjaro.

Before reinstall, I was able to set GPU-core clock offset and GPU-memory clock offset from Nvidia X server.
After reinstall, when I run Nvidia X server, I no longer see these options, under “PowerMizer”

After researching I found some fixes, like creating xorg.conf file in /etc/X11, through sudo nvidia-config and editing nvidia.conf in /etc/X11/mhwd.d. But every time I edited either of these files and rebooted the system, boot screen would show that Samba has failed to initialise and then It wouldn’t load up the GUI. System would not go past [OK] Bluetooth Services, and I would have to switch to a tty and undo all the edits and then reboot the system.

I tried to disable Samba with systemctl disable samba, but it would still get stuck at [ok] Bluetooth Services and won’t go past it.

I tried GreenWithEnvy and overclocking options are greyed out.

System info:

System:    Kernel: 5.10.26-1-MANJARO x86_64 bits: 64 compiler: gcc v: 10.2.0 Desktop: KDE Plasma 5.21.3 
           Distro: Manjaro Linux base: Arch Linux 
Machine:   Type: Laptop System: HP product: HP Pavilion Notebook v: Type1ProductConfigId serial: <filter> 
           Mobo: HP model: 8216 v: 83.18 serial: <filter> UEFI: Insyde v: F.52 date: 05/02/2019 
Battery:   Device-1: hidpp_battery_0 model: Logitech Wireless Mouse MX Master 2S charge: 55% (should be ignored) 
           status: Discharging 
CPU:       Info: Dual Core model: Intel Core i7-7500U bits: 64 type: MT MCP arch: Amber/Kaby Lake note: check 
           rev: 9 cache: L2: 4 MiB 
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 23209 
           Speed: 742 MHz min/max: 400/3500 MHz Core speeds (MHz): 1: 742 2: 771 3: 700 4: 707 
Graphics:  Device-1: Intel HD Graphics 620 vendor: Hewlett-Packard driver: i915 v: kernel bus-ID: 00:02.0 
           Device-2: NVIDIA GM108M [GeForce 940MX] vendor: Hewlett-Packard driver: nvidia v: 460.67 bus-ID: 01:00.0 
           Display: x11 server: X.Org 1.20.10 driver: loaded: modesetting,nvidia resolution: 1920x1080~60Hz 
           OpenGL: renderer: Mesa Intel HD Graphics 620 (KBL GT2) v: 4.6 Mesa 21.0.1 direct render: Yes 
Audio:     Device-1: Intel Sunrise Point-LP HD Audio vendor: Hewlett-Packard driver: snd_hda_intel v: kernel 
           bus-ID: 00:1f.3 
           Device-2: JMTek LLC. USB PnP Audio Device type: USB driver: hid-generic,snd-usb-audio,usbhid 
           bus-ID: 1-6.2:5 
           Sound Server-1: ALSA v: k5.10.26-1-MANJARO running: yes 
           Sound Server-2: JACK v: 0.125.0 running: no 
           Sound Server-3: PulseAudio v: 14.2 running: yes 
           Sound Server-4: PipeWire v: 0.3.24 running: no 
Network:   Device-1: Realtek RTL810xE PCI Express Fast Ethernet vendor: Hewlett-Packard driver: r8169 v: kernel 
           port: 3000 bus-ID: 03:00.0 
           IF: eno1 state: up speed: 100 Mbps duplex: full mac: <filter> 
           Device-2: Intel Dual Band Wireless-AC 3168NGW [Stone Peak] driver: iwlwifi v: kernel port: 3000 
           bus-ID: 05:00.0 
           IF: wlo1 state: down mac: <filter> 
           IF-ID-1: virbr0 state: down mac: <filter> 
Bluetooth: Device-1: Intel Wireless-AC 3168 Bluetooth type: USB driver: btusb v: 0.8 bus-ID: 1-7:3 
           Report: This feature requires one of these tools: hciconfig/bt-adapter 
Drives:    Local Storage: total: 2.26 TiB used: 1.18 TiB (52.4%) 
           ID-1: /dev/sda vendor: Seagate model: ST2000LM003 HN-M201RAD size: 1.82 TiB 
           ID-2: /dev/sdb vendor: Western Digital model: WDS480G2G0A-00JH30 size: 447.13 GiB 
Partition: ID-1: / size: 421.94 GiB used: 106.93 GiB (25.3%) fs: ext4 dev: /dev/sdb2 
           ID-2: /boot/efi size: 299.4 MiB used: 296 KiB (0.1%) fs: vfat dev: /dev/sdb1 
Swap:      ID-1: swap-1 type: partition size: 17.08 GiB used: 0 KiB (0.0%) dev: /dev/sdb3 
Sensors:   System Temperatures: cpu: 41.0 C mobo: N/A 
           Fan Speeds (RPM): N/A 
Info:      Processes: 216 Uptime: 30m Memory: 15.52 GiB used: 2.2 GiB (14.2%) Init: systemd Compilers: gcc: 10.2.0 
           clang: 11.1.0 Packages: 1480 Shell: Zsh v: 5.8 inxi: 3.3.03 

Thank you.

You have to re-enable CoolBits options for your nvidia.conf file:

sudo nvidia-xconfig --cool-bits=12 -c /etc/X11/mhwd.d/nvidia.conf

This will automatically add a CoolBits option of with a value of 12, and also make a backup copy of your original nvidia.conf under the /etc/X11/mhwd.d/ directory, named nvidia.conf.backup:

Here is a reference of CoolBits values: NVIDIA/Tips and tricks - ArchWiki

You have to logout then login (or reboot) for it to take effect.

Why a value of 12? Because 4 + 8 equals 12. Enabling options 4 and 8 give you the following features in bold:

  • 1 - Enables overclocking of older (pre-Fermi) cores on the Clock Frequencies page in nvidia-settings.
  • 2 - When this bit is set, the driver will “attempt to initialize SLI when using GPUs with different amounts of video memory”.
  • 4 - Enables manual configuration of GPU fan speed on the Thermal Monitor page in nvidia-settings.
  • 8 - Enables overclocking on the PowerMizer page in nvidia-settings. Available since version 337.12 for the Fermi architecture and newer.
  • 16 - Enables overvoltage using nvidia-settings CLI options. Available since version 346.16 for the Fermi architecture and newer.

I ran the command
sudo nvidia-xconfig --cool-bits=12 -c /etc/X11/mhwd.d/nvidia.conf
and it gave the following error:

Using X configuration file: "/etc/X11/mhwd.d/nvidia.conf".
VALIDATION ERROR: Data incomplete in file /etc/X11/mhwd.d/nvidia.conf.
                  At least one Device section is required.
New X configuration file written to '/etc/X11/xorg.conf'

I copied Device Section part and then deleted xorg.conf. I pasted the part I copied in mhwd.d/nvidia.conf

Then I ran the command again. It gave the following output:

Using X configuration file: "/etc/X11/mhwd.d/nvidia.conf".
WARNING: No Screen specified, constructing implicit screen section.
WARNING: No Layout specified, constructing implicit layout section using screen "Default Screen".
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.
Backed up file '/etc/X11/mhwd.d/nvidia.conf' as '/etc/X11/mhwd.d/nvidia.conf.nvidia-xconfig-original'
Backed up file '/etc/X11/mhwd.d/nvidia.conf' as '/etc/X11/mhwd.d/nvidia.conf.backup'
New X configuration file written to '/etc/X11/mhwd.d/nvidia.conf'

Rebooted and still faced the same problem I did where I edited the .conf files.

Here is the content of my /etc/X11/mhwd.d/nvida.conf

# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 460.67

#
# /etc/X11/mhwd.d/nvidia.conf
#
# Configuration file for nvidia-settings - the NVIDIA X Server Settings utility
# Generated on Wed Apr 14 13:07:19 2021

Thank you

Looks like there’s some conflicting and incomplete files.

Can you backup then delete your existing nvidia.conf* files located under /etc/X11/mhwd.d/, as well as xorg.conf located under /etc/X11/ ? This will let you start clean.

The following directories should now have this content:

  • /etc/X11/ —> empty (no conf files, only folders)
  • /etc/X11/mhwd.d/ —> empty
  • /etc/X11/xorg.conf.d/ —> 90-mhwd.conf (as a symlink, and some other numerically named conf files)

Now force nvidia-xconfig to create a new /etc/X11/xorg.conf file, which will later be moved/renamed:

sudo nvidia-xconfig

Rename it to nvidia.conf and move it to the /etc/X11/mhwd.d/ directory:

sudo mv -v /etc/X11/xorg.conf /etc/X11/mhwd.d/nvidia.conf

Now try to add the CoolBits option:

sudo nvidia-xconfig --cool-bits=12 -c /etc/X11/mhwd.d/nvidia.conf

Logout and login, or reboot.

Now you should have in the following folders:

  • /etc/X11/ —> empty (no conf files, only folders)
  • /etc/X11/mhwd.d/ —> nvidia.conf (/etc/X11/xorg.conf.d/90-mhwd.conf symlinks to this)
  • /etc/X11/xorg.conf.d/ —> 90-mhwd.conf (as a symlink, and some other numerically named conf files)

Does this make any difference?

EDIT: Fixed mhwd directory name. I need coffee. :upside_down_face:

I don’t have a mhwd.conf.d directory, I have mhwd.d directory
This is the output of the ls command in /etc/X11

backup  mhwd.d  xinit  xorg.conf.d  xorg.conf.nvidia-xconfig-original  Xsession.d

I created a backup folder on both locations and moved everything you asked me to delete in that folder.
So, /etc/X11/backup and /etc/X11/mhwd.d/backup were present.

sudo nvidia=xconfig gave the following output:

WARNING: Unable to locate/open X configuration file.
New X configuration file written to '/etc/X11/xorg.conf'

then, inside /etc/X11 ran the command mv xorg.conf mhwd.d nvidia.conf

followed by sudo mv -v /etc/X11/xorg.conf /etc/X11/mhwd.conf.d/nvidia.conf

And got the following terminal output

Using X configuration file: "/etc/X11/mhwd.d/nvidia.conf".
Backed up file '/etc/X11/mhwd.d/nvidia.conf' as '/etc/X11/mhwd.d/nvidia.conf.backup'
New X configuration file written to '/etc/X11/mhwd.d/nvidia.conf'

Tried to logout but could get any display, just the system into that you get. Rebooted, but still the same thing. Samba AD Daemon failed to initialise, something like that and then started some more services then nothing. Same as before. I can’t remember the name of the exact Samba service.

One more thing. I selected non-free drivers during install, could that be the problem?

Thank you

Let’s start clean again. When you’re able to login (or use a TTY if you cannot login to a graphical session), we need to see what’s still under all of /etc/X11/.

When you made backup folders, they likely still contained files that end in *.conf, which can interfere with your settings. I should have been more clear that the “backups” need to live outside of /etc/X11/ or any sub-directories.

Backup to a home folder (or anywhere else outside of /etc/X11/) any files that you wish to save. (Or just skip this part and continue if you don’t really need these to be backed up.)

Delete the *.conf files so that you directory listings look like this. (That’s a number 1, not a lowercase “L”):


ls -1 /etc/X11/

mhwd.d
xinit
xorg.conf.d


ls -1 /etc/X11/xorg.conf.d/

00-keyboard.conf
30-touchpad.conf
90-mhwd.conf


ls -1 /etc/X11/mhwd.d/


From this clean slate, you want to create only one file that will live under /etc/mhwd.d/

First, force nvidia-xconfig to create a new xorg.conf file where non currently exists. With no arguments, it will notice that /etc/X11/xorg.conf is missing and will re-create it. You can ignore the error messages it will spit out:

sudo nvidia-xconfig

Immediately follow this with:

sudo nvidia-xconfig --cool-bits=12 -c /etc/X11/xorg.conf

And finally move it to the mhwd.d directory with the name nvidia.conf

sudo mv -v /etc/X11/xorg.conf /etc/X11/mhwd.d/nvidia.conf

You can safely delete the residual backup files:

sudo rm -v /etc/X11/xorg.conf.backup
sudo rm -v /etc/X11/xorg.conf.nvidia-xconfig-original


You should only have

  • one nvidia.conf under file /etc/X11/mhwd.d/

  • zero .conf files under /etc/X11/

  • and a symlink named 90-mhwd.conf under /etc/X11/xorg.conf.d/, which references /etc/X11/mhwd.d/nvidia.conf


Everything will look like this when you ls with the -1 flag:

ls -1 /etc/X11/

mhwd.d
xinit
xorg.conf.d


ls -1 /etc/X11/xorg.conf.d/

00-keyboard.conf
30-touchpad.conf
90-mhwd.conf


ls -1 /etc/X11/mhwd.d/

nvidia.conf


From here it’s a good idea to make a backup of your nvidia.conf (in case an update overwrites it), but make sure to it doesn’t end with .conf:

sudo cp -v /etc/X11/mhwd.d/nvidia.conf /etc/X11/mhwd.d/nvidia.conf.coolbits_backup


The free driver is nouveau (not nvidia), and hence you will have lower performance and fewer features, and you cannot use nouveau to overclock the GPU. For what you want to do, you must use the non-free driver, which was the correct choice during installation.

Before making the changes:

/etc/X11
ls -1

mhwd.d
xinit
xorg.conf.d
Xsession.d

/etc/X11/xorg.conf.d
ls -1

00-keyboard.conf
30-touchpad.conf
90-mhwd.conf

/etc/X11/mhwd.d
ls -1
//*nothing*

After making changes

/etc/X11

mhwd.d
xinit
xorg.conf.d
Xsession.d

/etc/X11/xorg.conf.d

00-keyboard.conf
30-touchpad.conf
90-mhwd.conf

/etc/X11/mhwd.d

nvidia.conf

I checked, 90-mhwd.conf is a link to /etc/X11/mhwd.d/nvida.conf

Contents of nvidia.conf

Still the same issue.

I logged in as root in the tty and checked some logs, the following one I found interesting.

My laptop’s screen was not working so I removed it and I am only using external display.

Well, the chassis (body) of the laptop broke, I was just using the motherboard connected to the display. And even that display gave out. So its now just the motherboard connected to external monitor.

I think this is beyond the scope of Nvidia’s overclock settings. :hushed:

I appreciate your time.
Thanks!