Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cannot install nvidia driver , In function 'block_cpu_fault_locked': error implicit declaration of function 'task_stack_page [closed]

I am trying to re-install Ubuntu and NVIDIA driver on my desktop computer after a computer crash. But the NVIDIA driver cannot successfully install after the crash. The first problem was the computer goes to low resolution mode after Ubuntu usb installation asks me to 'restart' the computer. The second problem I encountered was the screen goes to a black screen after I switch to text command mode by pressing ctrl-alt-F1. I learned to solve the black screen text command mode by editing /etc/default/grub and add 'nomodeset' to the GRUB_CMDLINE_LINUX_DEFAULT variable and reboot the computer.

I then download https://us.download.nvidia.com/XFree86/Linux-x86_64/384.130/NVIDIA-Linux-x86_64-384.130.run and install this NVIDIA driver. But the installation failed due to the following error:

/tmp/selfgz1982/NVIDIA-Linux-x86_64-384.130/krenel/nvidia-uvm/uvm8_va_block.c: In funcion 'block_cpu_fault_locked':
./arch/x86/inlcude/asm/process.h:820:39: error implicit declaration of function 'task_stack_page' [-Werror=implicit-function-declaration]
unsigned long __ptr = (unsigned long)task_stack_page(task);

Is the graphic card broken?
Does nvidia drive change mother bias or graphic card setting when it crashs?
Ubuntu installation can finish installation and show nice resolution.

Is there any suggestion I can do to fix it ?

like image 289
user2818066 Avatar asked Dec 13 '22 18:12

user2818066


1 Answers

As @Wang pointed out, here's the solution: https://github.com/NixOS/nixpkgs/issues/33284#issuecomment-354672627

Now, if you are using a script nvidia.run, it might be a bit tricky because the script extracts source code, runs, and erases the source code afterward. Here's how you can overcome it:

  1. sudo ./nvidia.run -x will extract the source code.
  2. Locate the extracted folder. Inside, there is a file [the-extracted-folder]/kernel/nvidia-uvm/uvm8_va_block.c. Add #include <linux/sched/task_stack.h> to the top.
  3. sudo [the-extracted-folder]/nvidia-installer to install the driver.

Then, you should be good to go.

like image 70
Tanin Avatar answered Dec 16 '22 07:12

Tanin