Install preempt kernel with nvidia-driver

Kernels & Hardware, configuring network, installing services

Install preempt kernel with nvidia-driver

Postby Scorpion » 2020-08-07 18:36

I want to install a low latency kernel for gaming so i tried this:
Code: Select all
linux-image-4.19.0-9-rt-amd64

But nvidia-driver failed to build the modules this is part of the make.log:
DKMS make.log for nvidia-current-418.152.00 for kernel 4.19.0-10-rt-amd64 (x86_64)
[...]
The kernel you are installing for is a PREEMPT_RT kernel!

The NVIDIA driver does not support real-time kernels. If you
are using a stock distribution kernel, please install
a variant of this kernel that does not have the PREEMPT_RT
patch set applied; if this is a custom kernel, please
install a standard Linux kernel. Then try installing the
NVIDIA kernel module again.
[...]


Before I successfully installed a liquorix kernel but I would like to use a stock distribution kernel.
User avatar
Scorpion
 
Posts: 231
Joined: 2018-10-17 11:38

Re: Install preempt kernel with nvidia-driver

Postby Head_on_a_Stick » 2020-08-07 19:35

The real-time kernel is not suited to gaming at all.
Black Lives Matter

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

Re: Install preempt kernel with nvidia-driver

Postby sunrat » 2020-08-07 23:10

You'll never get nvidia driver working on an RT kernel. If you really need low latency, the Liquorix kernel works well and nvidia can be built on it, although not necessarily the very latest one. I installed a 5.6.x Liquorix a while back although 5.7 was available but wouldn't work with nvidia at the time. Nvidia driver packages are usually a step behind kernels.

Also, where do you need low latency? If it's network ping time, that's not even what low latency kernels do. Low latency in a kernel means that process threads are completed in as short a time as possible, ie. prioritising execution time over throughput.
You'd have more luck diagnosing why the network is slow while using a default kernel.
“ 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: 3186
Joined: 2006-08-29 09:12
Location: Melbourne, Australia

Re: Install preempt kernel with nvidia-driver

Postby stevepusser » 2020-08-08 03:35

I'm pretty sure that the recent security updates of the Nvidia drivers that Debian was forced to add to Buster also added support for the 5.7 kernel, based on what I did shortly before to backport those to MX for 5.7 support.

Liquorix is your only choice--it's true that the Nvidia drivers will not build on the realtime kernel. There are some other third party kernels out there (xanmod?), but I have no experience with them, so won't say anything.
MX Linux packager and developer
User avatar
stevepusser
 
Posts: 11983
Joined: 2009-10-06 05:53

Re: Install preempt kernel with nvidia-driver

Postby sunrat » 2020-08-08 06:10

stevepusser wrote:I'm pretty sure that the recent security updates of the Nvidia drivers that Debian was forced to add to Buster also added support for the 5.7 kernel, based on what I did shortly before to backport those to MX for 5.7 support.

I just mentioned 5.7 as an example of how Nvidia needs time to support latest kernels. It was several months ago so 5.7 should be fine now, but 5.8 may still not be supported atm.

Liquorix is your only choice--it's true that the Nvidia drivers will not build on the realtime kernel. There are some other third party kernels out there (xanmod?), but I have no experience with them, so won't say anything.


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.
“ 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: 3186
Joined: 2006-08-29 09:12
Location: Melbourne, Australia

Re: Install preempt kernel with nvidia-driver

Postby Scorpion » 2020-08-08 06:33

https://liquorix.net/
Liquorix is a distro kernel replacement built using the best configuration and kernel sources for desktop, multimedia, and gaming workloads.


I do not need the latest version with the 4.19.0-10-amd64 kernel I am fine.
Is there a patch to recompile a kernel with liquorix features?

Can I download the 5.6 liquorix kernel somewhere? So I don' t add the repo.
User avatar
Scorpion
 
Posts: 231
Joined: 2018-10-17 11:38

Re: Install preempt kernel with nvidia-driver

Postby Head_on_a_Stick » 2020-08-08 07:59

Scorpion wrote:Can I download the 5.6 liquorix kernel somewhere? So I don' t add the repo.

Yes you can but that is unwise because you would be running an outdated kernel with known vulnerabilities within a matter of days.

Liquorix have a Debian buster repository that shouldn't cause you any problems.

EDIT: here's the Liquorix kernel configuration if you want to apply it to Debian's 4.19 kernel:

https://gist.github.com/Head-on-a-Stick ... c4daaac2fc

Some of the options won't be available for 4.19 though and if you make a custom version then you'll have to keep track of the Debian updates and recompile it whenever a new version is released.
Black Lives Matter

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

Re: Install preempt kernel with nvidia-driver

Postby Scorpion » 2020-08-08 14:35

With that config I can use:
Code: Select all
make olddefconfig


But there is no more kernel-package for buster https://tracker.debian.org/pkg/kernel-package.
Has it been renamed maybe?
Can I use some old version?
User avatar
Scorpion
 
Posts: 231
Joined: 2018-10-17 11:38

Re: Install preempt kernel with nvidia-driver

Postby Scorpion » 2020-08-08 17:34

With make deb-pkg I get an error:
Code: Select all
# make deb-pkg
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  YACC    scripts/kconfig/zconf.tab.c
  LEX     scripts/kconfig/zconf.lex.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf  --syncconfig Kconfig
make clean
/bin/bash ./scripts/package/mkdebian
  TAR     linux-4.19.132.tar.gz
origversion=$(dpkg-parsechangelog -SVersion |sed 's/-[^-]*$//');\
   mv linux-4.19.132.tar.gz ../linux-4.19.132_${origversion}.orig.tar.gz
dpkg-buildpackage -r"fakeroot -u" -a$(cat debian/arch) -i.git -us -uc
dpkg-buildpackage: warning: using a gain-root-command while being root
dpkg-buildpackage: info: source package linux-4.19.132
dpkg-buildpackage: info: source version 4.19.132-1
dpkg-buildpackage: info: source distribution buster
dpkg-buildpackage: info: source changed by root <root@debian-desktop>
dpkg-buildpackage: info: host architecture amd64
 dpkg-source -i.git --before-build .
 fakeroot -u debian/rules clean
rm -rf debian/*tmp debian/files
make clean
 dpkg-source -i.git -b .
dpkg-source: warning: no source format specified in debian/source/format, see dpkg-source(1)
dpkg-source: info: using source format '1.0'
dpkg-source: warning: source directory 'linux-source-4.19' is not <sourcepackage>-<upstreamversion> 'linux-4.19.132-4.19.132'
dpkg-source: warning: .orig directory name linux-source-4.19.orig is not <package>-<upstreamversion> (wanted linux-4.19.132-4.19.132.orig)
dpkg-source: info: building linux-4.19.132 using existing linux-4.19.132_4.19.132.orig.tar.gz
dpkg-source: info: building linux-4.19.132 in linux-4.19.132_4.19.132-1.diff.gz
dpkg-source: warning: ignoring deletion of file .scmversion
dpkg-source: warning: the diff modifies the following upstream files:
 .clang-format
 .cocciconfig
 .config    5.7 liquorix
 .config.old
 .get_maintainer.ignore
 .mailmap
 CREDITS
 LICENSES/exceptions/Linux-syscall-note
 LICENSES/other/Apache-2.0
 LICENSES/other/CDDL-1.0
 LICENSES/other/GPL-1.0
 LICENSES/other/Linux-OpenIB
 LICENSES/other/MPL-1.1
 LICENSES/other/X11
 LICENSES/preferred/BSD-2-Clause
 LICENSES/preferred/BSD-3-Clause
 LICENSES/preferred/BSD-3-Clause-Clear
 LICENSES/preferred/GPL-2.0
 LICENSES/preferred/LGPL-2.0
 LICENSES/preferred/LGPL-2.1
 LICENSES/preferred/MIT
 MAINTAINERS
 README
dpkg-source: info: use the '3.0 (quilt)' format to have separate and documented changes to upstream files, see dpkg-source(1)
dpkg-source: info: building linux-4.19.132 in linux-4.19.132_4.19.132-1.dsc
dpkg-source: warning: missing information for output field Standards-Version
 debian/rules build
make KERNELRELEASE=4.19.132 ARCH=x86    KBUILD_BUILD_VERSION=1 KBUILD_SRC=
  HOSTCC  scripts/basic/fixdep
  HOSTCC  arch/x86/tools/relocs_32.o
  HOSTCC  arch/x86/tools/relocs_64.o
  HOSTCC  arch/x86/tools/relocs_common.o
  HOSTLD  arch/x86/tools/relocs
  CC      kernel/bounds.s
  CC      arch/x86/kernel/asm-offsets.s
  CALL    scripts/checksyscalls.sh
error: Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel
make[3]: *** [Makefile:1124: prepare-objtool] Error 1
make[2]: *** [debian/rules:4: build] Error 2
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2
make[1]: *** [scripts/package/Makefile:75: deb-pkg] Error 2
make: *** [Makefile:1388: deb-pkg] Error 2



https://debian-handbook.info/browse/sta ... ation.html
CULTURE The good old days of kernel-package
Before the Linux build system gained the ability to build proper Debian packages, the recommended way to build such packages was to use make-kpkg from the kernel-package package.

Yes I missed "The good old days of kernel-package" :lol:
Last edited by Scorpion on 2020-08-09 08:28, edited 1 time in total.
User avatar
Scorpion
 
Posts: 231
Joined: 2018-10-17 11:38

Re: Install preempt kernel with nvidia-driver

Postby Head_on_a_Stick » 2020-08-09 09:24

Scorpion wrote:
Code: Select all
error: Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel

Do what the error message suggests then. Build as your normal user rather than root and use 'dpkg-source --commit' to record any source changes as patches.

As I said some options might not be supported at all by the 4.19 kernels so you may have to tweak the configuration.

But this is all a fool's errand (IMO), just use the Liquorix repositories. And actually benchmark the framerates in your games to confirm that it makes a difference.
Black Lives Matter

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

Re: Install preempt kernel with nvidia-driver

Postby Scorpion » 2020-08-09 17:30

Code: Select all
apt install libelf-dev libelf-devel elfutils-libelf-devel
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package libelf-devel
E: Unable to locate package elfutils-libelf-devel

So I installed libelf-dev.

With the .config of the 5.7 liquorix is the result a real time kernel?
Does it need a patch for that?
User avatar
Scorpion
 
Posts: 231
Joined: 2018-10-17 11:38

Re: Install preempt kernel with nvidia-driver

Postby Head_on_a_Stick » 2020-08-09 17:50

Scorpion wrote:With the .config of the 5.7 liquorix is the result a real time kernel?

No.

Scorpion wrote:Does it need a patch for that?

Yes but as I have already mentioned you *do not* want a real-time kernel for gaming, it will degrade the performance.
Black Lives Matter

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

Re: Install preempt kernel with nvidia-driver

Postby LE_746F6D617A7A69 » 2020-08-10 14:03

Head_on_a_Stick wrote:... you *do not* want a real-time kernel for gaming, it will degrade the performance.

... and the Liquorix kernel won't improve the performance either:
https://www.phoronix.com/scan.php?page=article&item=radeon-gaming-liquorix54&num=1

The default kernel settings are well suited and foremost *tested* for most tasks. For other tasks, it's possible to tune the system without the need to recompile the kernel:

1. Limit the effects of CPU context switching: f.e. schedtool allows to set the priority and to bind the processes to a fixed set of cores - i.e. if You have 4 cores, limit the game to use only 3 of them (CPU affinity) - all other programs will likely get executed on the 4th core, what means less context switching for the game process.

2. Disable frequency scaling for the cores that the game is using - set a fixed frequency in the startup script, using linux-cpupower or cpufrequtils. Frequency scaling causes a lot of context switching, because the power governor needs to measure CPU load periodicaly.

3. Fine-tunning of CPU time slices: https://unix.stackexchange.com/questions/466722/how-to-change-the-length-of-time-slices-used-by-the-linux-cpu-scheduler

IMO there's completely no need to use Liquorix kernel on Debian - all the necessary options are already there.
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: 342
Joined: 2020-05-03 14:16

Re: Install preempt kernel with nvidia-driver

Postby Scorpion » 2020-08-10 17:21

My cpu is not good:
Code: Select all
inxi --cpu
CPU:
  Topology: Dual Core model: Intel Pentium G3450 bits: 64 type: MCP
  L2 cache: 3072 KiB
  Speed: 3399 MHz min/max: 800/3400 MHz Core speeds (MHz): 1: 3399 2: 3399

Not sure if I can tweak something, only 2 cores.

So for gaming you need low latency, right?
Is the debian stock kernel low latency?

I downloaded and installed the 5.6 liquorix from https://liquorix.net/debian/pool/main/l/linux-liquorix/ so I did not add the repo.

How can I benchmark framerates?
User avatar
Scorpion
 
Posts: 231
Joined: 2018-10-17 11:38

Re: Install preempt kernel with nvidia-driver

Postby LE_746F6D617A7A69 » 2020-08-10 17:48

Scorpion wrote:How can I benchmark framerates?
1st result on google:
https://linuxhint.com/show_fps_counter_linux_games/

Scorpion wrote:So for gaming you need low latency, right?
Exactly the opposite: low latency is achieved by frequent context switching, what gives slightly better response to some events on average, but it kills the performance in case if You want a single process to utilize nearly 100% of the HW resources.

Scorpion wrote:My cpu is not good:
No software trick will magically increase the HW performance.
Still You can disable frequency scaling and increase time slice length - but don't expect anything more than few percent gain for this CPU.
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: 342
Joined: 2020-05-03 14:16

Next

Return to System configuration

Who is online

Users browsing this forum: No registered users and 14 guests

fashionable