> For the complete documentation index, see [llms.txt](https://book.bsdcn.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://book.bsdcn.org/di-10-zhang-xian-ka-qu-dong/di-10.2-jie-intel-xian-ka-qu-dong.md).

# 10.2 Intel 显卡驱动

本节涵盖 Intel 核芯显卡（i915 DRM 模块）的驱动安装与配置。请先阅读显卡驱动概论。

## 安装 Intel 核芯显卡

### FreeBSD 14.x

> **技巧**
>
> 如果要使用 pkg 安装，可参照本书其他章节配置的 kernel modules（kmods）内核模块源。

```sh
# cd /usr/ports/graphics/drm-61-kmod
# make BATCH=yes install clean
```

或使用 pkg 安装（如 Ports 安装有问题则使用此方法）：

```sh
# pkg install drm-61-kmod
```

### FreeBSD 15.0

使用 Ports 安装：

```sh
# cd /usr/ports/graphics/drm-66-kmod
# make BATCH=yes install clean
```

> **注意**
>
> 英特尔三代处理器的 HD 4000 等早期核芯显卡，在未安装 DRM 驱动时，传统 BIOS 模式下仅能以 VESA 帧缓冲（无 GPU 加速）作为后备显示，在 UEFI 模式下可能出现花屏现象。安装对应版本的 DRM 显卡驱动后方可获得正常的 GPU 硬件加速。

## 配置 Intel 核芯显卡

在 **/etc/rc.conf** 文件中添加 `i915kms` 内核模块到 `kld_list`，以便系统启动时加载：

```sh
# sysrc -f /etc/rc.conf kld_list+=i915kms
```

## 视频硬解

> **警告**
>
> 如果忽略此部分，Blender 等依赖 GPU 加速的软件可能无法正常运行或产生“段错误”。

### 安装 Intel VA-API 媒体驱动

* 使用 pkg 安装：

```sh
# pkg install libva-intel-media-driver
```

* 或使用 Ports 安装：

```sh
# cd /usr/ports/multimedia/libva-intel-media-driver/
# make install clean
```

### 安装 Mesa 的 Gallium VA-API 和 VDPAU 支持包

* 使用 pkg 安装：

```sh
# pkg install mesa-gallium-va mesa-gallium-vdpau
```

* 或使用 Ports 安装：

```sh
# cd /usr/ports/graphics/mesa-gallium-va/ && make install clean
# cd /usr/ports/graphics/mesa-gallium-vdpau/ && make install clean
```

## 附录：Intel 显卡电源管理

某些显卡的功耗可能过高，FreeBSD 可通过特定的配置来降低功耗。

如果使用 **graphics/drm-kmod** 驱动的 Intel 显卡，可将以下选项添加到 **/boot/loader.conf** 文件中：

```ini
compat.linuxkpi.i915_fastboot=1  	# ①
compat.linuxkpi.i915_enable_dc=2 	# ②
compat.linuxkpi.i915_enable_fbc=1	# ③
```

功能说明：

| 配置项                               | 值   | 说明              |
| --------------------------------- | --- | --------------- |
| `compat.linuxkpi.i915_fastboot`   | `1` | 尝试跳过启动时不必要的模式设置 |
| `compat.linuxkpi.i915_enable_dc`  | `2` | 启用省电显示 C 状态     |
| `compat.linuxkpi.i915_enable_fbc` | `1` | 启用帧缓冲压缩以节省电力    |

## 参考文献

* FreeBSD Project. Graphics\[EB/OL]. \[2026-03-25]. <https://wiki.freebsd.org/Graphics>. FreeBSD 官方维基，是图形硬件兼容性详细列表与配置指南。

## 课后习题

1. 尝试自动化 FreeBSD 上的 DRM 移植流程。
2. 尝试从 OpenBSD 重新移植 DRM 实现。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://book.bsdcn.org/di-10-zhang-xian-ka-qu-dong/di-10.2-jie-intel-xian-ka-qu-dong.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
