---
# System prepended metadata

title: '# ubuntu mainline kernel 6.2.14+'

---

## 1. Install Ubuntu 22.04 ISO

## 2. dgpu-docs.intel.com

```
sudo apt update
sudo apt install wget gpg

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
sudo apt-get update

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 vainfo hwinfo clinfo
  
reboot
```

### Below step are optional
```
sudo apt-get install -y \
  libigc-dev intel-igc-cm libigdfcl-dev libigfxcmrt-dev level-zero-dev
```

## 3. Install MOK (need to enroll MOK in bios) This step is optional!

```
sudo apt install fwts
git clone https://github.com/berglh/ubuntu-sb-kernel-signing.git
cd ubuntu-sb-kernel-signing
cd sbin
sudo bash mok-setup.sh

# sign automatically
sudo cp sbin/zz-mainline-signing /etc/kernel/postinst.d
sudo chown root:root /etc/kernel/postinst.d/zz-mainline-signing
sudo chmod u+rx /etc/kernel/postinst.d/zz-mainline-signing

# sign manually
#sudo sbsign --key "/var/lib/shim-signed/mok/MOK-Kernel.priv" --cert "/var/lib/shim-signed/mok/MOK-Kernel.pem" --output "/boot/vmlinuz-6.2.16-060216-generic" "/boot/vmlinuz-6.2.16-060216-generic"

# Verify the image is signed correctly
#sudo sbverify --list /boot/vmlinuz-6.2.16-060216-generic
```

## 4. Install mainline kernel

```
wget https://raw.githubusercontent.com/pimlie/ubuntu-mainline-kernel.sh/master/ubuntu-mainline-kernel.sh

chmod +x ubuntu-mainline-kernel.sh
sudo mv ubuntu-mainline-kernel.sh /usr/local/bin
ubuntu-mainline-kernel.sh -i v6.2.16

git clone https://github.com/intel-gpu/intel-gpu-firmware.git
cd intel-gpu-firmware
sudo mkdir -p /lib/firmware/updates/i915/
sudo cp firmware/*.bin /lib/firmware/updates/i915/
```

## 5. Install docker (Optional)
 https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-22-04

```
sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
#apt-cache policy docker-ce
sudo apt install docker-ce

sudo systemctl status docker

sudo usermod -aG docker ${USER}
```



## IPEX

https://intel.github.io/intel-extension-for-pytorch/xpu/1.13.120+xpu/tutorials/installation.html
https://www.intel.com/content/www/us/en/developer/tools/oneapi/base-toolkit-download.html?operatingsystem=linux&distributions=aptpackagemanager
https://github.com/intel/intel-extension-for-pytorch/issues/287
https://itslinuxfoss.com/install-python-3-9-ubuntu-22-04/

```
root@ea5934160c5a:~# python3.9 /mnt/Downloads/collect_env.py 
/usr/local/lib/python3.9/dist-packages/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension: 
  warn(f"Failed to load image Python extension: {e}")
Collecting environment information...
PyTorch version: 1.13.0a0+git6c9b55e
PyTorch CXX11 ABI: Yes
IPEX version: 1.13.120+xpu
IPEX commit: c2a37012e
Build type: Release

OS: Ubuntu 22.04.2 LTS (x86_64)
GCC version: (Ubuntu 11.3.0-1ubuntu1~22.04.1) 11.3.0
Clang version: N/A
IGC version: 2023.1.0 (2023.1.0.20230320)
CMake version: version 3.22.1
Libc version: glibc-2.35

Python version: 3.9.17 (main, Jun  6 2023, 20:11:21)  [GCC 11.3.0] (64-bit runtime)
Python platform: Linux-6.2.8-060208-generic-x86_64-with-glibc2.35
Is XPU available: True
DPCPP runtime version: 2023.1.0
MKL version: 2023.1.0
GPU models and configuration: 
[0] _DeviceProperties(name='Intel(R) Arc(TM) A770M Graphics', platform_name='Intel(R) Level-Zero', dev_type='gpu, support_fp64=0, total_memory=15473MB, max_compute_units=512)
[1] _DeviceProperties(name='Intel(R) Graphics [0x46a6]', platform_name='Intel(R) Level-Zero', dev_type='gpu, support_fp64=0, total_memory=25326MB, max_compute_units=96)
Intel OpenCL ICD version: 23.17.26241.22
Level Zero version: 1.3.26241.22

CPU:
Architecture:                    x86_64
CPU op-mode(s):                  32-bit, 64-bit
Address sizes:                   39 bits physical, 48 bits virtual
Byte Order:                      Little Endian
CPU(s):                          20
On-line CPU(s) list:             0-19
Vendor ID:                       GenuineIntel
Model name:                      12th Gen Intel(R) Core(TM) i7-12700H
CPU family:                      6
Model:                           154
Thread(s) per core:              2
Core(s) per socket:              14
Socket(s):                       1
Stepping:                        3
CPU max MHz:                     4700.0000
CPU min MHz:                     400.0000
BogoMIPS:                        5376.00
Flags:                           fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb intel_pt sha_ni xsaveopt xsavec xgetbv1 xsaves split_lock_detect avx_vnni dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp hwp_pkg_req hfi umip pku ospke waitpkg gfni vaes vpclmulqdq rdpid movdiri movdir64b fsrm md_clear serialize arch_lbr ibt flush_l1d arch_capabilities
Virtualization:                  VT-x
L1d cache:                       544 KiB (14 instances)
L1i cache:                       704 KiB (14 instances)
L2 cache:                        11.5 MiB (8 instances)
L3 cache:                        24 MiB (1 instance)
NUMA node(s):                    1
NUMA node0 CPU(s):               0-19
Vulnerability Itlb multihit:     Not affected
Vulnerability L1tf:              Not affected
Vulnerability Mds:               Not affected
Vulnerability Meltdown:          Not affected
Vulnerability Mmio stale data:   Not affected
Vulnerability Retbleed:          Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:        Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:        Mitigation; Enhanced IBRS, IBPB conditional, RSB filling, PBRSB-eIBRS SW sequence
Vulnerability Srbds:             Not affected
Vulnerability Tsx async abort:   Not affected

Versions of relevant libraries:
[pip3] intel-extension-for-pytorch==1.13.120+xpu
[pip3] numpy==1.25.0
[pip3] torch==1.13.0a0+git6c9b55e
[pip3] torchvision==0.14.1a0+5e8e2f1
[conda] N/A
root@ea5934160c5a:~# history 
    1  apt update
    2  wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \ | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
    3  apt install wget gpg
    4  wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \ | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
    5  wget -O -  https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \ | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
    6  wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
    7  cho "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
    8  echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
    9  apt update
   10  apt install intel-basekit
   11  source ../oneapi/setvars.sh 
   12  sycl-ls
   13  cd /mnt/Downloads/
   14  python3 collect_env.py 
   15  dpkg -l | grep ii | grep intel
   16  dpkg -l | grep ii | grep intel | grep -v oneapi
   17  cd neo/
   18  ls
   19  dpkg -i *.deb
   20  cd ../
   21  python3 collect_env.py 
   22  cd /mnt/Downloads/2023.1-linux-hotfix
   23  ls
   24  bash installpatch.sh 
   25  apt install software-properties-common
   26  add-apt-repository ppa:deadsnakes/ppa
   27  pt install python3.9 -y
   28  apt install python3.9 -y
   29  python3.9 --version
   30  python3.9 -m pip install torch==1.13.0a0+git6c9b55e torchvision==0.14.1a0 intel_extension_for_pytorch==1.13.120+xpu -f https://developer.intel.com/ipex-whl-stable-xpu
   31  apt install python3.9-pip python3.9-dev
   32  python3 -m pip install torch==1.13.0a0+git6c9b55e torchvision==0.14.1a0 intel_extension_for_pytorch==1.13.120+xpu -f https://developer.intel.com/ipex-whl-stable-xpu
   33  cd ../
   34  ls
   35  cd ipex_1.13.10/
   36  ls
   37  python3 -m pip install torch==1.13.0a0+git6c9b55e torchvision==0.14.1a0 intel_extension_for_pytorch==1.13.120+xpu -f https://developer.intel.com/ipex-whl-stable-xpu
   38  cd 
   39  python3 /mnt/Downloads/collect_env.py 
   40  python3.9 /mnt/Downloads/collect_env.py 
   41  python3.9
   42  apt install python3.9
   43  apt install python3.9*
   44  python3.9 -m pip install torch==1.13.0a0+git6c9b55e torchvision==0.14.1a0 intel_extension_for_pytorch==1.13.120+xpu -f https://developer.intel.com/ipex-whl-stable-xpu
   45  python3.9 /mnt/Downloads/collect_env.py 
   46  sycl-ls
   47  dpkg -l | grep ii | grep zero
   48  apt install level-zero-dev
   49  get -qO - https://repositories.intel.com/graphics/intel-graphics.key |   sudo gpg --dearmor --output /usr/share/keyrings/intel-graphics.gpg
   50  wget -qO - https://repositories.intel.com/graphics/intel-graphics.key |   sudo gpg --dearmor --output /usr/share/keyrings/intel-graphics.gpg
   51  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
   52  apt update
   53  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 vainfo hwinfo clinfo
   54  python3.9 /mnt/Downloads/collect_env.py 
   55  history 

```