Files
Inbox/系统基座文件/1/1.3/1.3.1 驱动核心模块状态 (Driver Kernel Modules).md
2025-12-11 07:24:36 +08:00

67 lines
3.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
tags:
date created: 星期三, 十一月 19日 2025, 5:27:53 下午
date modified: 星期三, 十一月 19日 2025, 5:28:03 下午
---
# 1.3.1 驱动核心模块状态 (Driver Kernel Modules)
**1. 驱动加载与版本一致性 (Driver Load & Consistency)**
- **关键性****P0**
- **信息解析**
- **核心状态**:驱动 `iluvatar` (v4.3.8) 已成功加载。
- **健康自检**dmesg 明确输出 `iluvatar 0001:01:00.0: DEV-0 is okay.`,标志着硬件初始化通过,未遇到固件加载错误。
- **签名警告**`module verification failed` 提示内核被“污染tainted这是因为使用了厂商提供的 Out-of-tree 非开源驱动。在开发环境中可忽略,生产环境若有强安全合规要求需进行自签名。
- **探测命令与结果**
```bash
dmesg | grep "iluvatar" | tail -n 5
[ 6.657344] iluvatar 0001:01:00.0: enabling device (0000 -> 0002)
[ 7.037538] iluvatar 0001:01:00.0: DEV-0 is okay.
```
**2. 关键模块参数配置 (Key Module Parameters)**
- **关键性****P1**
- **信息解析**
- **统一寻址 (UVA/VMM)**`itr_enable_vmm_va:Y`。开启了虚拟内存管理,允许 GPU 直接访问进程虚拟地址空间,简化了 `cudaMallocManaged` 等 API 的实现。
- **保留显存**`itr_text_mem_size:512`。驱动预留了 512MB 显存用于存放指令代码Text Segment。对于显存较小的卡如 8GB这 0.5GB 的开销需计入总预算。
- **功耗策略**`power:0`。通常 0 代表高性能模式(关闭激进节能),这有利于雷达信号处理的实时性稳定性。
- **探测命令与结果**
```bash
grep -r . /sys/module/iluvatar/parameters/
/sys/module/iluvatar/parameters/itr_enable_vmm_va:Y
/sys/module/iluvatar/parameters/itr_text_mem_size:512
/sys/module/iluvatar/parameters/power:0
```
**3. 设备节点与权限映射 (Device Nodes & Permissions)**
- **关键性****P0**
- **信息解析**
- **用户态接口**`/dev/iluvatar0` 已创建。
- **权限状态**`crw-rw-rw- (666)`。这意味着**任何用户**都可以提交 GPU 任务,无需加入特定组(如 `video` 组)。虽然方便开发,但在多用户服务器上存在安全隐患。
- **PCI 绑定**`/sys/bus/pci/…/driver` 链接正确指向了 `iluvatar` 驱动,确认设备未被 `pci-stub` 或 `vfio-pci` 错误抢占。
- **探测命令与结果**
```bash
ls -l /dev/iluvatar0
crw-rw-rw- 1 root root 239, 0 …
```
**4. 虚拟化与直通依赖 (Virtualization Dependencies)**
- **关键性****P2**
- **信息解析**
- **VFIO 栈**`mdev` 和 `vfio` 模块被 `iluvatar` 依赖。
- **架构意义**:这表明智铠驱动采用了现代化的 **MDEV (Mediated Device)** 架构设计。即使在物理机上,它也可能利用 VFIO 框架来管理 DMA 和中断,这为将来在 Docker 容器或 KVM 虚拟机中直通 GPU 提供了原生支持。
- **探测命令与结果**
```bash
lsmod | grep iluvatar
iluvatar 983040 0
vfio 262144 3 vfio_mdev,vfio_iommu_type1,iluvatar
```