Problem installing NVIDIA 304.134 driver in Debian 10

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 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]
   /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-> = (unsigned long) nv;
   cc1: some warnings being treated as errors
   make[4]: *** [/usr/src/linux-headers-4.19.0-5-common/scripts/ /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.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:


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 :)


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