Problem Driver Ubuntu kernel 4.4.0-143

Hi, I would like to report a problem with Ubuntu 16.04 (kernel 4.4.0-143) and the nvidia driver. In particular package nvidia-415 driver 415.27. I try to use also different version (410.78, 396.54)

The problem appear after the update to kernel 4.4.0-143, and for example now I can not manage the double monitor. I report also this question https://askubuntu.com/questions/1126256/why-do-tuner-card-drivers-fail-to-build-after-kernel-update-to-4-4-0-143-generic/1126261#1126261 to show that also other people find problems.

I do not find the file nvidia-bug-report.sh so
in the next the apt command when I try to re-install the package:

sudo apt install nvidia-415
Lettura elenco dei pacchetti… Fatto
Generazione albero delle dipendenze
Lettura informazioni sullo stato… Fatto
Avanzamento: [ 6%] [####…]
libcuda1-415 nvidia-opencl-icd-415
I seguenti pacchetti NUOVI saranno installati:
libcuda1-415 nvidia-415 nvidia-opencl-icd-415
0 aggiornati, 3 installati, 0 da rimuovere e 0 non aggiornati.
È necessario scaricare 0 B/107 MB di archivi.
Dopo quest’operazione, verranno occupati 485 MB di spazio su disco.
Continuare? [S/n] s
Selezionato il pacchetto nvidia-415 non precedentemente selezionato.
(Lettura del database… 460428 file e directory attualmente installati.)
Preparativi per estrarre …/nvidia-415_415.27-0ubuntu0~gpu16.04.1_amd64.deb…
Estrazione di nvidia-415 (415.27-0ubuntu0~gpu16.04.1)…
Selezionato il pacchetto libcuda1-415 non precedentemente selezionato.
Preparativi per estrarre …/libcuda1-415_415.27-0ubuntu0~gpu16.04.1_amd64.deb…
Estrazione di libcuda1-415 (415.27-0ubuntu0~gpu16.04.1)…
Selezionato il pacchetto nvidia-opencl-icd-415 non precedentemente selezionato.
Preparativi per estrarre …/nvidia-opencl-icd-415_415.27-0ubuntu0~gpu16.04.1_amd64.deb…
Estrazione di nvidia-opencl-icd-415 (415.27-0ubuntu0~gpu16.04.1)…
Elaborazione dei trigger per libc-bin (2.23-0ubuntu11)…
Elaborazione dei trigger per ureadahead (0.100.0-19)…]
ureadahead will be reprofiled on next reboot
Elaborazione dei trigger per man-db (2.7.5-1)…
Configurazione di nvidia-415 (415.27-0ubuntu0~gpu16.04.1)…
update-alternatives: viene usato /usr/lib/nvidia-415/alt_ld.so.conf per fornire /etc/ld.so.conf.d/i386-linux-gnu_GL.conf (i386-linux-gnu_gl_conf) in modalità automatica
update-alternatives: viene usato /usr/lib/nvidia-415/alt_ld.so.conf per fornire /etc/ld.so.conf.d/i386-linux-gnu_EGL.conf (i386-linux-gnu_egl_conf) in modalità automatica
update-alternatives: viene usato /usr/share/nvidia-415/glamor.conf per fornire /usr/share/X11/xorg.conf.d/glamoregl.conf (glamor_conf) in modalità automatica
update-initramfs: deferring update (trigger activated)
INFO:Enable nvidia-415
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/lenovo_thinkpad
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/put_your_quirks_here
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/dell_latitude
Aggiunta dell’utente di sistema «nvidia-persistenced» (UID 121) …
Aggiunta del nuovo gruppo «nvidia-persistenced» (GID 129) …
Aggiunta del nuovo utente «nvidia-persistenced» (UID 121) con gruppo «nvidia-persistenced» …
La directory home «/» non è stata creata.
Loading new nvidia-415-415.27 DKMS files…
Building only for 4.4.0-143-generic
Building for architecture x86_64
Building initial module for 4.4.0-143-generic
ERROR: Cannot create report: [Errno 17] File exists: ‘/var/crash/nvidia-415.0.crash’
Error! Bad return status for module build on kernel: 4.4.0-143-generic (x86_64)

Consult /var/lib/dkms/nvidia-415/415.27/build/make.log for more information.
Configurazione di libcuda1-415 (415.27-0ubuntu0~gpu16.04.1)…
Configurazione di nvidia-opencl-icd-415 (415.27-0ubuntu0~gpu16.04.1)…
Elaborazione dei trigger per libc-bin (2.23-0ubuntu11)…
Elaborazione dei trigger per initramfs-tools (0.122ubuntu8.14)…
update-initramfs: Generating /boot/initrd.img-4.4.0-143-generic

It’s a known problem, unfortunately the drivers in the Ubuntu graphics ppa haven’t been upgraded lately. Two ways to resolve the issue, either

Thanks @generix, I install Michael Marley’s PPA, in my specific case driver 418.43,
and double monitor OK, first test with CUDA programs OK.

I hope for the future Nvidia will update Ubuntu drivers in a shorter time.

Thanks Again.

The quick and dirty way to make the nvidia-415-415.27 work with 4.4.0-143 is to patch the /usr/src/nvidia-415-415.27/common/inc/nv.h with the following patch:

— nv-mm.h.orig 2019-01-15 11:27:00.000000000 -0500
+++ nv-mm.h 2019-03-23 16:42:39.189123609 -0400
@@ -41,7 +41,10 @@

#if defined(NV_GET_USER_PAGES_HAS_TASK_STRUCT)
#define NV_GET_USER_PAGES(start, nr_pages, write, force, pages, vmas) \

  •    get_user_pages(current, current->mm, start, nr_pages, write, force, pages, vmas)
    
  •    get_user_pages(current, current->mm, start, nr_pages,           \
    
  •                       ((write != 0)? FOLL_WRITE: 0) |              \
    
  •                       ((force != 0)? FOLL_FORCE: 0),               \
    
  •                       pages, vmas)
    

#else
#if defined(NV_GET_USER_PAGES_HAS_WRITE_AND_FORCE_ARGS)
#define NV_GET_USER_PAGES get_user_pages
@@ -123,7 +126,26 @@
}
#endif
#else

  • #define NV_GET_USER_PAGES_REMOTE get_user_pages
  •    static inline long NV_GET_USER_PAGES_REMOTE(struct task_struct *tsk,
    
  •                                                struct mm_struct *mm,
    
  •                                                unsigned long start,
    
  •                                                unsigned long nr_pages,
    
  •                                                int write,
    
  •                                                int force,
    
  •                                                struct page **pages,
    
  •                                                struct vm_area_struct **vmas)
    
  •    {
    
  •        unsigned int flags = 0;
    
  •        if (write)
    
  •            flags |= FOLL_WRITE;
    
  •        if (force)
    
  •            flags |= FOLL_FORCE;
    
  •           return get_user_pages(tsk, mm, start, nr_pages, flags,
    
  •                                 pages, vmas);
    
  •    }
    

#endif

Then rebuild the driver.