驱动安装过程中出现类似如下报错。
[ERROR]Dkms install failed, details in : var/log/ascend_seclog/ascend_install.log. [ERROR]Driver_ko_install failed, details in : /var/log/ascend_seclog/ascend_install.log.
内核不适配
cat /var/log/ascend_seclog/ascend_install.log
cat /var/lib/dkms/davinci_ascend/1.0/build/make.log
./Ascend-hdk-310p-npu-driver_24.1.rc3_linux-aarch64.run --noexec --extract=./tmp
./Ascend-hdk-310p-npu-driver_24.1.rc3_linux-x86-64.run --noexec --extract=./tmp
cd tmp/driver/script vi run_driver_install.sh
查找“run_driver_install.sh”文件的“set_os_custom_compile”函数(非编辑模式下,执行/set_os_custom_compile命令查询),如下图所示。
在函数最末尾增加:(如下5.13.0是安装时用的内核版本,仅为示例,请根据实际内核版本进行修改替换)
sed -i 's/KERNEL_VERSION(5, 10, 0)/KERNEL_VERSION(5, 13, 0)/g' "$sourcedir"/kernel/svmdrv/pmaster/comm/svm_master_cgroup.c >>/dev/null 2>&1 sed -i 's/KERNEL_VERSION(5, 10, 0)/KERNEL_VERSION(5, 13, 0)/g' "$sourcedir"/kernel/svmdrv/vmaster/comm/svm_master_cgroup.c >>/dev/null 2>&1 sed -i 's/KERNEL_VERSION(5, 10, 0)/KERNEL_VERSION(5, 13, 0)/g' "$sourcedir"/kernel/svm_agent_host/host/comm_master/comm/svm_master_cgroup.c >>/dev/null 2>&1 sed -i 's/KERNEL_VERSION(5, 10, 0)/KERNEL_VERSION(5, 13, 0)/g' "$sourcedir"/kernel/dev_inc/inc/kernel_cgroup_mem_adapt.h >>/dev/null 2>&1
-Wno-incompatible-pointer-types
/usr/local/Ascend/driver/script/uninstall.sh
./driver/script/install.sh -- -- --full
./Ascend-hdk-310p-npu-driver_24.1.rc3_linux-aarch64.run --repack-path=./tmp new_driver_5.13.0.run
./Ascend-hdk-310p-npu-driver_24.1.rc3_linux-x86-64.run --repack-path=./tmp new_driver_5.13.0.run
cat /var/log/ascend_seclog/ascend_rebuild.log