Nvidia 内核模块的不良后台编译

Nvidia 内核模块的不良后台编译

最近,在刚启动时,我注意到我的整个 CPU 使用率达到 100%。使用 htop 快速浏览后,我看到 4 个 cc1 进程正在编译某些内容,但不知道是什么。因此,我在家里留了一个脚本,以便在再次发生此事件时捕获该进程的所有信息。

脚本:

#! /bin/bash
ps -eF | grep cc1

因此这种情况再次发生,我运行脚本得到:

root       15586   15584 76 54470 188180  3 08:38 pts/0    00:00:04 /usr/lib/gcc/x86_64->linux-gnu/9/cc1 
-quiet -nostdinc -I ./arch/x86/include -I ./arch/x86/include/generated -I ./include -I >./arch/x86/include/uapi 
-I ./arch/x86/include/generated/uapi -I ./include/uapi -I ./include/generated/uapi -I >./ubuntu/include 
-I /var/lib/dkms/nvidia/470.141.03/build/common/inc -I >/var/lib/dkms/nvidia/470.141.03/build 
-I /var/lib/dkms/nvidia/470.141.03/build/nvidia-uvm -imultiarch x86_64-linux-gnu 
-MD /var/lib/dkms/nvidia/470.141.03/build/nvidia-uvm/uvm_va_block.d -MQ >/var/lib/dkms/nvidia/470.141.03/build/nvidia-uvm/uvm_va_block.o -D __KERNEL__ 
-D CONFIG_X86_X32_ABI -D CC_USING_FENTRY -D __KERNEL__ -D MODULE -D NVRM -D >NV_VERSION_STRING="470.141.03" -D NV_UVM_ENABLE -D NV_SPECTRE_V2=0 
-D NV_KERNEL_INTERFACE_LAYER -D NVIDIA_UVM_ENABLED -D NVIDIA_UNDEF_LEGACY_BIT_MACROS 
-D Linux -D __linux__ -D MODULE -D KBUILD_BASENAME="uvm_va_block" -D >KBUILD_MODNAME="nvidia_uvm" -D __KBUILD_MODNAME=kmod_nvidia_uvm 
-isystem /usr/lib/gcc/x86_64-linux-gnu/9/include -include ./include/linux/compiler->version.h 
-include ./include/linux/kconfig.h -include ./include/linux/compiler_types.h 
-MMD /var/lib/dkms/nvidia/470.141.03/build/nvidia-uvm/.uvm_va_block.o.d >/var/lib/dkms/nvidia/470.141.03/build/nvidia-uvm/uvm_va_block.c 
-quiet -dumpbase uvm_va_block.c -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 ->mno-80387 
-mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -mtune=generic -mno->red-zone -mcmodel=kernel 
-mindirect-branch=thunk-extern -mindirect-branch-register -mfunction-return=thunk-extern >-mrecord-mcount -mfentry -mno-red-zone 
-mcmodel=kernel -march=x86-64 -auxbase-strip >/var/lib/dkms/nvidia/470.141.03/build/nvidia-uvm/uvm_va_block.o 
-g -O2 -O2 -Wundef -Werror=strict-prototypes -Wno-trigraphs -Werror=implicit-function->declaration -Werror=implicit-int 
-Werror=return-type -Wno-format-security -Wno-sign-compare -Wno-frame-address -Wformat->truncation=0 -Wformat-overflow=0 
-Wno-address-of-packed-member -Wframe-larger-than=1024 -Wimplicit-fallthrough=5 -Wno->main -Wno-unused-but-set-variable 
-Wunused-const-variable=0 -Wdeclaration-after-statement -Wvla -Wno-pointer-sign -Wno->stringop-truncation -Wno-array-bounds 
-Wstringop-overflow=0 -Wno-restrict -Wno-maybe-uninitialized -Werror=date-time ->Werror=incompatible-pointer-types 
-Werror=designated-init -Wno-packed-not-aligned -Wall -Wno-cast-qual -Wno-error -Wno->format-extra-args -Wno-unused-function 
-Wuninitialized -Werror=undef -std=gnu90 -p -fmacro-prefix-map=./= -fno-common -fshort->wchar -fno-PIE -fcf-protection=none 
-falign-jumps=1 -falign-loops=1 -fno-asynchronous-unwind-tables -fno-jump-tables -fno->delete-null-pointer-checks -fstack-protector-strong 
-fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-strict-overflow -fstack->check=no -fconserve-stack -fno-strict-aliasing 
-fno-stack-clash-protection -fcf-protection=none -fsanitize=bounds -fsanitize=shift ->fsanitize=bool -fsanitize=enum 
--param allow-store-data-races=0 -fstack-protector-strong -o /tmp/ccMIQJjy.s

这表明 NVIDIA 的一个内核模块正在编译中,更具体地说kmod_nvidia_uvm。目前这种情况发生在我身上多次,我不知道为什么这种情况发生得如此频繁(我认为每次重启一次)。如果有人有关于此事的任何信息,我将不胜感激。

编辑:

评论建议添加dkms status输出:

nvidia, 470.141.03, 5.15.0-43-generic, x86_64: installed
nvidia, 470.141.03, 5.15.0-46-generic, x86_64: installed
v4l2loopback, 0.12.3, 5.15.0-43-generic, x86_64: installed
v4l2loopback, 0.12.3, 5.15.0-46-generic, x86_64: installed
virtualbox, 6.1.32, 5.15.0-43-generic, x86_64: installed
virtualbox, 6.1.32, 5.15.0-46-generic, x86_64: installed

tree /var/lib/dkms/输出(仅与 NVIDIA 相关):

/var/lib/dkms/
├── dkms_dbversion
├── nvidia
│   ├── 470.141.03
│   │   ├── 5.15.0-43-generic
│   │   │   └── x86_64
│   │   │       ├── log
│   │   │       │   └── make.log
│   │   │       └── module
│   │   │           ├── nvidia-drm.ko
│   │   │           ├── nvidia.ko
│   │   │           ├── nvidia-modeset.ko
│   │   │           ├── nvidia-peermem.ko
│   │   │           └── nvidia-uvm.ko
│   │   ├── 5.15.0-46-generic
│   │   │   └── x86_64
│   │   │       ├── log
│   │   │       │   └── make.log
│   │   │       └── module
│   │   │           ├── nvidia-drm.ko
│   │   │           ├── nvidia.ko
│   │   │           ├── nvidia-modeset.ko
│   │   │           ├── nvidia-peermem.ko
│   │   │           └── nvidia-uvm.ko
│   │   └── source -> /usr/src/nvidia-470.141.03
│   ├── kernel-5.15.0-43-generic-x86_64 -> 470.141.03/5.15.0-43 >generic/x86_64
│   └── kernel-5.15.0-46-generic-x86_64 -> 470.141.03/5.15.0-46 >generic/x86_64

使用的内核:

Linux version 5.15.0-46-generic (buildd@lcy02-amd64-007) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #49~20.04.1-Ubuntu SMP Thu Aug 4 19:15:44 UTC 2022

相关内容