Install Ubuntu 22.04.4 LTS on Asus Zenbook S13 OLED

Winston Ma
3 min readJan 27, 2023

--

Recently I brought an Asus Zenbook S13 OLED, using AMD Ryzen™ 7 6800U. I would like to use Ubuntu as my major OS. Due to the limited AMD driver support in the linux kernel. I faced several major issues and I would like to share this.

Preparation

Here is the checklist:

  • The below video would cover the procedures to create a Ubuntu installation USB drive and partition the harddisk.
  • Go to BIOS and disable secured boot

The installation process should be smooth.

After installation

Install AMD video driver (Optional)

Please follow this instruction if you need to run PyTorch related Machine Learning code.

The script below would create a kernel module and the building process (not the module, the module would work on all kernel) works with the default kernel that comes with Ubuntu:

# Install AMD Driver
TEMP_FOLDER="/tmp"
TEMP_DRIVER_HTML="amd-driver.html"
DISTRO_CODENAME=$(lsb_release --codename --short)

# Find the package URL from AMD website
AMD_DRIVER_URL="https://www.amd.com/en/support/linux-drivers"
URL_RESPONSE=$(wget -U 'Mozilla/5.0' -qO- ${AMD_DRIVER_URL})
AMD_DEB_URL=$(echo $URL_RESPONSE | grep -o 'https://[^ "<]*.deb' | grep $DISTRO_CODENAME | head -1)
FILENAME=$(basename $AMD_DEB_URL)

# Download and install the driver package
wget -P $TEMP_FOLDER $AMD_DEB_URL
sudo dpkg -i $TEMP_FOLDER/$FILENAME
rm $TEMP_FOLDER/$FILENAME

amdgpu-install -y --usecase=rocm

For more detail please visit AMD Quick-start install guide.

Update Kernel

The default kernel for Ubuntu 22.04.4 is v6.5, which uses P-State EPP default. It already makes the AMD system more battery friendly.

However if you still want to use the latest kernel. The following guide shows how to install kernel 6.7+ on Ubuntu 22.04. Please choose one of the options, open the terminal and type the following command:

Option 1 (Use Zabbly, preferred):

# Install the GPG Key
sudo mkdir -p /etc/apt/keyrings
sudo wget -O - https://pkgs.zabbly.com/key.asc | sudo tee /etc/apt/keyrings/zabbly.asc

# Set up the source repository
sh -c 'cat <<EOF > /etc/apt/sources.list.d/zabbly-kernel-stable.sources
Enabled: yes
Types: deb deb-src
URIs: https://pkgs.zabbly.com/kernel/stable
Suites: $(. /etc/os-release && echo ${VERSION_CODENAME})
Components: main
Architectures: $(dpkg --print-architecture)
Signed-By: /etc/apt/keyrings/zabbly.asc

EOF'

# Install latest kernel
sudo apt update
sudo apt install linux-zabbly

Option 2 (Use Mainline):

# Install mainline
sudo add-apt-repository ppa:cappelikan/ppa
sudo apt install -y mainline

# Install latest kernel
mainline install-latest
sudo apt --fix-broken install

After the kernel is installed, reboot the system.

Sound Issue

The sound issue is fixed after updating the BIOS to v311. Please use the following command to check your BIOS version:

sudo dmidecode | grep -P '^(?=.*UM5302)(?=.*Version)'

Please go to Asus Support Page to download the latest firmware.

Low Volume Issue

The low volume issue is due to missing firmware. Use the following command to

cd /tmp
git clone https://gitlab.com/asus-linux/firmware
sudo chown -R root:root firmware/
cd firmware
sudo cp -P cirrus/*.wmfw /lib/firmware/cirrus/

After the reboot the audio volume would restore

VA-API (Video Acceleration API) Related Issue

After installing the drivers, there are several steps to make sure that Google Chrome and VLC use VA-API when playing video.

Install Flatpak

Snap app are generally slow startup and limited GPU support. Thus I would install all my application from flatpak. Please follow Ubuntu Quick Setup guide to install flatpak.

# Install Flatpak
sudo add-apt-repository ppa:flatpak/stable
sudo apt update
sudo apt install flatpak

# Install the Software Flatpak plugin
sudo apt install gnome-software-plugin-flatpak

# Add the Flathub repository
flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo

MPV media player

I installed MPV media player and it seems support AV1 Hardware Decoding:

# Add MPV repository
sudo add-apt-repository ppa:ubuntuhandbook1/mpv
sudo apt update
# Install/Upgrade MPV
sudo apt install mpv

Enable Battery Charging Limit

I found that using tlp would make life much easier. Run the following script

# Install tlp
sudo apt install tlp
# Set the battery start charging and stop charging value to 60 percent
sudo tlp setcharge 60 60 BATT
# Enable TLP service
systemctl enable tlp.service
# Apply setting
sudo tlp start
# Check setting
sudo tlp-stat -b

If you want to set the charging limit in a permanent basis, then you can install tlpui from flatpak.

I guess this wrap up all the painful experience setting up Ubuntu on my device. Hope I can ease yours.

--

--