本文从零开始,先介绍安装ubuntu22.04 LTS,然后介绍安装英特尔锐炫独立的驱动程序
安装ubuntu22.04 LTS全流程
1.1 制作Ubuntu USB安装盘
参考官方文档:Install Ubuntu desktop | Ubuntu
第一步,从https://rufus.ie/zh/下载rufus
第二步,从https://cn.ubuntu.com/download/desktop,下载Ubuntu 22.04镜像文件ubuntu-22.04.2-desktop-amd64.iso
第三步,准备一个25G以上的U盘,并插进电脑的USB口后,打开运行rufus.exe这个应用程序
第四步,在rufus中将之前下好的ubuntu-22.04.2-desktop-amd64.iso镜像文件,烧录到U盘,如下图所示

1.2 安装Ubuntu22.04.2 LTS
第一步,在BIOS中设置U盘启动。电脑启动时,进入BIOS界面,在Boot菜单下的Boot Priority选择U盘启动优先

第二步,插入U盘,启动电脑,安装Ubuntu22.04.2 LTS。为了后续训练AI模型方便,请安装English版本。

第三步,建议选择常规安装,以获得更好的桌面体验。
- 常规安装(Normal Installation):安装所有常规使用相关的应用程序
- 最简安装(Minimal Installation):只会安装基本的应用程序。

后续步骤按推荐选项即可,安装完毕,重启电脑,即可进入Ubuntu22.04.2 LTS系统。此时,由于没有安装英特尔独立显卡的驱动,在About界面,Graphics是llvmpipe,即Intel A750显卡未被正确识别出来,如下图所示。

安装英特尔锐炫独立显卡驱动程序全流程
2.1 安装pip
第一步:打开终端,输入命令安装pip:
sudo apt-get install python3-pip

第二步:配置pip阿里源。为了提高pip的下载安装速度,国内用户请先设置阿里源,使用命令:
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
pip config set install.trusted-host mirrors.aliyun.com
最后通过pip config list命令检测是否设置成功

第三步:更新pip。使用命令
python -m pip install --upgrade pip

添加Intel显卡驱动包存储库
为了安装 repositories.intel.com/graphics中的软件,需要先将 repositories.intel.com/graphics 包存储库添加到系统,使用命令:
sudo apt-get install -y gpg-agent wget
wget -qO - https://repositories.intel.com/graphics/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/graphics/ubuntu jammy arc' |
sudo tee /etc/apt/sources.list.d/intel.gpu.jammy.list

安装LinuxOEM内核
目前 DKMS 软件包仅支持 Ubuntu 5.17 OEM 内核,而安装好的Ubuntu22.04的内核却时5.19的版本,所以我们需要先下载5.17版本的内核,并且删除更高版本的内核,具体步骤如下:
第一步,在终端输入命令,下载5.17版本内核:
sudo apt-get update && sudo apt-get install -y linux-image-5.17.0-1020-oem

第二步,重启电脑,通过启用5.17版本的内核进入到ubuntu,列出所有linux内核版本。使用命令:
dpkg --get-selections | grep linux

第三步,删掉高于5.17的内核版本,使用命令
sudo apt remove --purge linux-headers-5.19.0-32-generic
sudo apt remove --purge linux-image-5.19.0-32-generic #删除5.19内核
sudo apt-get autoremove #删除掉相关依赖文件
第四步,更新内核 grub 选项
sudo update-grub

第五步,通过命令sudo reboot使这些设置生效后,通过命令uname -r查看是否使用5.17版本的内核。

第六步:通过命令
sudo apt-get update
sudo apt-get -y install
gawk
dkms
linux-headers-$(uname -r)
libc6-dev udev

安装 dkms 和内核头文件。
安装 DKMS 内核模块
使用命令,安装 DKMS 内核模块
sudo apt-get install -y intel-platform-vsec-dkms intel-platform-cse-dkms
sudo apt-get install -y intel-i915-dkms intel-fw-gpu

到此,安装英特尔独立显卡驱动程序所需的依赖环境已配置完毕!
安装英特尔锐炫独立显卡的驱动程序
第一步,使用命令安装英特尔锐炫独立显卡的驱动程序:
sudo apt-get 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

安装好后,重启电脑。
第二步,为了访问 GPU 功能,用户需要拥有正确的权限,先列出有权限的组
stat -c "%G" /dev/dri/render*
groups ${USER}
若列出的render 节点中没有user,请添加
sudo gpasswd -a ${USER} render
newgrp render

第三步,验证安装:
验证设备是否与 i915 驱动程序配合使用
sudo apt-get install hwinfo
hwinfo --display

验证媒体驱动程序安装
export DISPLAY=:0.0
sudo apt-get install vainfo
vainfo


验证计算驱动程序安装
sudo apt-get install clinfo
clinfo

验证3D驱动程序安装:
sudo apt-get install mesa-utils
glxinfo |grep OpenGL

到此,在ubuntu22.04上安装英特尔锐炫独立显卡驱动程序已成功,点开about窗口,可以看到Graphics是A750,如下图所示

参考:https://dgpu-docs.intel.com/installation-guides/ubuntu/ubuntu-jammy-arc.html
网友评论