- NVIDIA/Tips and tricks
- Contents
- Fixing terminal resolution
- Using TV-out
- X with a TV (DFP) as the only display
- Headless (no monitor) resolution
- Check the power source
- Listening to ACPI events
- Displaying GPU temperature in the shell
- nvidia-settings
- nvidia-smi
- nvclock
- Overclocking and cooling
- Enabling overclocking
- Setting static 2D/3D clocks
- Allow change to highest performance mode
- Saving overclocking settings
- Custom TDP Limit
- Set fan speed at login
- Kernel module parameters
- Preserve video memory after suspend
- Driver persistence
- Try and force Linux Nvidia cards to higher Performance Level , ie. pstate ie perflevel #456
- Comments
- twiggy commented Dec 21, 2017
- Profetul commented Dec 23, 2017
- bm2k commented Jan 9, 2018
- Profetul commented Jan 10, 2018 •
- DeadManWalkingTO commented Feb 27, 2018
- eeerrrttty commented Mar 4, 2018
- DeadManWalkingTO commented Mar 4, 2018
- Linux
- eeerrrttty commented Mar 4, 2018
NVIDIA/Tips and tricks
Contents
Fixing terminal resolution
Transitioning from nouveau may cause your startup terminal to display at a lower resolution.
For systemd-boot, set console-mode in esp/EFI/loader/loader.conf . See systemd-boot#Loader configuration for details.
For rEFInd, add to esp/EFI/refind/refind.conf and /etc/refind.d/refind.conf (latter file is optional but recommended):
A small caveat is that this will hide the kernel parameters from being shown during boot.
Using TV-out
X with a TV (DFP) as the only display
The X server falls back to CRT-0 if no monitor is automatically detected. This can be a problem when using a DVI connected TV as the main display, and X is started while the TV is turned off or otherwise disconnected.
To force NVIDIA to use DFP, store a copy of the EDID somewhere in the filesystem so that X can parse the file instead of reading EDID from the TV/DFP.
To acquire the EDID, start nvidia-settings. It will show some information in tree format, ignore the rest of the settings for now and select the GPU (the corresponding entry should be titled «GPU-0» or similar), click the DFP section (again, DFP-0 or similar), click on the Acquire Edid Button and store it somewhere, for example, /etc/X11/dfp0.edid .
If in the front-end mouse and keyboard are not attached, the EDID can be acquired using only the command line. Run an X server with enough verbosity to print out the EDID block:
After the X Server has finished initializing, close it and your log file will probably be in /var/log/Xorg.0.log . Extract the EDID block using nvidia-xconfig:
Edit xorg.conf by adding to the Device section:
The ConnectedMonitor option forces the driver to recognize the DFP as if it were connected. The CustomEDID provides EDID data for the device, meaning that it will start up just as if the TV/DFP was connected during X the process.
This way, one can automatically start a display manager at boot time and still have a working and properly configured X screen by the time the TV gets powered on.
If the above changes did not work, in the xorg.conf under Device section you can try to remove the Option «ConnectedMonitor» «DFP» and add the following lines:
The NoDFPNativeResolutionCheck prevents NVIDIA driver from disabling all the modes that do not fit in the native resolution.
Headless (no monitor) resolution
In headless mode, resolution falls back to 640×480, which is used by VNC or Steam Link. To start in a higher resolution e.g. 1920×1080, specify a Virtual entry under the Screen subsection in xorg.conf :
Check the power source
The NVIDIA X.org driver can also be used to detect the GPU’s current source of power. To see the current power source, check the ‘GPUPowerSource’ read-only parameter (0 — AC, 1 — battery):
Listening to ACPI events
NVIDIA drivers automatically try to connect to the acpid daemon and listen to ACPI events such as battery power, docking, some hotkeys, etc. If connection fails, X.org will output the following warning:
While completely harmless, you may get rid of this message by disabling the ConnectToAcpid option in your /etc/X11/xorg.conf.d/20-nvidia.conf :
If you are on laptop, it might be a good idea to install and enable the acpid daemon instead.
Displaying GPU temperature in the shell
There are three methods to query the GPU temperature. nvidia-settings requires that you are using X, nvidia-smi or nvclock do not. Also note that nvclock currently does not work with newer NVIDIA cards such as GeForce 200 series cards as well as embedded GPUs such as the Zotac IONITX’s 8800GS.
nvidia-settings
To display the GPU temp in the shell, use nvidia-settings as follows:
This will output something similar to the following:
The GPU temps of this board is 41 C.
In order to get just the temperature for use in utilities such as rrdtool or conky:
nvidia-smi
Use nvidia-smi which can read temps directly from the GPU without the need to use X at all, e.g. when running Wayland or on a headless server. To display the GPU temperature in the shell, use nvidia-smi as follows:
This should output something similar to the following:
Only for temperature:
In order to get just the temperature for use in utilities such as rrdtool or conky:
nvclock
Use nvclock AUR which is available from the AUR.
There can be significant differences between the temperatures reported by nvclock and nvidia-settings/nv-control. According to this post by the author (thunderbird) of nvclock, the nvclock values should be more accurate.
Overclocking and cooling
Enabling overclocking
Overclocking is controlled via Coolbits option in the Device section, which enables various unsupported features:
The Coolbits value is the sum of its component bits in the binary numeral system. The component bits are:
- 1 (bit 0) — Enables overclocking of older (pre-Fermi) cores on the Clock Frequencies page in nvidia-settings.
- 2 (bit 1) — When this bit is set, the 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. Available since version 337.12 for the Fermi architecture and newer.[1]
- 16 (bit 4) — Enables overvoltage using nvidia-settings CLI options. Available since version 346.16 for the Fermi architecture and newer.[2]
To enable multiple features, add the Coolbits values together. For example, to enable overclocking and overvoltage of Fermi cores, set Option «Coolbits» «24» .
The documentation of Coolbits can be found in /usr/share/doc/nvidia/html/xconfigoptions.html and here.
Setting static 2D/3D clocks
Set the following string in the Device section to enable PowerMizer at its maximum performance level (VSync will not work without this line):
Allow change to highest performance mode
The factual accuracy of this article or section is disputed.
Since changing performance mode and overclocking memory rate has little to no effect in nvidia-settings, try this:
- Setting Coolbits to 24 or 28 and remove Powermizer RegistryDwords -> Restart X
- find out max. Clock and Memory rate. (this can be LOWER than what your gfx card reports after booting!):
- set rates for GPU 0:
After setting the rates the max. performance mode works in nvidia-settings and you can overclock graphics-clock and memory transfer rate.
Saving overclocking settings
Typically, clock and voltage offsets inserted in the nvidia-settings interface are not saved, being lost after a reboot. Fortunately, there are tools that offer an interface for overclocking under the proprietary driver, able to save the user’s overclocking preferences and automatically applying them on boot. Some of them are:
- gweAUR — graphical, applies settings on desktop session start
- nvclockAUR and systemd-nvclock-unitAUR — graphical, applies settings on system boot
- nvocAUR — text based, profiles are configuration files in /etc/nvoc.d/ , applies settings on desktop session start
Custom TDP Limit
Modern Nvidia graphics cards throttle frequency to stay in their TDP and temperature limits. To increase performance it is possible to change the TDP limit, which will result in higher temperatures and higher power consumption.
For example, to set the power limit to 160.30W:
To set the power limit on boot (without driver persistence):
Set fan speed at login
This article or section needs language, wiki syntax or style improvements. See Help:Style for reference.
You can adjust the fan speed on your graphics card with nvidia-settings’ console interface. First ensure that your Xorg configuration has enabled the bit 2 in the Coolbits option.
Place the following line in your xinitrc file to adjust the fan when you launch Xorg. Replace n with the fan speed percentage you want to set.
You can also configure a second GPU by incrementing the GPU and fan number.
If you use a login manager such as GDM or SDDM, you can create a desktop entry file to process this setting. Create
/.config/autostart/nvidia-fan-speed.desktop and place this text inside it. Again, change n to the speed percentage you want.
To make it possible to adjust the fanspeed of more than one graphics card, run:
Kernel module parameters
This article or section needs language, wiki syntax or style improvements. See Help:Style for reference.
Some options can be set as kernel module parameters, a full list can be obtained by running modinfo nvidia or looking at nv-reg.h . See Gentoo:NVidia/nvidia-drivers#Kernel module parameters as well.
For example, enabling the following will turn on kernel mode setting (see above) and enable the PAT feature [5], which affects how memory is allocated. PAT was first introduced in Pentium III [6] and is supported by most newer CPUs (see wikipedia:Page attribute table#Processors). If your system can support this feature, it should improve performance.
On some notebooks, to enable any nvidia settings tweaking you must include this option, otherwise it responds with «Setting applications clocks is not supported» etc.
Preserve video memory after suspend
By default the NVIDIA Linux drivers save and restore only essential video memory allocations on system suspend and resume. Quoting NVIDIA ([7], also available with the nvidia-utils package in /usr/share/doc/nvidia/html/powermanagement.html): The resulting loss of video memory contents is partially compensated for by the user-space NVIDIA drivers, and by some applications, but can lead to failures such as rendering corruption and application crashes upon exit from power management cycles.
The still experimental system enables saving all video memory (given enough space on disk or main RAM). The interface is through the /proc/driver/nvidia/suspend file as follows: write «suspend» (or «hibernate») to /proc/driver/nvidia/suspend immediately before writing to the usual Linux /sys/power/state file, write «resume» to /proc/driver/nvidia/suspend immediately after waking up, or after an unsuccessful attempt to suspend or hibernate.
The NVIDIA drivers rely on a user defined file system for storage. The chosen file system needs to support unnamed temporary files (ext4 works) and have sufficient capacity for storing the video memory allocations (e.g., at least (sum of the memory capacities of all NVIDIA GPUs) * 1.2 ). Use the command nvidia-smi -q -d MEMORY to list the memory capacities of all GPUs in the system.
To choose the file system used for storing video memory during system sleep (and change the default video memory save/restore strategy to save and restore all video memory allocations), it is necessary to pass two options to the «nvidia» kernel module. For example, write the following line to /etc/modprobe.d/nvidia-power-management.conf and reboot:
Feel free to replace «/tmp-nvidia» in the previous line with a path within your desired file system.
The interaction with /proc/driver/nvidia/suspend is handled by the simple Unix shell script at /usr/bin/nvidia-sleep.sh, which will itself be called by a tool like Systemd. The Archlinux nvidia-utils package ships with the following relevant Systemd services (which essentially just call nvidia-sleep.sh): nvidia-suspend , nvidia-hibernate , nvidia-resume . Contrary to NVIDIA’s instructions, it is currently not necessary to enable nvidia-resume (and it is in fact probably not a good idea to enable it), because the /usr/lib/systemd/system-sleep/nvidia script does the same thing as the service (but slightly earlier), and it is enabled by default (Systemd calls it after waking up from a suspend). Do enable nvidia-suspend and/or nvidia-hibernate .
Driver persistence
Nvidia has a daemon that can be optionally run at boot. In a standard single-GPU X desktop environment the persistence daemon is not needed and can actually create issues [8]. See the Driver Persistence section of the Nvidia documentation for more details.
Источник
Try and force Linux Nvidia cards to higher Performance Level , ie. pstate ie perflevel #456
Comments
twiggy commented Dec 21, 2017
Nvidia has been a bunch of a bad boys and has been nerfing the linux drivers ability to set clock rates and such.
As soon as ethminer kicks in some 1060 and 1070 cards will change from Performance Level 3 to Performance Level 2. This results in a bit of a drop in MHS.
Is there anyway the ethminer could trick these cards into needing a higher level.
The text was updated successfully, but these errors were encountered:
Profetul commented Dec 23, 2017
Unfortunately -ac would not work on 1070 cards — what I’ve done to mine is set the memory OC to a value that would match P2 to the value I would normally get in P3.
My Gigabyte GTX 1070 G1 reports 30 Mh/s having the memory OC to 8808 MHz instead of the standard 8008 MHz and runs at 61C with power limit set to 120W. (To get there I have to OC Memory +1200! -> P2 would show 8808)
Default settings on 1070 would get me 26 Mh/s — so with minor adjustments the hash-rate can be improved with about 15% and with less power usage.
I can confirm that -ac works for my 970 card, but I don’t notice any hash rate improvements — might be because of having the power limit set to 100W. I get
9.5 Mh/s so it’s a waste of power compared to 1070.
This guy has some nice scripts to make ethminer a daemon on Linux — https://gist.github.com/bmatthewshea
I’ve just added in his ethminer-monitor.sh some lines to set the power limits using nvidia-smi and to set OC using nvidia-settings — this way if my computer restarts it would always have the correct settings.
bm2k commented Jan 9, 2018
@Profetul Good information. I also have GeForce 1070 cards and Linux your answer is relevant for me. The one key piece of info you left out is how exactly do you overclock in Linux w/out using the «-ac» setting? What commands do you use? I know in Windows people use tools like MSI Afterburner and such, but for Linux I have not come across any OC’ing tools. My 1070’s also get
26MH/s out of the box.
Profetul commented Jan 10, 2018 •
@bm2k Ubuntu nVidia drivers come with an utility named nvidia-settings —
Running sudo nvidia-xconfig —cool-bits=28 should enable you to change the OC settings of the card
DeadManWalkingTO commented Feb 27, 2018
Try Update Drivers.
Download and install the latests.
Try use -U for CUDA devices.
That’s my launch command:
ethminer.exe -RH -U -S eu1.ethermine.org:4444 -FS us1.ethermine.org:4444 -O 0x7013275311fc37ccc1e40193D75086293eCb43A4.test
Try to change P2 State and Power managment mode.
You can use NVidiaProfileInspectorDmW.
For the best mining hashrate choose from sector «5 — Common»:
- CUDA — Force P2 State (Set to «Off»)
- Power managment mode (Set to «Prefer maximum performance»)
Try Optimize/Overclock GPUs.
You can use MSI Afterburner for GPU OverClock/Optimize.
My settings +150/+500/65%TDP
Hashrate 31-32@52oC
Please feedback.
Thank you!
eeerrrttty commented Mar 4, 2018
@DeadManWalkingTO please, give us the linux version of your answer
DeadManWalkingTO commented Mar 4, 2018
Linux
Try Update Drivers.
Download and install the latests.
Try Update Ethminer.
Download (or beter build) the latest.
Try use -U for CUDA devices.
CUDA Hardware Test Launch Command:
Try to change P2 State and Power managment mode.
You can use nvidia-smi.
- Always put GPU in full speed / P0
- Set GPU to «COMPUTE» with nvidia-smi —gom=COMPUTE
Try Tweak Linux.
Disable unnesesary daemons etc.
Try Optimize/Overclock GPUs.
- A listing of available clock speeds nvidia-smi -q -d SUPPORTED_CLOCKS
- Review the current GPU clock speed, default clock speed, and maximum possible clock speed nvidia-smi -q -d CLOCK
- Review the current state of each GPU and any reasons for clock slowdowns nvidia-smi -q -d PERFORMANCE
- NVidia-smi device modification section
- Try use a WatchDog
You can use ETHminerWatchDogDmW (#735).
Please feedback.
Thank you!
eeerrrttty commented Mar 4, 2018
What does WatchDog do? i don’t know what it is/how use it.
`nvidia-smi -q -d PERFORMANCE
Timestamp : Sun Mar 4 17:46:07 2018
Driver Version : 390.30
Attached GPUs : 1
GPU 00000000:01:00.0
Performance State : P2
Clocks Throttle Reasons
Idle : Not Active
Applications Clocks Setting : Not Active
SW Power Cap : Not Active
HW Slowdown : Not Active
HW Thermal Slowdown : Not Active
HW Power Brake Slowdown : Not Active
Sync Boost : Not Active
SW Thermal Slowdown : Not Active
Display Clock Setting : Not Active
nvidia-smi -q -d SUPPORTED_CLOCKS
Timestamp : Sun Mar 4 17:45:49 2018
Driver Version : 390.30
Attached GPUs : 1
GPU 00000000:01:00.0
Supported Clocks : N/A
$ nvidia-smi -q -d PERFORMANCE
nvidia-smi -q -d CLOCK
Timestamp : Sun Mar 4 17:45:06 2018
Driver Version : 390.30
Attached GPUs : 1
GPU 00000000:01:00.0
Clocks
Graphics : 1101 MHz
SM : 1101 MHz
Memory : 4303 MHz
Video : 987 MHz
Applications Clocks
Graphics : N/A
Memory : N/A
Default Applications Clocks
Graphics : N/A
Memory : N/A
Max Clocks
Graphics : 1911 MHz
SM : 1911 MHz
Memory : 4004 MHz
Video : 1708 MHz
Max Customer Boost Clocks
Graphics : N/A
SM Clock Samples
Duration : 2.00 sec
Number of Samples : 100
Max : 1290 MHz
Min : 1063 MHz
Avg : 1173 MHz
Memory Clock Samples
Duration : 2.00 sec
Number of Samples : 100
Max : 4303 MHz
Min : 4302 MHz
Avg : 4302 MHz
Clock Policy
Auto Boost : N/A
Auto Boost Default : N/A
`
My actual clock is in +1000 for mem and -200 for core.
more than 1000 system gets little buggy.
step 4. changes nothing.
I kept on shit 18.5Mh/s.
really, this GPU should work on 25Mh/s. This is a 30% loss.
Many people with Hynix memory are with this problem, this has to be a solution
Источник