Unable to Load nvidia-drm

I’m using a TiTan Xp, and I met such error: “Unable to Load nvidia-drm”, and failed to run nvidia-smi with such exception: “Failed to initialize NVML: Driver/library version mismatch
NVML library version: 560.35”

Here is the log:

nvidia-installer log file ‘/var/log/nvidia-installer.log’
creation time: Mon Sep 9 23:22:42 2024
installer version: 560.35.03

PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin

nvidia-installer command line:
./nvidia-installer
-no-x-check
-no-nouveau-check
-no-opengl-files

Unable to load: nvidia-installer ncurses v6 user interface

Using: nvidia-installer ncurses user interface
→ Detected 40 CPUs online; setting concurrency level to 32.
→ Scanning the initramfs with lsinitramfs…
→ Executing: /usr/bin/lsinitramfs -l /boot/initrd.img-4.15.0-142-generic
→ The file ‘/tmp/.X0-lock’ exists and appears to contain the process ID ‘1914’ of a running X server.
→ Continuing per the ‘–no-x-check’ option.
→ Installing NVIDIA driver version 560.35.03.
→ There appears to already be a driver installed on your system (version: 560.35.03). As part of installing this driv$-> Running distribution scripts
executing: ‘/usr/lib/nvidia/pre-install’…
→ done.
executing: ‘/usr/lib/nvidia/pre-install’… → done. → Initramfs scan complete. → The distribution-provided pre-install script failed! Are you sure you want to continue? (Answer: Continue installat$-> Performing CC sanity check with CC=“/usr/bin/cc”. → Performing CC check.
→ Kernel source path: ‘/lib/modules/4.15.0-142-generic/build’
→ Kernel output path: ‘/lib/modules/4.15.0-142-generic/build’
→ Performing Compiler check.
→ Performing Dom0 check.
→ Performing Xen check.
→ Performing PREEMPT_RT check.
→ Performing vgpu_kvm check. → Cleaning kernel module build directory.
executing: 'cd kernel; /usr/bin/make -k -j32 NV_EXCLUDE_KERNEL_MODULES=“” SYSSRC=“/lib/modules/4.15.0-142-generic/b$ rm -f -r conftest make[1]: Entering directory ‘/usr/src/linux-headers-4.15.0-142-generic’
make[1]: Leaving directory ‘/usr/src/linux-headers-4.15.0-142-generic’ → Building kernel modules executing: 'cd kernel; /usr/bin/make -k -j32 NV_EXCLUDE_KERNEL_MODULES=”" SYSSRC="/lib/modules/4.15.0-142-generic/b$ make[1]: Entering directory ‘/usr/src/linux-headers-4.15.0-142-generic’
Warning: Compiler version check failed:
The major and minor number of the compiler used to

The major and minor number of the compiler used to
compile the kernel:

gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.12)

does not match the compiler used here:

cc (Ubuntu 7.5.0-3ubuntu1~16.04) 7.5.0
Copyright (C) 2017 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. ***
*** Failed CC version check. ***
SYMLINK /tmp/selfgz33915/NVIDIA-Linux-x86_64-560.35.03/kernel/nvidia/nv-kernel.o
SYMLINK /tmp/selfgz33915/NVIDIA-Linux-x86_64-560.35.03/kernel/nvidia-modeset/nv-modeset-kernel.o
CONFTEST: hash__remap_4k_pfn CONFTEST: set_pages_uc
CONFTEST: list_is_first CONFTEST: set_memory_uc
CONFTEST: set_memory_array_uc CONFTEST: set_pages_array_uc CONFTEST: ioremap_cache CONFTEST: ioremap_wc CONFTEST: ioremap_driver_hardened
CONFTEST: ioremap_driver_hardened_wc
CONFTEST: pci_get_domain_bus_and_slot CONFTEST: ioremap_cache_shared CONFTEST: get_num_physpages
CONFTEST: pde_data CONFTEST: xen_ioemu_inject_msi CONFTEST: phys_to_dma CONFTEST: get_dma_ops CONFTEST: dma_attr_macros
CONFTEST: dma_map_page_attrs
CONFTEST: write_cr4 CONFTEST: of_find_node_by_phandle
CONFTEST: write_cr4 CONFTEST: of_find_node_by_phandle CONFTEST: of_node_to_nid CONFTEST: pnv_pci_get_npu_dev CONFTEST: of_get_ibm_chip_id CONFTEST: pci_bus_address
CONFTEST: pci_stop_and_remove_bus_device CONFTEST: pci_rebar_get_possible_sizes
CONFTEST: wait_for_random_bytes CONFTEST: register_cpu_notifier CONFTEST: cpuhp_setup_state CONFTEST: dma_map_resource CONFTEST: get_backlight_device_by_name
CONFTEST: timer_setup CONFTEST: pci_enable_msix_range CONFTEST: kernel_read_has_pointer_pos_arg CONFTEST: kernel_write_has_pointer_pos_arg
CONFTEST: dma_direct_map_resource CONFTEST: tegra_get_platform CONFTEST: tegra_bpmp_send_receive CONFTEST: flush_cache_all CONFTEST: vmf_insert_pfn CONFTEST: jiffies_to_timespec
CONFTEST: ktime_get_raw_ts64 CONFTEST: ktime_get_real_ts64

CONFTEST: ktime_get_raw_ts64                                                                                          CONFTEST: ktime_get_real_ts64                                                                                         CONFTEST: full_name_hash                                                                                              CONFTEST: pci_enable_atomic_ops_to_root                                                                               CONFTEST: vga_tryget                                                                                                  CONFTEST: cc_platform_has
CONFTEST: seq_read_iter                                                                                               CONFTEST: follow_pfn                                                                                                  CONFTEST: drm_gem_object_get                                                                                          CONFTEST: drm_gem_object_put_unlocked                                                                                 CONFTEST: add_memory_driver_managed                                                                                   CONFTEST: device_property_read_u64                                                                                    CONFTEST: devm_of_platform_populate                                                                                   CONFTEST: of_dma_configure                                                                                            CONFTEST: of_property_count_elems_of_size                                                                             CONFTEST: of_property_read_variable_u8_array                                                                          CONFTEST: of_property_read_variable_u32_array
CONFTEST: i2c_new_client_device                                                                                       CONFTEST: i2c_unregister_device                                                                                       CONFTEST: of_get_named_gpio                                                                                           CONFTEST: devm_gpio_request_one                                                                                       CONFTEST: gpio_direction_input                                                                                        CONFTEST: gpio_direction_output
CONFTEST: gpio_get_value                                                                                              CONFTEST: gpio_set_value 
CONFTEST: gpio_get_value                                                                                              CONFTEST: gpio_set_value                                                                                              CONFTEST: gpio_to_irq                                                                                                 CONFTEST: icc_get                                                                                                     CONFTEST: icc_put                                                                                                     CONFTEST: icc_set_bw                                                                                                  CONFTEST: dma_buf_export_args                                                                                         CONFTEST: dma_buf_ops_has_kmap                                                                                        CONFTEST: dma_buf_ops_has_kmap_atomic                                                                                 CONFTEST: dma_buf_ops_has_map                                                                                         CONFTEST: dma_buf_ops_has_map_atomic                                                                                  CONFTEST: dma_buf_has_dynamic_attachment                                                                              CONFTEST: dma_buf_attachment_has_peer2peer                                                                            CONFTEST: dma_set_mask_and_coherent                                                                                   CONFTEST: devm_clk_bulk_get_all                                                                                       CONFTEST: get_task_ioprio                                                                                             CONFTEST: mdev_set_iommu_device                                                                                       CONFTEST: offline_and_remove_memory                                                                                   CONFTEST: stack_trace                                                                                                 CONFTEST: crypto_tfm_ctx_aligned                                                                                      CONFTEST: wait_on_bit_lock_argument_count                                                                             CONFTEST: radix_tree_empty                                                                                            CONFTEST: radix_tree_replace_slot
CONFTEST: pnv_npu2_init_context                                                                                       CONFTEST: cpumask_of_node 

CONFTEST: pnv_npu2_init_context CONFTEST: cpumask_of_node CONFTEST: ioasid_get CONFTEST: mm_pasid_drop CONFTEST: mmget_not_zero CONFTEST: mmgrab CONFTEST: iommu_sva_bind_device_has_drvdata_arg CONFTEST: vm_fault_to_errno CONFTEST: find_next_bit_wrap CONFTEST: iommu_is_dma_domain CONFTEST: acpi_video_backlight_use_native CONFTEST: drm_dev_unref CONFTEST: drm_reinit_primary_mode_group CONFTEST: get_user_pages_remote CONFTEST: get_user_pages CONFTEST: pin_user_pages_remote CONFTEST: pin_user_pages CONFTEST: drm_gem_object_lookup CONFTEST: drm_atomic_state_ref_counting CONFTEST: drm_driver_has_gem_prime_res_obj CONFTEST: drm_atomic_helper_connector_dpms CONFTEST: drm_connector_funcs_have_mode_in_name CONFTEST: drm_connector_has_vrr_capable_property
CONFTEST: drm_framebuffer_get CONFTEST: drm_dev_put

CONFTEST: ib_peer_memory_symbols CC [M] /tmp/selfgz33915/NVIDIA-Linux-x86_64-560.35.03/kernel/nvidia/nv.o CC [M] /tmp/selfgz33915/NVIDIA-Linux-x86_64-560.35.03/kernel/nvidia/nv-pci.o CC [M] /tmp/selfgz33915/NVIDIA-Linux-x86_64-560.35.03/kernel/nvidia/nv-dmabuf.o CC [M] /tmp/selfgz33915/NVIDIA-Linux-x86_64-560.35.03/kernel/nvidia/nv-nano-timer.o
ld -r -o /tmp/selfgz33915/NVIDIA-Linux-x86_64-560.35.03/kernel/nvidia/nv-interface.o /tmp/selfgz33915/NVIDIA-Linux$ ux-x86_64-560.35.03/kernel/nvidia/nv-vtophys.o /tmp/selfgz33915/NVIDIA-Linux-x86_64-560.35.03/kernel/nvidia/os-int$ gz33915/NVIDIA-Linux-x86_64-560.35.03/kernel/nvidia/nv-caps.o /tmp/selfgz33915/NVIDIA-Linux-x86_64-560.35.03/kerne$ 0.35.03/kernel/nvidia/libspdm_internal_crypt_lib.o /tmp/selfgz33915/NVIDIA-Linux-x86_64-560.35.03/kernel/nvidia/li$ LD [M] /tmp/selfgz33915/NVIDIA-Linux-x86_64-560.35.03/kernel/nvidia.o ld -r -o /tmp/selfgz33915/NVIDIA-Linux-x86_64-560.35.03/kernel/nvidia-modeset/nv-modeset-interface.o /tmp/selfgz33$ LD [M] /tmp/selfgz33915/NVIDIA-Linux-x86_64-560.35.03/kernel/nvidia-modeset.o LD [M] /tmp/selfgz33915/NVIDIA-Linux-x86_64-560.35.03/kernel/nvidia-peermem.o LD [M] /tmp/selfgz33915/NVIDIA-Linux-x86_64-560.35.03/kernel/nvidia-drm.o LD [M] /tmp/selfgz33915/NVIDIA-Linux-x86_64-560.35.03/kernel/nvidia-uvm.o Building modules, stage 2. MODPOST 5 modules
Building modules, stage 2. MODPOST 5 modules CC /tmp/selfgz33915/NVIDIA-Linux-x86_64-560.35.03/kernel/nvidia-drm.mod.o CC /tmp/selfgz33915/NVIDIA-Linux-x86_64-560.35.03/kernel/nvidia-modeset.mod.o CC /tmp/selfgz33915/NVIDIA-Linux-x86_64-560.35.03/kernel/nvidia-peermem.mod.o CC /tmp/selfgz33915/NVIDIA-Linux-x86_64-560.35.03/kernel/nvidia-uvm.mod.o CC /tmp/selfgz33915/NVIDIA-Linux-x86_64-560.35.03/kernel/nvidia.mod.o LD [M] /tmp/selfgz33915/NVIDIA-Linux-x86_64-560.35.03/kernel/nvidia-modeset.ko LD [M] /tmp/selfgz33915/NVIDIA-Linux-x86_64-560.35.03/kernel/nvidia-uvm.ko LD [M] /tmp/selfgz33915/NVIDIA-Linux-x86_64-560.35.03/kernel/nvidia-drm.ko LD [M] /tmp/selfgz33915/NVIDIA-Linux-x86_64-560.35.03/kernel/nvidia-peermem.ko LD [M] /tmp/selfgz33915/NVIDIA-Linux-x86_64-560.35.03/kernel/nvidia.ko make[1]: Leaving directory ‘/usr/src/linux-headers-4.15.0-142-generic’ → done. → Kernel module compilation complete. → Kernel messages: [ 946.499932] nvidia 0000:84:00.0: vgaarb: changed VGA decodes: olddecodes=none,decodes=none:owns=none [ 946.500098] NVRM: loading NVIDIA UNIX x86_64 Kernel Module 384.130 Wed Mar 21 03:37:26 PDT 2018 (using threaded $[ 946.502859] nvidia_uvm: Unknown symbol nvUvmInterfaceTsgDestroy (err 0) [ 946.502899] nvidia_uvm: Unknown symbol nvUvmInterfacePagingChannelAllocate (err 0) [ 946.502920] nvidia_uvm: Unknown symbol nvUvmInterfaceCslEncrypt (err 0) [ 946.502949] nvidia_uvm: Unknown symbol nvUvmInterfacePagingChannelsMap (err 0) [ 946.502977] nvidia_uvm: Unknown symbol nvUvmInterfacePagingChannelPushStream (err 0) [ 946.503043] nvidia_uvm: Unknown symbol nvUvmInterfaceCslDecrypt (err 0) [ 946.503065] nvidia_uvm: Unknown symbol nvUvmInterfaceCslLogEncryption (err 0)
[ 946.503043] nvidia_uvm: Unknown symbol nvUvmInterfaceCslDecrypt (err 0) [ 946.503065] nvidia_uvm: Unknown symbol nvUvmInterfaceCslLogEncryption (err 0) [ 946.503088] nvidia_uvm: Unknown symbol nvUvmInterfacePagingChannelsUnmap (err 0) [ 946.503125] nvidia_uvm: Unknown symbol nvUvmInterfaceCslQueryMessagePool (err 0) [ 946.503148] nvidia_uvm: Unknown symbol nvUvmInterfaceTogglePrefetchFaults (err 0) [ 946.503171] nvidia_uvm: Unknown symbol nvUvmInterfaceCslInitContext (err 0) [ 946.503191] nvidia_uvm: Unknown symbol nvUvmInterfaceDeinitCslContext (err 0) [ 946.503216] nvidia_uvm: Unknown symbol nvUvmInterfaceQueryCopyEnginesCaps (err 0) [ 946.503237] nvidia_uvm: Unknown symbol nvUvmInterfaceCslIncrementIv (err 0) [ 946.503258] nvidia_uvm: Unknown symbol nvUvmInterfaceReportNonReplayableFault (err 0) [ 946.503284] nvidia_uvm: Unknown symbol nvUvmInterfaceCslRotateIv (err 0) [ 946.503307] nvidia_uvm: Unknown symbol nvUvmInterfacePagingChannelDestroy (err 0) [ 946.503331] nvidia_uvm: Unknown symbol nvUvmInterfaceDeviceCreate (err 0) [ 946.503362] nvidia_uvm: Unknown symbol nvUvmInterfaceTsgAllocate (err 0) [ 946.503397] nvidia_uvm: Unknown symbol nvUvmInterfaceGetEccInfo (err 0) [ 946.503424] nvidia_uvm: Unknown symbol nvUvmInterfaceCslSign (err 0) [ 946.503452] nvidia_uvm: Unknown symbol nvUvmInterfaceDeviceDestroy (err 0) [ 946.503472] nvidia_uvm: Unknown symbol nvUvmInterfaceFlushReplayableFaultBuffer (err 0) → Install NVIDIA’s 32-bit compatibility libraries? (Answer: No) → Uninstalling the previous installation → done. → Would you like to register the kernel module sources with DKMS? This will allow DKMS to automatically build a new $-> Searching for conflicting files: → done. → Installing ‘NVIDIA Accelerated Graphics Driver for Linux-x86_64’ (560.35.03):
→ done. → Installing ‘NVIDIA Accelerated Graphics Driver for Linux-x86_64’ (560.35.03): → No NVIDIA modules detected in the initramfs. → The initramfs will not be rebuild. executing: ‘/sbin/ldconfig’… /sbin/ldconfig.real: /usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn_cnn_infer.so.8 is not a symbolic link /sbin/ldconfig.real: /usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn_cnn_train.so.8 is not a symbolic link /sbin/ldconfig.real: /usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn.so.8 is not a symbolic link /sbin/ldconfig.real: /usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn_ops_infer.so.8 is not a symbolic link /sbin/ldconfig.real: /usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn_adv_infer.so.8 is not a symbolic link /sbin/ldconfig.real: /usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn_ops_train.so.8 is not a symbolic link executing: '/sbin/depmod -a '… executing: ‘/bin/systemctl daemon-reload’… → done. → Driver file installation is complete. ERROR: Unable to load the ‘nvidia-drm’ kernel module. → Kernel messages: [ 976.295065] nvidia_uvm: Unknown symbol nvUvmInterfaceCslEncrypt (err 0) [ 976.295089] nvidia_uvm: Unknown symbol nvUvmInterfacePagingChannelsMap (err 0)
[ 976.295065] nvidia_uvm: Unknown symbol nvUvmInterfaceCslEncrypt (err 0) [ 976.295089] nvidia_uvm: Unknown symbol nvUvmInterfacePagingChannelsMap (err 0) [ 976.295115] nvidia_uvm: Unknown symbol nvUvmInterfacePagingChannelPushStream (err 0) [ 976.295172] nvidia_uvm: Unknown symbol nvUvmInterfaceCslDecrypt (err 0) [ 976.295190] nvidia_uvm: Unknown symbol nvUvmInterfaceCslLogEncryption (err 0) [ 976.295210] nvidia_uvm: Unknown symbol nvUvmInterfacePagingChannelsUnmap (err 0) [ 976.295242] nvidia_uvm: Unknown symbol nvUvmInterfaceCslQueryMessagePool (err 0) [ 976.295261] nvidia_uvm: Unknown symbol nvUvmInterfaceTogglePrefetchFaults (err 0) [ 976.295282] nvidia_uvm: Unknown symbol nvUvmInterfaceCslInitContext (err 0) [ 976.295300] nvidia_uvm: Unknown symbol nvUvmInterfaceDeinitCslContext (err 0) [ 976.295320] nvidia_uvm: Unknown symbol nvUvmInterfaceQueryCopyEnginesCaps (err 0) [ 976.295339] nvidia_uvm: Unknown symbol nvUvmInterfaceCslIncrementIv (err 0) [ 976.295358] nvidia_uvm: Unknown symbol nvUvmInterfaceReportNonReplayableFault (err 0) [ 976.295381] nvidia_uvm: Unknown symbol nvUvmInterfaceCslRotateIv (err 0) [ 976.295400] nvidia_uvm: Unknown symbol nvUvmInterfacePagingChannelDestroy (err 0) [ 976.295422] nvidia_uvm: Unknown symbol nvUvmInterfaceDeviceCreate (err 0) [ 976.295448] nvidia_uvm: Unknown symbol nvUvmInterfaceTsgAllocate (err 0) [ 976.295479] nvidia_uvm: Unknown symbol nvUvmInterfaceGetEccInfo (err 0) [ 976.295503] nvidia_uvm: Unknown symbol nvUvmInterfaceCslSign (err 0) [ 976.295527] nvidia_uvm: Unknown symbol nvUvmInterfaceDeviceDestroy (err 0) [ 976.295545] nvidia_uvm: Unknown symbol nvUvmInterfaceFlushReplayableFaultBuffer (err 0) [ 976.350863] NVRM: API mismatch: the client has the version 560.35.03, but NVRM: this kernel module has the version 384.130. Please NVRM: make sure that this kernel module and all NVIDIA driver NVRM: components have the same version.