Vga_tryget missing from vgaarb.h?

Firstly, a genuine thankyou to everyone who’s made Rocky available -
I was depending on CentOS when it got sunk…

…back to the issue…

It looks to me like the vga_tryget function declaration is missing from the source files.

(limiting to < 2 links here as I’m a newbie…)
I’ve been looking at linux « include - kernel/git/stable/linux.git - Linux kernel stable tree
/vgaarb.h?h=v4.18
and
/vgaarb.h?h=v5.1.3
and on my Rocky installation…
/lib/modules/4.18.0-305.19.1.el8_4.x86_64/source/include/linux/vgaarb.h

the first 2 declare vga_tryget but my local copy - from a call to “dnf install kernel-headers-$(uname -r)” ,
doesn’t mention vga_tryget at all.

The reason I’m looking at this is that about 15 hrs ago :frowning: I noticed some screen flickering on a system I’d just set up.
dmesg showed issues with nouveau.
web searches suggested I should disable nouveau and install nvidia drivers.

I tried 2 approaches: dnf install and nvidia runfiles. No joy… so far.

The nvidia runfile driver-install build fails just after an error “implicit declaration of function ‘vga_tryget’”

I thought the Nvidia code might be missing an include ( posts suggest it happens ) but thought I’d just check the headers first and that’s how I ended up here.

can’t find any mention of vga_tryget in the include dir:
$ grep -rl vga_tryget .
$ pwd
/lib/modules/4.18.0-305.19.1.el8_4.x86_64/source/include

though it does appear here:
$ grep -r vga_tryget .
./System.map:ffffffff815e47b0 t __vga_tryget
$ pwd
/lib/modules/4.18.0-305.19.1.el8_4.x86_64/source

Any ideas on

  1. what’s going on / where the declaration went
  2. how to fix my driver problem

??

System:
Rocky Linux
Dell Precision T7810
Asus GeForce 210 2GB.

Nvidia installer log excerpt: ( tried uploading file as attachment but .log files not allowed )

nvidia-installer log file ‘/var/log/nvidia-installer.log’
creation time: Sat Oct 30 04:47:49 2021
installer version: 340.108

PATH: /usr/share/Modules/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/var/lib/snapd/snap/bin:/root/bin

nvidia-installer command line:
./nvidia-installer

Using: nvidia-installer ncurses v6 user interface
→ Tagging shared libraries with chcon -t textrel_shlib_t.
→ License accepted.
→ Installing NVIDIA driver version 340.108.
→ Performing CC sanity check with CC=“/usr/bin/cc”.
→ Kernel source path: ‘/lib/modules/4.18.0-305.19.1.el8_4.x86_64/source’
→ Kernel output path: ‘/lib/modules/4.18.0-305.19.1.el8_4.x86_64/build’
→ Performing rivafb check.


/tmp/selfgz23270/NVIDIA-Linux-x86_64-340.108/kernel/nv.c: In function ‘nvidia_probe’:
/tmp/selfgz23270/NVIDIA-Linux-x86_64-340.108/kernel/nv.c:2788:5: error: implicit declaration of function ‘vga_tryget’; did you mean ‘vga_get’? [-Werror=implicit-function-declaration]
vga_tryget(VGA_DEFAULT_DEVICE, VGA_RSRC_LEGACY_MASK);
^~~~~~~~~~
vga_get
cc1: some warnings being treated as errors
make[3]: *** [/usr/src/kernels/4.18.0-305.19.1.el8_4.x86_64/scripts/Makefile.build:316: /tmp/selfgz23270/NVIDIA-Linux-x86_64-340.108/kernel/nv.o] Error 1
make[2]: *** [/usr/src/kernels/4.18.0-305.19.1.el8_4.x86_64/Makefile:1563: module/tmp/selfgz23270/NVIDIA-Linux-x86_64-340.108/kernel] Error 2
make[2]: Leaving directory ‘/usr/src/kernels/4.18.0-305.19.1.el8_4.x86_64’
make[1]: *** [Makefile:157: sub-make] Error 2
make[1]: Leaving directory ‘/usr/src/kernels/4.18.0-305.19.1.el8_4.x86_64’
NVIDIA: left KBUILD.
nvidia.ko failed to build!
make: *** [Makefile:197: nvidia.ko] Error 1
→ Error.
ERROR: Unable to build the NVIDIA kernel module.
ERROR: Installation has failed. Please see the file ‘/var/log/nvidia-installer.log’ for details. You may find suggestions on fixing installation problems in the README available on the Linux driver download page at nvidia.com.

UPDATE:

I edited vgaarb.h to include the vga_tryget declations (extern and inline) from the 4.18 code and had another go.

This time it fails in nv_drm.c with implicit declaration warnings about drm_pci_init but I can’t find that anywhere in the 4.18 (bar a comment refering to it) or 5.13 kernel code* so that one looks like a question for Nividia…but then again that would mean it didn’t build for anyone with a kernel between 4.18 and 5.13… which doesn’t seem likely…unless drm_pic_init came and went in the interim…

So I’ll wait and see if anyone here can shed any light on it first.

In the meantime I’ve ordered a cheap radeon from ebay to make the system usable - at the mo’ the card issues with nouveau and the GeForce 210 are jamming the system up to the point of having to pull the plug at times.

(Can’t see how to /if can edit topic title : would be better as “cannot build/install Nvidia drivers” if anyone knows how/has permissions.)

*kernel code at git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git

Hello, welcome.

I didn’t see any references to elrepo, so I figured I’d mention this: ELRepo | kmod-nvidia-340xx - Have you happened to try their kmod for your nvidia card? If you haven’t, I would run dnf install elrepo-release and then it’ll be available to you. This version in particular I believe is the last supported version for your card.

1 Like

Hi nazunalika,
Thanks for the response.

Installed elrepo but no joy on kmod-nvidia-340xx.

I did a dnf list available | grep kmod-nvidia
and got ;
kmod-nvidia.x86_64 470.82.00-1.el8_4.elrepo elrepo
kmod-nvidia-390xx.x86_64 390.144-1.el8_4.elrepo elrepo
kmod-nvidia-418.152.00-4.18.0-193.19.1.x86_64 3:418.152.00-2.el8_2 cuda-rhel8-x86_64

The kmod-nvidia-340xx page hasn’t been updated since 2015 and it looks like the package isn’t in the repo anymore but I can’t find any more info/confirmation/why.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.