本文介绍 Intel 客户端 GPU 的安装。来源:
虽然debian12和ubuntu23.04内核集成了核显驱动,但是在使用过程中发现可能仍然需要手动安装一遍(除了用于 GPU 调试),对于debian11、ubuntu22.04可能需要先升级系统内核(5.18以上)
1.客户端 Intel 软件包存储库配置
对于所有客户端方案,您必须配置系统以安装客户端 (arc) 软件包。添加 Ubuntu 22.04 (debian12同样适用)客户端包存储库:
wget -qO - https://repositories.intel.com/gpu/intel-graphics.key | \
sudo gpg --dearmor --output /usr/share/keyrings/intel-graphics.gpg
echo "deb [arch=amd64,i386 signed-by=/usr/share/keyrings/intel-graphics.gpg] https://repositories.intel.com/gpu/ubuntu jammy client" | \
sudo tee /etc/apt/sources.list.d/intel-gpu-jammy.list
sudo apt update
2.安装计算、媒体和显示运行环境
应为树外和上游驱动程序安装方案安装这组用户模式软件包。
sudo apt install -y \
intel-opencl-icd intel-level-zero-gpu level-zero \
intel-media-va-driver-non-free libmfx1 libmfxgen1 libvpl2 \
libegl-mesa0 libegl1-mesa libegl1-mesa-dev libgbm1 libgl1-mesa-dev libgl1-mesa-dri \
libglapi-mesa libgles2-mesa-dev libglx-mesa0 libigdgmm12 libxatracker2 mesa-va-drivers \
mesa-vdpau-drivers mesa-vulkan-drivers va-driver-all vainfo hwinfo clinfo
安装新版本的 Mesa 后,您需要通过系统重新启动或重新启动窗口管理器来重新启动桌面。
3.验证安装
经过上述操作后应该可以正常使用和识别到intel核显驱动
下面为验证方式
3.1验证预期硬件是否与 i915 驱动程序一起工作
hwinfo --display
以下是英特尔® UHD 770的示例输出:
25: PCI 02.0: 0300 VGA compatible controller (VGA)
[Created at pci.386]
Unique ID: _Znp.yR73BLn8YW9
SysFS ID: /devices/pci0000:00/0000:00:02.0
SysFS BusID: 0000:00:02.0
Hardware Class: graphics card
Device Name: "Onboard - Video"
Model: "Intel VGA compatible controller"
Vendor: pci 0x8086 "Intel Corporation"
Device: pci 0x4690
SubVendor: pci 0x1043 "ASUSTeK Computer Inc."
SubDevice: pci 0x8694
Revision: 0x0c
Driver: "i915"
Driver Modules: "i915"
Memory Range: 0x6002000000-0x6002ffffff (rw,non-prefetchable)
Memory Range: 0x4000000000-0x400fffffff (ro,non-prefetchable)
I/O Ports: 0x5000-0x503f (rw)
Memory Range: 0x000c0000-0x000dffff (rw,non-prefetchable,disabled)
IRQ: 175 (56086991 events)
Module Alias: "pci:v00008086d00004690sv00001043sd00008694bc03sc00i00"
Driver Info #0:
Driver Status: i915 is active
Driver Activation Cmd: "modprobe i915"
Config Status: cfg=new, avail=yes, need=no, active=unknown
Primary display adapter: #25
设备 ID 列表包含在图形处理器表部分中。
3.2使用xpu-smi 查看设备信息
英特尔® XPU Manager(英特尔® XPUM)工具提供了广泛的功能,涵盖英特尔数据中心 GPU 的系统管理、GPU 监控、诊断和配置。它可以通过 RESTful API 以及简化的 xpu-smi 工具在全功能模式下使用。
可用的GPU设备发现:
$ xpu-smi discovery
+-----------+--------------------------------------------------------------------------------------+
| Device ID | Device Information |
+-----------+--------------------------------------------------------------------------------------+
| 0 | Device Name: Intel(R) Data Center GPU Flex 170 |
| | Vendor Name: Intel(R) Corporation |
| | UUID: 00000000-0000-0000-6769-df256e271362 |
| | PCI BDF Address: 0000:4d:00.0 |
| | DRM Device: /dev/dri/card1 |
| | Function Type: physical |
+-----------+--------------------------------------------------------------------------------------+
详细的设备信息,包括安装的驱动程序和固件版本:
$ sudo xpu-smi discovery -d 0
+-----------+--------------------------------------------------------------------------------------+
| Device ID | Device Information |
+-----------+--------------------------------------------------------------------------------------+
| 0 | Device Type: GPU |
| | Device Name: Intel(R) Data Center GPU Flex 170 |
| | Vendor Name: Intel(R) Corporation |
| | UUID: 00000000-0000-0000-6769-df256e271362 |
| | Serial Number: LQAC13401787 |
| | Core Clock Rate: 2050 MHz |
| | Stepping: C0 |
| | |
| | Driver Version: I915_23.4.15_PSB_230307.15 |
| | Kernel Version: 5.15.0-47-generic |
| | GFX Firmware Name: GFX |
| | GFX Firmware Version: DG02_1.3267 |
| | GFX Firmware Status: normal |
| | GFX Data Firmware Name: GFX_DATA |
| | GFX Data Firmware Version: 0x46b |
| | GFX PSC Firmware Name: GFX_PSCBIN |
| | GFX PSC Firmware Version: |
| | AMC Firmware Name: AMC |
| | AMC Firmware Version: |
| | |
| | PCI BDF Address: 0000:4d:00.0 |
| | PCI Slot: J37 - Riser 1, Slot 1 |
| | PCIe Generation: 4 |
| | PCIe Max Link Width: 16 |
| | OAM Socket ID: |
| | |
| | Memory Physical Size: 14248.00 MiB |
| | Max Mem Alloc Size: 4095.99 MiB |
| | ECC State: enabled |
| | Number of Memory Channels: 2 |
| | Memory Bus Width: 128 |
| | Max Hardware Contexts: 65536 |
| | Max Command Queue Priority: 0 |
| | |
| | Number of EUs: 512 |
| | Number of Tiles: 1 |
| | Number of Slices: 1 |
| | Number of Sub Slices per Slice: 32 |
| | Number of Threads per EU: 8 |
| | Physical EU SIMD Width: 8 |
| | Number of Media Engines: 2 |
| | Number of Media Enhancement Engines: 2 |
| | |
| | Number of Xe Link ports: |
| | Max Tx/Rx Speed per Xe Link port: |
| | Number of Lanes per Xe Link port: |
+-----------+--------------------------------------------------------------------------------------+
测试没问题之后就可以正常使用
ffmpeg中使用h264_qsv进行编码
FFmpeg6.0安装
1.添加Deb多媒体存储库
Debian 12系统存储库提供了FFmpeg 5.1.3,而最新已达到v6.0。而且,deb-multimedia.org 是一个流行的第 3 方存储库,其中包含许多适用于 Debian 的媒体应用程序包,包括 FFMPEG 6.0。
当终端打开时,运行命令:
sudo nano /etc/apt/sources.list.d/deb-multimedia.sources
该命令在“/etc/apt/sources.list.d ”创建一个源文件(如果不存在),然后使用 nano 命令行文本编辑器对其进行编辑。在下面输入
Types: deb
URIs: https://www.deb-multimedia.org
Suites: stable
Components: main non-free
Signed-By: /etc/apt/trusted.gpg.d/deb-multimedia-keyring.gpg
最后,按Ctrl+X,输入y并按 Enter 保存文件。
2.安装密钥
如您所见,第一步添加了“Signed-By”部分来指定密钥。现在,让我们下载并安装密钥。
2.1 首先,选择下载最新的密钥文件。在撰写本文时,它是“ deb-multimedia-keyring_2016.8.1_all.deb”
2.2 获得密钥 .deb 文件后,打开终端并运行命令来安装它:
apt install /path/to/deb-multimedia-keyring_2016.8.1_all.deb
2.3 设置包优先级
deb-multimedia 存储库还包含许多其他软件包。最好设置较低的优先级,这样您的系统就不会从该存储库安装任何软件包。
打开终端并运行命令
sudo nano /etc/apt/preferences.d/99deb-multimedia
此命令在“ etc/apt/preferences.d”下创建一个配置文件,然后使用 nano 命令行文本编辑器打开,复制并粘贴以下行:
Package: *
Pin: origin www.deb-multimedia.org
Pin-Priority: 1
最后,按Ctrl+X,输入y并按 Enter 保存文件。
3.安装 FFmpeg 6.0
添加源存储库、安装密钥并设置优先级后,最后通过运行以下命令安装 FFmpeg。
sudo apt update
sudo apt install -t 'o=Unofficial Multimedia Packages' ffmpeg
安装完毕后使用ffmpeg -version
来验证