Install preempt kernel with nvidia-driver

Kernels & Hardware, configuring network, installing services

Re: Install preempt kernel with nvidia-driver

Postby Head_on_a_Stick » 2020-08-11 14:59

Scorpion wrote:So for gaming you need low latency, right?

I think you are confusing kernel latency with network latency (ie, ping), the latter is a function of your network connection and the quality of the game server rather than the kernel per se.

For example I have a good internet connection (70Mbs, very reliable) and I have seen a 7ms ping when connecting to local Counter Strike (Source) servers while using the stock Debian kernel. I am a LPB (low-ping bastard) :mrgreen:
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 12480
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Install preempt kernel with nvidia-driver

Postby Head_on_a_Stick » 2020-08-11 15:00

Scorpion wrote:So for gaming you need low latency, right?

I think you are confusing kernel latency with network latency (ie, ping), the latter is a function of your network connection and the quality of the game server rather than the kernel.

For example I have a good internet connection (70Mb/s, very reliable) and I have seen a 7ms ping when connecting to local Counter Strike (Source) servers while using the stock Debian kernel. I am an LPB (low-ping bastard) :mrgreen:
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 12480
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Install preempt kernel with nvidia-driver

Postby Scorpion » 2020-08-11 17:23

No but I am not sure what are the features of a low latency kernel.

https://askubuntu.com/questions/126664/ ... ime-kernel
If you're on a low-end machine that has only one or two cores, then try the -lowlatency. You could also try the -realtime, but you'll find that it tends to block processes until the "real-time" ones have finished their job. I believe the realtime kernel isn't the "vanilla" one, but has the CONFIG_PREEMPT_RT patch applied. I think that realtime kernels are only for those who have to build a single application on embedded systems, so usual desktop users shouldn't have real benefits because they usually run a fair number of applications at the same time.


Is the debian stock kernel low latency?

What are the important values for gaming kernel?
User avatar
Scorpion
 
Posts: 231
Joined: 2018-10-17 11:38

Re: Install preempt kernel with nvidia-driver

Postby LE_746F6D617A7A69 » 2020-08-11 20:38

Scorpion wrote:Is the debian stock kernel low latency?
Fortunately - No, at least not in the Ubuntu naming convention...
Scorpion wrote:What are the important values for gaming kernel?
There's no such thing as 'gaming kernel'.

EDIT: You may also consider to add the mitigations=off to the kernel boot parameters - but of course this means trading security for performance.
Bill Gates: "(...) In my case, I went to the garbage cans at the Computer Science Center and I fished out listings of their operating system."
The_full_story and Nothing_have_changed
LE_746F6D617A7A69
 
Posts: 340
Joined: 2020-05-03 14:16

Re: Install preempt kernel with nvidia-driver

Postby Deb-fan » 2020-08-12 02:01

Of course there are config options best suited for gaming, potential patching, much of which, that being whats set default in the kernel or in the underlying operating system (ie: /etc/default/grub or the sysctl.conf file, other methods or system conf files) are highly dependent on the targeted hardware and other considerations. Even a best optimized for x-use in general kernel is still just one piece of a big whole. Still a massive amount involved beyond that (again how the os is setup, the hardware involved etc), its a specialized area of nix and fortunately there are distros focused on this niche. Purportedly including kernel tweaking, patching and tuning specifically for use in gaming on the gnu/nix platform. Steamos or several others.

I have no experience with them, as I've no interest in gaming. There are no 1,2,3 ... you're all set kernel configs for this usecase and mostly no point in even trying to get into it further. At this point from what you've said in posts, you/OP have zero idea whats involved in tweaking a Nix kernel, how, what or why. Not trying to be an ahole but learning about the workings of the Linux kernel takes a buttload of time and effort. Anyone who wishes to pursue that has no shortage of info covering it available. Gaming on gnu/nix is a specialized use case, would use an install/distro dedicated to it, by people who know what's what on the matter.

Aka: google "best linux distros for gaming". Good place to start. :)
Most powerful FREE tech-support tool on the planet * HERE. *
Deb-fan
 
Posts: 875
Joined: 2012-08-14 12:27

Re: Install preempt kernel with nvidia-driver

Postby Scorpion » 2020-08-12 14:31

With CPU tuning and the liquorix or the stock debian kernel I should be fine. No need to change OS.
As LE_746F6D617A7A69 said.
Maybe I will recompile it with some value.
Why does mitigations=off improve the kernel for gaming?

Is it impossible to install the RT debian stock kernel with nvidia-driver so?
I would like to try it.
User avatar
Scorpion
 
Posts: 231
Joined: 2018-10-17 11:38

Re: Install preempt kernel with nvidia-driver

Postby cuckooflew » 2020-08-12 15:01

No need to change OS.

I don't think so either, Debian is ok for gaming, it just takes some effort to get it all configured correctly. Your hardware is a bigger factor, your doing ok, it is refreshing to see someone taking the time and effort to learn about this kind of things. And all though I don't see what good searching for other distros would do, and don't use "google", using startpage.com,
I find some interesting things here: https://forums.developer.nvidia.com/t/simply-impossible-to-use-an-nvidia-card-on-a-real-time-kernel-no-musician-can-use-nvidia/34947 and also the other results, using key words:
Is it impossible to install the RT debian stock kernel with nvidia-driver so?
I would like to try it.

Code: Select all
Is it impossible to install the RT debian stock kernel with nvidia-driver so?
Please Read What we expect you have already Done
Search Engines know a lot, and
"If God had wanted computers to work all the time, He wouldn't have invented RESET buttons"
and
Just say NO to help vampires!
cuckooflew
 
Posts: 683
Joined: 2018-05-10 19:34
Location: Some where out west

Re: Install preempt kernel with nvidia-driver

Postby sunrat » 2020-08-12 21:28

Scorpion wrote:Is it impossible to install the RT debian stock kernel with nvidia-driver so?
I would like to try it.


viewtopic.php?f=5&t=147029#p725522
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!
User avatar
sunrat
 
Posts: 3180
Joined: 2006-08-29 09:12
Location: Melbourne, Australia

Re: Install preempt kernel with nvidia-driver

Postby Scorpion » 2020-08-13 15:12

sunrat wrote:I tried Xanmod recently too but it's built with CONFIG_HZ=250 and I failed dismally trying to recompile it with 1000Hz, being a kernel compile neophyte. :oops:
Liquorix is about as good as it gets for media production without being full RT. It has 1000Hz, full preempt and tickless. For gaming, NFI.

https://xanmod.org/:
The real-time version is recommended for critical runtime applications such as Linux gaming eSports, streaming, live productions and ultra-low latency enthusiasts.

Supports all recent 64-bit versions of Debian and Ubuntu-based systems.

Note: The current proprietary NVIDIA, VirtualBox, VMware Workstation / Player or some other dkms modules builds are not fully compatible with Linux 5.8 (EDGE) and RT.

RT is recommended for Linux gaming eSports.
But it won' t work with nvidia maybe, I will check.

Not sure about CONFIG_HZ=1000:
https://passthroughpo.st/config_hz-how- ... ffect-kvm/
If you’re compiling your kernel from source, it is advisable to pick 1000Hz over 100Hz or 250Hz in order to receive a small but tangible minimum framerate improvement while gaming. On the other hand, if you have a very I/O heavy workload, CONFIG_HZ=250 (or even 300) might be a better pick. However, if your distribution comes with a precompiled kernel out of the box, the benefits likely do not justify maintaining a custom kernel configuration and recompiling with each upgrade.

What is the debian default? Xanmod RT is 500.
User avatar
Scorpion
 
Posts: 231
Joined: 2018-10-17 11:38

Re: Install preempt kernel with nvidia-driver

Postby LE_746F6D617A7A69 » 2020-08-13 16:35

Have You seen the tests of Liquorix vs standard kernel on Phoronix? - it clearly shows that low-latency kernels are the worst choice for gaming.
https://www.phoronix.com/scan.php?page=article&item=radeon-gaming-liquorix54&num=1

Regarding the xanmod.org: they have a nice dragon logo, but besides that they are a bunch of morons who are selling shit to greenhorns and fanboys.
Read it carefully:
No game coder in the world will ever write a game which runs as a Real-Time process - and so no game will benefit from using RT kernel.
2 reasons:
a) RT process can't use 100% of the CPU time, unlike ordinary, non-RT process (replace "process" with the word "application" or "game", if You don't understand what a process is)
b) only root can create RT processes.

No game and no desktop application will run faster just because You have an RT kernel - and the jerks from xanmod.org are obviously lying

Scorpion wrote:What is the debian default? Xanmod RT is 500.

For Debian it's 250Hz (4ms period) - but the CPU scheduler can be tuned without re-compilng of the kernel -> I've posted a link showing how to do this - but apparently You didn't even tried to use that information - instead You're polluting this forum by quoting some halve-brained nitwits from xanmod.
Bill Gates: "(...) In my case, I went to the garbage cans at the Computer Science Center and I fished out listings of their operating system."
The_full_story and Nothing_have_changed
LE_746F6D617A7A69
 
Posts: 340
Joined: 2020-05-03 14:16

Re: Install preempt kernel with nvidia-driver

Postby sunrat » 2020-08-13 22:42

Is it Groundhog Day?
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!
User avatar
sunrat
 
Posts: 3180
Joined: 2006-08-29 09:12
Location: Melbourne, Australia

Re: Install preempt kernel with nvidia-driver

Postby cuckooflew » 2020-08-14 02:57

It could be,
Code: Select all
parrot$ cal
    August 2020
Su Mo Tu We Th Fr Sa
                   1
 2  3  4  5  6  7  8
 9 10 11 12 13<GrndHogDay) 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31               
parrot$ 
Please Read What we expect you have already Done
Search Engines know a lot, and
"If God had wanted computers to work all the time, He wouldn't have invented RESET buttons"
and
Just say NO to help vampires!
cuckooflew
 
Posts: 683
Joined: 2018-05-10 19:34
Location: Some where out west

Re: Install preempt kernel with nvidia-driver

Postby Scorpion » 2020-08-14 14:16

Yes I saw that test, but I want to try a RT kernel.

I saw also that link but it want to use CONFIG_HZ instead.
It talks about RHEL7 servers and RedHat.
There are no kernel.sched_min_granularity_ns and sched_wakeup_granularity_ns values with:
Code: Select all
sysctl -a


From the previous cuckooflew link https://forums.developer.nvidia.com/t/s ... ia/34947/8 I can see another:
http://www.clemensrabe.com/linux/nvidia ... empt-patch
NVidia Driver 295.20 and the RT-Preempt Patch
The RT-Preempt patches enable full support of real-time preemption for the Linux kernels. Since there is much information on the web about the purpose of the RT-Preempt patches, e.g., the OSADL (Open Source Automation Development Lab) project page, including instructions how to build and install your own real-time kernel, I will focus on the problem when using such a kernel with the latest NVidia drivers.

Following the instructions, you'll end up with a patched kernel 2.6.33.7.2-rt30. But when you'll try to build the kernel module of the latest NVidia driver 295.20, it won't compile. The reason for this incompatibility is that the type atomic_spinlock_t is no longer available and has to be replaced by a raw_spinlock_t. In addition, all the functions were renamed too and have to be changed accordingly. After these simple changes, the module will compile, but when it is loaded and the X-Server uses it, you will get a lot of scheduling error messages in the kernel logs. After some research and experiments, I'll replaced the semaphores used in the kernel driver with mutexes, silencing the kernel log finally. All necessary changes are put in the nvidia-rt-compat.patch, that should be applied to the kernel driver:
cd nvidia-kernel-module-295.20
patch -p1 < nvidia-rt-compat.patch

When analyzing the scheduling performance there was one big curiosity caused by the NVidia driver: Whenever a OpenGL or CUDA application was started or quit, there was a high latency up to several milliseconds. Looking again through the kernel module source, I found the reason for this problem: The kernel module calls the wbinvd instruction, that invalidates the caches of all CPUs, forcing them to flush the caches and read everything again. As caches get larger and larger and the number of CPU cores increases too, this makes a huge impact on the performance since all CPUs actually stall during this operation. To remove this instruction, apply the attached nvidia-rt-no-wbinvd.patch:
cd nvidia-kernel-module-295.20
patch -p1 < nvidia-rt-no-wbinvd.patch

I have tested these patches on an Ubuntu 10.04 LTS 32- and 64-Bit platform on different hardware (mostly Core2 Duo and Core i7) and haven't found any other problems regarding the real-time performance.


Can someone make a patch for the nvidia-driver 418.152.00?
User avatar
Scorpion
 
Posts: 231
Joined: 2018-10-17 11:38

Re: Install preempt kernel with nvidia-driver

Postby LE_746F6D617A7A69 » 2020-08-14 20:36

Indeed a Groundhog Day...

Learn what are the Real-Time processes and what are they used for...

The RT kernel is a little bit bigger and slower than a normal kernel, because Ingo Molnar have injected additional mutexes/spinlocks into the kernel code to reduce RT-mode jitter ...
Bill Gates: "(...) In my case, I went to the garbage cans at the Computer Science Center and I fished out listings of their operating system."
The_full_story and Nothing_have_changed
LE_746F6D617A7A69
 
Posts: 340
Joined: 2020-05-03 14:16

Re: Install preempt kernel with nvidia-driver

Postby stevepusser » 2020-08-15 17:40

Can someone make a patch for the nvidia-driver 418.152.00?


Maybe, certainly not me.
Will someone else? Don't hold your breath.

The new time-loop movie is Palm Springs, certainly an enjoyable watch. Smart, funny, and the protagonists don't have to satisfy some unknown entity or karmic condition in order to escape the loop.
MX Linux packager and developer
User avatar
stevepusser
 
Posts: 11975
Joined: 2009-10-06 05:53

PreviousNext

Return to System configuration

Who is online

Users browsing this forum: No registered users and 16 guests

fashionable