Score:0

Trying to install CUDA driver, "fatal error: asm/kmap_types.h: No such file or directory"

za flag

I had the CUDA driver installed on my machine (Ubuntu 20.04). It was working ... until it stopped working (not sure what happened). So I'm trying to reinstall it by running:

sudo sh cuda_11.1.0_455.23.05_linux.run

where I downloaded cuda_11.1.0_455.23.05_linux.run from NVIDIA's website. However, I get an error saying to look at /var/log/nvidia-installer.log to learn more about why the installation failed. The file contains a really large error message, I've pasted part of it below. I'm not quite sure what to do

In file included from /tmp/selfgz3864/NVIDIA-Linux-x86_64-455.23.05/kernel/nvidia/nv-frontend.c:13:
   /tmp/selfgz3864/NVIDIA-Linux-x86_64-455.23.05/kernel/common/inc/nv-linux.h:119:10: fatal error: asm/kmap_types.h: No such file or directory
     119 | #include <asm/kmap_types.h>         /* page table entry lookup          */
         |          ^~~~~~~~~~~~~~~~~~
   compilation terminated.
   In file included from /tmp/selfgz3864/NVIDIA-Linux-x86_64-455.23.05/kernel/nvidia/nv.c:14:
   /tmp/selfgz3864/NVIDIA-Linux-x86_64-455.23.05/kernel/common/inc/nv-linux.h:119:10: fatal error: asm/kmap_types.h: No such file or directory
     119 | #include <asm/kmap_types.h>         /* page table entry lookup          */
         |          ^~~~~~~~~~~~~~~~~~
   compilation terminated.
   make[2]: *** [scripts/Makefile.build:287: /tmp/selfgz3864/NVIDIA-Linux-x86_64-455.23.05/kernel/nvidia/nv-frontend.o] Error 1
   In file included from /tmp/selfgz3864/NVIDIA-Linux-x86_64-455.23.05/kernel/nvidia/nv-dma.c:15:
   /tmp/selfgz3864/NVIDIA-Linux-x86_64-455.23.05/kernel/common/inc/nv-linux.h:119:10: fatal error: asm/kmap_types.h: No such file or directory
     119 | #include <asm/kmap_types.h>         /* page table entry lookup          */
         |          ^~~~~~~~~~~~~~~~~~
     CC [M]  /tmp/selfgz3864/NVIDIA-Linux-x86_64-455.23.05/kernel/nvidia/nv-vm.o
   compilation terminated.
   make[2]: *** [scripts/Makefile.build:287: /tmp/selfgz3864/NVIDIA-Linux-x86_64-455.23.05/kernel/nvidia/nv.o] Error 1
     CC [M]  /tmp/selfgz3864/NVIDIA-Linux-x86_64-455.23.05/kernel/nvidia/nv-vtophys.o
   In file included from /tmp/selfgz3864/NVIDIA-Linux-x86_64-455.23.05/kernel/nvidia/nv-acpi.c:15:
   /tmp/selfgz3864/NVIDIA-Linux-x86_64-455.23.05/kernel/common/inc/nv-linux.h:119:10: fatal error: asm/kmap_types.h: No such file or directory
     119 | #include <asm/kmap_types.h>         /* page table entry lookup          */
         |          ^~~~~~~~~~~~~~~~~~
   compilation terminated.
   make[2]: *** [scripts/Makefile.build:287: /tmp/selfgz3864/NVIDIA-Linux-x86_64-455.23.05/kernel/nvidia/nv-dma.o] Error 1
     CC [M]  /tmp/selfgz3864/NVIDIA-Linux-x86_64-455.23.05/kernel/nvidia/os-interface.o
   In file included from /tmp/selfgz3864/NVIDIA-Linux-x86_64-455.23.05/kernel/nvidia/nv-p2p.c:15:
   /tmp/selfgz3864/NVIDIA-Linux-x86_64-455.23.05/kernel/common/inc/nv-linux.h:119:10: fatal error: asm/kmap_types.h: No such file or directory
     119 | #include <asm/kmap_types.h>         /* page table entry lookup          */
         |          ^~~~~~~~~~~~~~~~~~
   compilation terminated.
   make[2]: *** [scripts/Makefile.build:287: /tmp/selfgz3864/NVIDIA-Linux-x86_64-455.23.05/kernel/nvidia/nv-acpi.o] Error 1
   In file included from /tmp/selfgz3864/NVIDIA-Linux-x86_64-455.23.05/kernel/nvidia/nv-mmap.c:15:
   /tmp/selfgz3864/NVIDIA-Linux-x86_64-455.23.05/kernel/common/inc/nv-linux.h:119:10: fatal error: asm/kmap_types.h: No such file or directory
     119 | #include <asm/kmap_types.h>         /* page table entry lookup          */
         |          ^~~~~~~~~~~~~~~~~~
   compilation terminated.
     CC [M]  /tmp/selfgz3864/NVIDIA-Linux-x86_64-455.23.05/kernel/nvidia/os-mlock.o
   make[2]: *** [scripts/Makefile.build:287: /tmp/selfgz3864/NVIDIA-Linux-x86_64-455.23.05/kernel/nvidia/nv-p2p.o] Error 1
   make[2]: *** [scripts/Makefile.build:287: /tmp/selfgz3864/NVIDIA-Linux-x86_64-455.23.05/kernel/nvidia/nv-mmap.o] Error 1
     CC [M]  /tmp/selfgz3864/NVIDIA-Linux-x86_64-455.23.05/kernel/nvidia/os-pci.o
     CC [M]  /tmp/selfgz3864/NVIDIA-Linux-x86_64-455.23.05/kernel/nvidia/os-registry.o
   In file included from /tmp/selfgz3864/NVIDIA-Linux-x86_64-455.23.05/kernel/nvidia/nv-pat.c:15:
   /tmp/selfgz3864/NVIDIA-Linux-x86_64-455.23.05/kernel/common/inc/nv-linux.h:119:10: fatal error: asm/kmap_types.h: No such file or directory
     119 | #include <asm/kmap_types.h>         /* page table entry lookup          */
         |          ^~~~~~~~~~~~~~~~~~
   compilation terminated.
   make[2]: *** [scripts/Makefile.build:287: /tmp/selfgz3864/NVIDIA-Linux-x86_64-455.23.05/kernel/nvidia/nv-pat.o] Error 1
   In file included from /tmp/selfgz3864/NVIDIA-Linux-x86_64-455.23.05/kernel/nvidia/nv-cray.c:15:
   /tmp/selfgz3864/NVIDIA-Linux-x86_64-455.23.05/kernel/common/inc/nv-linux.h:119:10: fatal error: asm/kmap_types.h: No such file or directory
     119 | #include <asm/kmap_types.h>         /* page table entry lookup          */
         |          ^~~~~~~~~~~~~~~~~~
   compilation terminated.
     CC [M]  /tmp/selfgz3864/NVIDIA-Linux-x86_64-455.23.05/kernel/nvidia/os-usermap.o
   make[2]: *** [scripts/Makefile.build:287: /tmp/selfgz3864/NVIDIA-Linux-x86_64-455.23.05/kernel/nvidia/nv-cray.o] Error 1
     CC [M]  /tmp/selfgz3864/NVIDIA-Linux-x86_64-455.23.05/kernel/nvidia/nv-modeset-interface.o
   In file included from /tmp/selfgz3864/NVIDIA-Linux-x86_64-455.23.05/kernel/nvidia/nv-usermap.c:15:
   /tmp/selfgz3864/NVIDIA-Linux-x86_64-455.23.05/kernel/common/inc/nv-linux.h:119:10: fatal error: asm/kmap_types.h: No such file or directory
     119 | #include <asm/kmap_types.h>         /* page table entry lookup          */
         |          ^~~~~~~~~~~~~~~~~~
   compilation terminated.
   make[2]: *** [scripts/Makefile.build:287: /tmp/selfgz3864/NVIDIA-Linux-x86_64-455.23.05/kernel/nvidia/nv-usermap.o] Error 1
   In file included from /tmp/selfgz3864/NVIDIA-Linux-x86_64-455.23.05/kernel/nvidia/nv-procfs.c:15:
   /tmp/selfgz3864/NVIDIA-Linux-x86_64-455.23.05/kernel/common/inc/nv-linux.h:119:10: fatal error: asm/kmap_types.h: No such file or directory
     119 | #include <asm/kmap_types.h>         /* page table entry lookup          */
         |          ^~~~~~~~~~~~~~~~~~
   compilation terminated.
     CC [M]  /tmp/selfgz3864/NVIDIA-Linux-x86_64-455.23.05/kernel/nvidia/nv-pci-table.o
   make[2]: *** [scripts/Makefile.build:287: /tmp/selfgz3864/NVIDIA-Linux-x86_64-455.23.05/kernel/nvidia/nv-procfs.o] Error 1
     CC [M]  /tmp/selfgz3864/NVIDIA-Linux-x86_64-455.23.05/kernel/nvidia/nv-kthread-q.o
   In file included from /tmp/selfgz3864/NVIDIA-Linux-x86_64-455.23.05/kernel/common/inc/nv-pci.h:15,
                    from /tmp/selfgz3864/NVIDIA-Linux-x86_64-455.23.05/kernel/nvidia/nv-pci.c:12:
   /tmp/selfgz3864/NVIDIA-Linux-x86_64-455.23.05/kernel/common/inc/nv-linux.h:119:10: fatal error: asm/kmap_types.h: No such file or directory
     119 | #include <asm/kmap_types.h>         /* page table entry lookup          */
         |          ^~~~~~~~~~~~~~~~~~
   compilation terminated.
   make[2]: *** [scripts/Makefile.build:287: /tmp/selfgz3864/NVIDIA-Linux-x86_64-455.23.05/kernel/nvidia/nv-pci.o] Error 1
     CC [M]  /tmp/selfgz3864/NVIDIA-Linux-x86_64-455.23.05/kernel/nvidia/nv-memdbg.o
   In file included from /tmp/selfgz3864/NVIDIA-Linux-x86_64-455.23.05/kernel/nvidia/nv-i2c.c:17:
   /tmp/selfgz3864/NVIDIA-Linux-x86_64-455.23.05/kernel/common/inc/nv-linux.h:119:10: fatal error: asm/kmap_types.h: No such file or directory
     119 | #include <asm/kmap_types.h>         /* page table entry lookup          */
         |          ^~~~~~~~~~~~~~~~~~
   compilation terminated.


cc flag
Do you have the linux-headers-xxx and linux-headers-xxx-generic packages installed for your kernel?
An Ignorant Wanderer avatar
za flag
@ubfan1 running `sudo apt install linux-headers-$(uname -r)` seems to suggest so:
An Ignorant Wanderer avatar
za flag
`Reading package lists... Done Building dependency tree Reading state information... Done linux-headers-5.11.0-25-generic is already the newest version (5.11.0-25.27~20.04.1). 0 upgraded, 0 newly installed, 0 to remove and 19 not upgraded. `
cc flag
Take a look at https://askubuntu.com/questions/1077061/how-do-i-install-nvidia-and-cuda-drivers-into-ubuntu/1077063#1077063 Clean out all the nvidia* and libnvidia* packages, then install from the standard repos the Nvidia 470 driver(tested). then run the cuda run script, and reject any Nvidia installs. With CUDA separated from the Nvidia video, it wont fall on its face every kernel update.
An Ignorant Wanderer avatar
za flag
@ubfan1 thank you this worked!
Score:0
za flag

Following the instructions in the post suggested by @ubfan1 solved the problem

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.