Problem installing NVIDIA 304.134 driver in Debian 10

Hi,
Recently i have switched to new debian gnu/linux release, called buster (version 10.0)
but i have problem with my legacy on-board nvidia graphics card with distribution open source nouveau driver, so i decided to download NVIDIA-Linux-x86_64-304.134.run file which supports my card, but when it goes to compile module process, it finishes with following error:

In file included from /tmp/selfgz2094/NVIDIA-Linux-x86_64-304.134/kernel/nv.c:13:
   /tmp/selfgz2094/NVIDIA-Linux-x86_64-304.134/kernel/nv-linux.h: In function ‘NV_GET_USER_PAGES_REMOTE’:
   /tmp/selfgz2094/NVIDIA-Linux-x86_64-304.134/kernel/nv-linux.h:1888:20: error: too few arguments to function ‘get_user_pages_remote’
                return get_user_pages_remote(tsk, mm, start, nr_pages, flags, pages, vmas);
                       ^~~~~~~~~~~~~~~~~~~~~
   In file included from /tmp/selfgz2094/NVIDIA-Linux-x86_64-304.134/kernel/nv-linux.h:82,
                    from /tmp/selfgz2094/NVIDIA-Linux-x86_64-304.134/kernel/nv.c:13:
   /usr/src/linux-headers-4.19.0-5-common/include/linux/mm.h:1485:6: note: declared here
    long get_user_pages_remote(struct task_struct *tsk, struct mm_struct *mm,
         ^~~~~~~~~~~~~~~~~~~~~
   /tmp/selfgz2094/NVIDIA-Linux-x86_64-304.134/kernel/nv.c: In function ‘nv_start_rc_timer’:
   /tmp/selfgz2094/NVIDIA-Linux-x86_64-304.134/kernel/nv.c:3033:5: error: implicit declaration of function ‘init_timer’; did you mean ‘init_timers’? [-Werror=implicit-function-declaration]
        init_timer(&nvl->rc_timer);
        ^~~~~~~~~~
        init_timers
   /tmp/selfgz2094/NVIDIA-Linux-x86_64-304.134/kernel/nv.c:3034:28: error: assignment to ‘void (*)(struct timer_list *)’ from incompatible pointer type ‘void (*)(long unsigned int)’ [-Werror=incompatible-pointer-types]
        nvl->rc_timer.function = nv_kern_rc_timer;
                               ^
   /tmp/selfgz2094/NVIDIA-Linux-x86_64-304.134/kernel/nv.c:3035:18: error: ‘struct timer_list’ has no member named ‘data’
        nvl->rc_timer.data = (unsigned long) nv;
                     ^
   cc1: some warnings being treated as errors
   make[4]: *** [/usr/src/linux-headers-4.19.0-5-common/scripts/Makefile.build:309: /tmp/selfgz2094/NVIDIA-Linux-x86_64-304.134/kernel/nv.o] Error 1
   make[3]: *** [/usr/src/linux-headers-4.19.0-5-common/Makefile:1539: _module_/tmp/selfgz2094/NVIDIA-Linux-x86_64-304.134/kernel] Error 2
   make[2]: *** [Makefile:146: sub-make] Error 2
   NVIDIA: left KBUILD.
   nvidia.ko failed to build!
   make[1]: *** [Makefile:256: module] Error 1
   make: *** [makefile:59: module] Error 2
-> Error.
ERROR: Unable to build the NVIDIA kernel module.

here is my linux kernel version:

4.19.0-5-amd64

here is output of lspci | grep -i vga command"

00:0d.0 VGA compatible controller: NVIDIA Corporation C61 [GeForce 7025 / nForce 630a] (rev a2)

i have google it and findout i have to patch nvidia installer to be succesfuly compiled with this kernel version, but i dont know where i can find this patch and how to do it.

i will so thankful if anybody can help me :)

thanks.

You should rather use the packages provided by Debian, those should already include the necessary patches. Instructions for Debian 9:
[url]NvidiaGraphicsDrivers - Debian Wiki
For Debian 10, just replace “stretch” with “buster”
[url]Debian -- Error

I have exactly the same problem.
Same environment: Debian Buster, kernel 4.19.0-14-amd64.
Graphic card: GeForce 6150 LE

Nouveau did not work with my graphic card and so I decided to give the NVIDIA driver 304 a try. I get exactly the same errors as the original poster.

No, @generix, the driver version 340 out of the Debian repository does not help: It tells that this graphic card is not supported any more by that driver.

The graphic card did work in a former version of Debian (with nouveau).
Windows 10 actually does not have any problems with it.
Therefore: Windows supports more old hardware than Linux does?
I am really disappointed.

Recommending the 340 driver was a mis-read (304<->340), my bad.
Driver 304 won’t work on any current distro, it’s out of support for more than three years now and only supports xorg 1.19
Nevertheless, nouveau should still work fine, at least I didn’t hear anything about any removal. Please open an issue here:
https://gitlab.freedesktop.org/drm/nouveau/-/issues
Proprietary, closed hardware having only a proprietary, closed driver running better on a proprietary, closed OS is not that big surprise.

Hi,

I do have a working set up:
Linux noel 4.19.249 #1 SMP PREEMPT Mon Jul 25 17:57:15 -03 2022 x86_64 GNU/Linux

$ nvidia-settings --version

nvidia-settings: version 304.134 (buildd@debian) Fri Jan 13 04:41:10 UTC 2017
The NVIDIA X Server Settings tool.

This program is used to configure the NVIDIA Linux graphics driver.
For more detail, please see the nvidia-settings(1) man page.

Copyright (C) 2004 - 2010 NVIDIA Corporation.

I have installed the nvidia-legacy-304xx-kernel-dkms and build the kernel from debian source (linux-source-4.19).