I’m trying to install CUDA 11.8 on Ubuntu 22.04 on RTX 2060 laptop.
My gcc version is 11.4.0
My kernel 6.5.0-27-generic
I have run the command sudo sh cuda_11.8.0_520.61.05_linux.run
and I get an error.
cuda-installer.log
[INFO]: Driver installation detected by command: apt list --installed | grep -e nvidia-driver-[0-9][0-9][0-9] -e nvidia-[0-9][0-9][0-9]
[INFO]: Cleaning up window
[INFO]: Complete
[INFO]: Checking compiler version…
[INFO]: gcc location: /usr/bin/gcc
[INFO]: gcc version: gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)
[INFO]: Initializing menu
[INFO]: nvidia-fs.setKOVersion(2.13.5)
[INFO]: Setup complete
[INFO]: Components to install:
[INFO]: Driver
[INFO]: 520.61.05
[INFO]: Executing NVIDIA-Linux-x86_64-520.61.05.run --ui=none --no-questions --accept-license --disable-nouveau --no-cc-version-check --install-libglvnd 2>&1
[INFO]: Finished with code: 256
[ERROR]: Install of driver component failed. Consult the driver log at /var/log/nvidia-installer.log for more details.
[ERROR]: Install of 520.61.05 failed, quitting
nvidia-installer.log
→ The command cd ./kernel; /usr/bin/make -k -j12 NV_EXCLUDE_KERNEL_MODULES="" SYSSRC="/lib/modules/6.5.0-27-generic/build" SYSOUT="/lib/modules/6.5.0-27-generic/build" NV_KERNEL_MODULES="nvidia"
failed with the following output:
make[1]: Entering directory ‘/usr/src/linux-headers-6.5.0-27-generic’
warning: the compiler differs from the one used to build the kernel
The kernel was built by: x86_64-linux-gnu-gcc-12 (Ubuntu 12.3.0-1ubuntu1~22.04) 12.3.0
You are using: cc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Warning: Compiler version check failed:
The major and minor number of the compiler used to
compile the kernel:
x86_64-linux-gnu-gcc-12 (Ubuntu 12.3.0-1ubuntu1~22.04) 12.3.0, GNU ld (GNU Binutils for Ubuntu) 2.38
does not match the compiler used here:
cc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
It is recommended to set the CC environment variable
to the compiler that was used to compile the kernel.
To skip the test and silence this warning message, set
the IGNORE_CC_MISMATCH environment variable to “1”.
However, mixing compiler versions between the kernel
and kernel modules can result in subtle bugs that are
difficult to diagnose.
*** Failed CC version check. ***
CC [M] /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv.o
CC [M] /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv-pci.o
CC [M] /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv-dmabuf.o
CC [M] /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv-acpi.o
CC [M] /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv-cray.o
CC [M] /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv-dma.o
CC [M] /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv-i2c.o
CC [M] /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv-mmap.o
CC [M] /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv-p2p.o
CC [M] /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv-pat.o
CC [M] /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv-procfs.o
CC [M] /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv-procfs-utils.o
cc: error: unrecognized command-line option ‘-ftrivial-auto-var-init=zero’
make[3]: *** [scripts/Makefile.build:251: /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv.o] Error 1
CC [M] /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv-usermap.o
cc: error: unrecognized command-line option ‘-ftrivial-auto-var-init=zero’
cc: error: unrecognized command-line option ‘-ftrivial-auto-var-init=zero’
make[3]: *** [scripts/Makefile.build:251: /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv-dmabuf.o] Error 1
cc: error: unrecognized command-line option ‘-ftrivial-auto-var-init=zero’
make[3]: *** [scripts/Makefile.build:251: /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv-pci.o] Error 1
CC [M] /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv-vm.o
cc: error: unrecognized command-line option ‘-ftrivial-auto-var-init=zero’
make[3]: *** [scripts/Makefile.build:251: /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv-acpi.o] Error 1
make[3]: *** [scripts/Makefile.build:251: /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv-cray.o] Error 1
CC [M] /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv-vtophys.o
CC [M] /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/os-interface.o
cc: error: unrecognized command-line option ‘-ftrivial-auto-var-init=zero’
make[3]: *** [scripts/Makefile.build:251: /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv-dma.o] Error 1
CC [M] /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/os-mlock.o
cc: error: unrecognized command-line option ‘-ftrivial-auto-var-init=zero’
CC [M] /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/os-pci.o
make[3]: *** [scripts/Makefile.build:251: /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv-i2c.o] Error 1
cc: error: unrecognized command-line option ‘-ftrivial-auto-var-init=zero’
make[3]: *** [scripts/Makefile.build:251: /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv-mmap.o] Error 1
cc: error: unrecognized command-line option ‘-ftrivial-auto-var-init=zero’
CC [M] /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/os-registry.o
cc: error: unrecognized command-line option ‘-ftrivial-auto-var-init=zero’
make[3]: *** [scripts/Makefile.build:251: /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv-p2p.o] Error 1
make[3]: *** [scripts/Makefile.build:251: /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv-pat.o] Error 1
CC [M] /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/os-usermap.o
CC [M] /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv-modeset-interface.o
cc: error: unrecognized command-line option ‘-ftrivial-auto-var-init=zero’
make[3]: *** [scripts/Makefile.build:251: /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv-procfs.o] Error 1
CC [M] /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv-pci-table.o
cc: error: unrecognized command-line option ‘-ftrivial-auto-var-init=zero’
make[3]: *** [scripts/Makefile.build:251: /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv-procfs-utils.o] Error 1
CC [M] /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv-memdbg.o
CC [M] /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv-kthread-q.o
cc: error: unrecognized command-line option ‘-ftrivial-auto-var-init=zero’
make[3]: *** [scripts/Makefile.build:251: /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv-usermap.o] Error 1
cc: error: unrecognized command-line option ‘-ftrivial-auto-var-init=zero’
make[3]: *** [scripts/Makefile.build:251: /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv-vm.o] Error 1
CC [M] /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv-ibmnpu.o
cc: error: unrecognized command-line option ‘-ftrivial-auto-var-init=zero’
make[3]: *** [scripts/Makefile.build:251: /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv-vtophys.o] Error 1
CC [M] /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv-report-err.o
cc: error: unrecognized command-line option ‘-ftrivial-auto-var-init=zero’
make[3]: *** [scripts/Makefile.build:251: /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/os-interface.o] Error 1
CC [M] /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv-rsync.o
cc: error: unrecognized command-line option ‘-ftrivial-auto-var-init=zero’
CC [M] /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv-msi.o
make[3]: *** [scripts/Makefile.build:251: /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/os-mlock.o] Error 1
CC [M] /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv-caps.o
cc: error: unrecognized command-line option ‘-ftrivial-auto-var-init=zero’
make[3]: *** [scripts/Makefile.build:251: /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/os-pci.o] Error 1
cc: error: unrecognized command-line option ‘-ftrivial-auto-var-init=zero’
CC [M] /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv-frontend.o
make[3]: *** [scripts/Makefile.build:251: /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/os-registry.o] Error 1
cc: error: unrecognized command-line option ‘-ftrivial-auto-var-init=zero’
make[3]: *** [scripts/Makefile.build:251: /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/os-usermap.o] Error 1
CC [M] /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv_uvm_interface.o
cc: error: unrecognized command-line option ‘-ftrivial-auto-var-init=zero’
make[3]: *** [scripts/Makefile.build:251: /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv-modeset-interface.o] Error 1
cc: error: unrecognized command-line option ‘-ftrivial-auto-var-init=zero’
CC [M] /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nvlink_caps.o
make[3]: *** [scripts/Makefile.build:251: /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv-pci-table.o] Error 1
CC [M] /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nvlink_linux.o
cc: error: unrecognized command-line option ‘-ftrivial-auto-var-init=zero’
CC [M] /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/linux_nvswitch.o
make[3]: *** [scripts/Makefile.build:251: /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv-memdbg.o] Error 1
cc: error: unrecognized command-line option ‘-ftrivial-auto-var-init=zero’
CC [M] /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/procfs_nvswitch.o
make[3]: *** [scripts/Makefile.build:251: /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv-kthread-q.o] Error 1
CC [M] /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/i2c_nvswitch.o
cc: error: unrecognized command-line option ‘-ftrivial-auto-var-init=zero’
make[3]: *** [scripts/Makefile.build:251: /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv-ibmnpu.o] Error 1
cc: error: unrecognized command-line option ‘-ftrivial-auto-var-init=zero’
cc: error: unrecognized command-line option ‘-ftrivial-auto-var-init=zero’
make[3]: *** [scripts/Makefile.build:251: /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv-report-err.o] Error 1
make[3]: *** [scripts/Makefile.build:251: /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv-rsync.o] Error 1
cc: error: unrecognized command-line option ‘-ftrivial-auto-var-init=zero’
make[3]: *** [scripts/Makefile.build:251: /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv-msi.o] Error 1
cc: error: unrecognized command-line option ‘-ftrivial-auto-var-init=zero’
cc: error: unrecognized command-line option ‘-ftrivial-auto-var-init=zero’
make[3]: *** [scripts/Makefile.build:251: /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv-frontend.o] Error 1
make[3]: *** [scripts/Makefile.build:251: /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv_uvm_interface.o] Error 1
cc: error: unrecognized command-line option ‘-ftrivial-auto-var-init=zero’
make[3]: *** [scripts/Makefile.build:251: /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nv-caps.o] Error 1
cc: error: unrecognized command-line option ‘-ftrivial-auto-var-init=zero’
make[3]: *** [scripts/Makefile.build:251: /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nvlink_caps.o] Error 1
cc: error: unrecognized command-line option ‘-ftrivial-auto-var-init=zero’
cc: error: unrecognized command-line option ‘-ftrivial-auto-var-init=zero’
make[3]: *** [scripts/Makefile.build:251: /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/linux_nvswitch.o] Error 1
make[3]: *** [scripts/Makefile.build:251: /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/procfs_nvswitch.o] Error 1
cc: error: unrecognized command-line option ‘-ftrivial-auto-var-init=zero’
make[3]: *** [scripts/Makefile.build:251: /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/nvlink_linux.o] Error 1
cc: error: unrecognized command-line option ‘-ftrivial-auto-var-init=zero’
make[3]: *** [scripts/Makefile.build:251: /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/nvidia/i2c_nvswitch.o] Error 1
make[3]: Target ‘/tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel/’ not remade because of errors.
make[2]: *** [/usr/src/linux-headers-6.5.0-27-generic/Makefile:2039: /tmp/selfgz3398/NVIDIA-Linux-x86_64-520.61.05/kernel] Error 2
make[2]: Target ‘modules’ not remade because of errors.
make[1]: *** [Makefile:234: __sub-make] Error 2
make[1]: Target ‘modules’ not remade because of errors.
make[1]: Leaving directory ‘/usr/src/linux-headers-6.5.0-27-generic’
make: *** [Makefile:82: modules] Error 2
ERROR: The nvidia kernel module was not created.
ERROR: Installation has failed. Please see the file ‘/var/log/nvidia-installer.log’ for details. You may find suggestions on fixing installation problems in the README available on the Linux driver download page at www.nvidia.com.