Unable to install NVIDIA driver on latest AWS kernel

Hi,

I am trying to install NVIDIA driver version 367.57 on latest AWS kernel i.e 4.9.20-11.31.amzn1.x86_64.

Steps -

wget http://us.download.nvidia.com/XFree86/Linux-x86_64/367.57/NVIDIA-Linux-x86_64-367.57.run
 bash -x NVIDIA-Linux-x86_64-367.57.run -s --no-backup

Error while installing (in /var/log/nvidia-installer.log) -

/usr/src/kernels/4.9.20-11.31.amzn1.x86_64/include/linux/mm.h:1280:6: note: expected ‘struct vm_area_struct **’ but argument is of type ‘struct page **’
 long get_user_pages(unsigned long start, unsigned long nr_pages,
      ^
/tmp/selfgz14234/NVIDIA-Linux-x86_64-367.57/kernel/nvidia-drm/nvidia-drm-linux.c:141:38: error: too many arguments to function ‘get_user_pages’
                                      user_pages, NULL);
                                      ^

I was able to successfully install NVIDIA drivers on kernel version 4.4.51-40.58.amzn1.x86_64. Looks like the method get_user_pages in /usr/src/kernels/4.9.20-11.31.amzn1.x86_64/include/linux/mm.h has been changed in the kernel. I had to change 3 files to make it work -

  1. /home/ec2-user/NVIDIA-Linux-x86_64-367.57-1/kernel/nvidia-drm/nvidia-drm-linux.c
pages_pinned = NV_GET_USER_PAGES(address, pages_count, write, force,
                                     user_pages, NULL);
TO
pages_pinned = NV_GET_USER_PAGES(address, pages_count, write,
                                     user_pages, NULL);
  1. /home/ec2-user/NVIDIA-Linux-x86_64-367.57/kernel/nvidia-uvm/uvm8_tools.c
ret = NV_GET_USER_PAGES(user_va, num_pages, 1, 0, *pages, vmas);
TO
ret = NV_GET_USER_PAGES(user_va, num_pages, 1, *pages, vmas);
  1. /home/ec2-user/NVIDIA-Linux-x86_64-367.57/kernel/nvidia/os-mlock.c
ret = NV_GET_USER_PAGES((unsigned long)address,
                            page_count, write, user_pages, NULL);
TO
ret = NV_GET_USER_PAGES((unsigned long)address,
                            page_count, write, NULL);

I am reluctant to apply these patches since I don’t know the variables get_user_pages uses and the impact each variable has. Can someone explain how these functions are exercised and if the patches are correct. Also, is there an ETA for updated NVIDIA driver which compiles successfully on the latest AWS kernel without any hand patching? Please direct me to the correct forum if this is not the appropriate place for the question.

Thanks.

375.66 is the latest release and should not need any patching.