本文介绍 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安装
apt直接安装的ffmpeg可能缺斤少两,这里我们直接使用编译好的二进制文件,Ffmpeg-Build
1.下载ffmpeg release
wget https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-n6.1-latest-linux64-gpl-6.1.tar.xz
这里我们选择ffmpeg 6.1(防止版本过低或者过高的问题XD)
- 解压
tar Jxvf ffmpeg-n6.1-latest-linux64-gpl-6.1.tar.xz
3.添加到系统默认指令
nano ~/.bashrc
到最下面 添加ffmpeg路径后保存
export PATH="/root/ffmpeg-n6.1-latest-linux64-gpl-6.1/bin:$PATH"
保存文件并运行以下命令使更改生效:
source ~/.bashrc
使用ffmpeg指令验证是否成功
ffmpeg -version