Skip to content

Instantly share code, notes, and snippets.

@xn3cr0nx
Forked from vijay-prema/ubuntu-on-asus-g14.md
Created December 16, 2021 11:23
Show Gist options
  • Select an option

  • Save xn3cr0nx/1ffc5aa8188367a3ef877a1f6877a9bb to your computer and use it in GitHub Desktop.

Select an option

Save xn3cr0nx/1ffc5aa8188367a3ef877a1f6877a9bb to your computer and use it in GitHub Desktop.
Ubuntu on Asus ROG Zephyrus G14 2021

Ubuntu on Asus ROG Zephyrus G14 2021 (Setup guide)

Here is a way to do a robust install of Ubuntu (+ optional Windows 11 dual boot and LUKS encryption) on an Asus laptop, with minimal usable hardware support, without a significant amount of tinkering that may break in future or require frequent technical attention.

Specs:

  • AMD R7 5800 8 core 16 thread (onboard Radeon graphics)
  • NVIDIA RTX 3050 4GB (60W +15W boost)
  • 40GB RAM (8GB soldered + 32GB stick)
  • 2TB SSD
  • 14inch 1920x1080 Display @144Hz
  • Mediatek Wifi 6 card

OS Install:

  • Recommend disable secure boot (in BIOS) if you dont care about secure boot and would rather have freedom to install any unsigned kernel in future (recommended if you want unsigned Kernel 5.15+ with all the features working).
  • Optionally dual boot: first install Windows 11 (you may need a USB ethernet/wifi dongle during install as Windows may not have the wifi driver) from the prepared USB stick (turn off bitlocker for now), and resize its partition to say 1/4 the disk or so
  1. Get Ubuntu 21.10 ISO burned onto a USB stick (e.g. using Balena Etcher). Could also use Kubuntu or other flavours.
  2. Boot into the USB stick (repeatedly tap ESC during power on)
  3. Its best to make sure you have an internet connection during install. If the built in wifi is not detected, get a USB wifi/ethernet dongle.
  4. Start Ubuntu installer, I prefer minimal bloat install, and install all 3rd party/proprietary software.
  5. If you want full disk encryption (LUKS), choose "something else" for partitions, and make a 1GB EXT4 partition mounted as /boot and the rest of the drive a container for encryption, then mount the contained EXT4 as /. DONT forget your encryption password!
  6. Finish installation of Ubuntu and reboot.

Software Setup:

  1. Install asusctl v3.7.2 (4.0+ version doesnt work without kernel patches and other dependencies which are hard to install on Ubuntu currently). The Ubuntu repository has been deleted so dont follow those instructions, you can just manually install it from source (requires Rust to be installed) instead and then reboot:
    sudo apt install libclang-dev libudev-dev
    git clone -b 3.7.2 https://gitlab.com/asus-linux/asusctl.git
    cd asusctl
    make
    sudo make install
  1. Install asusctl-gex gnome extension using the 3.7.2 package OR my fork which adds a battery charge limit slider 3.7.3 package (Again, 4.0+ version doesnt work without kernel patches)
  2. Install an up to date pipewire version and bluetooth audio support
sudo add-apt-repository ppa:pipewire-debian/pipewire-upstream
sudo apt install pipewire
sudo apt install libspa-0.2-bluetooth
  1. Make sure recommended Ubuntu NVIDIA driver is installed (use "Additional Drivers" tool). I would recommend installing nvidia-dkms as well which will enable the driver for 3rd party kernels you might install in future sudo apt install nvidia-dkms-470 (replace 470 with whatever NVIDIA driver version you have installed)
  2. Reboot
  3. Enable the asusctl-gex extension in "Gnome Extensions" tool

Quirks:

  • Errors while updating PPAs: you may need to switch some repos distro branch from impish to hirsute (or even focal if there is no hirsute) because impish (Ubuntu 21.10) is too new. Do this in the "Software & Updates" app under the Other Software tab. At some point most of these PPAs will catch up and you can change it back to impish.
  • Wayland: The default login session for Ubuntu 21.10 is Wayland (rather than Xorg). It provides a smoother and more secure experience but has compatibility issues with some software (e.g. blank screen sharing in Discord):
    • To run an application with NVIDIA GPU in Wayland, you should right click on its icon and choose "Launch using Dedicated Graphics Card", for example Steam games (For Xorg graphics switching, just use the "Nvidia X Server" tool). Use nvtop to check what apps are using NVIDIA, or radeontop to check if AMD graphics is being used.
    • Worst case you can still log in as Xorg by clicking on the gear button bottom right before you press enter to login.
  • Power/fans: The fan profiles on the current version are not great but are being worked in in future versions. For now I run mainly on "silent" profile in asusctl, which just disables turbo.
  • Keyboard LEDs flashing during sleep mode: to stop them type asusctl led-mode -s false
  • Built in microphone can be very noisy unless you turn its volume down to about 10-15%
  • Mute Microphone key. There is a simple hack to get this to work.
  • Battery maintenance: You can keep the battery in better condition when you use the laptop mostly plugged in, by only charging to 60%: asusctl -c 60.
  • Disable boot up sound effect - this can be disabled in the bios (tap ESC during power on) or run: asusctl bios -p false
  • Improve power efficiency of NVIDIA card: sudo sh -c 'echo \'options nvidia "NVreg_DynamicPowerManagement=0x02"\' > /etc/modprobe.d/nvidia.conf' Then reboot.
  • Firefox acting strange (no WebGL, drag and drop issues, Gnome extensions connection fail): Probably the Snap version got installed. Run: snap remove firefox and sudo apt install firefox. In general avoid installing applications via Snap, instead firstly try, in this order of preference:
    • Ubuntu repositories (unless outdated, run apt-cache show [package] to check available version)
    • A trusted PPA
    • Flatpak (flathub)
    • Home brew
    • deb file (if issues with flatpak version)
  • Firefox high CPU usage especially when playing youtube videos (e.g. 4k 60p video): Enable video acceleration.
    • sudo apt install mesa-va-drivers
    • Open Firefox and go to about:config in url bar. Then search for following keys, enable or disable them one by one:
      • media.ffmpeg.vaapi.enabled set to true
      • media.ffvpx.enabled set to false.
      • media.rdd-vpx.enabled set to false.
      • media.navigator.mediadatadecoder_vpx_enabled set to true.
      • If you experience page crashes, try setting security.sandbox.content.level to 0.
  • Google Chrome high CPU usage especially when playing youtube videos (e.g. 4k 60p video): Enable video acceleration. Suggest also enabling these flags in the chrome://flags page:
    • #ignore-gpu-blocklist
    • #enable-gpu-rasterization
    • #enable-zero-copy
    • #enable-vulkan (warning buggy, disable again if issues)
    • #canvas-oop-rasterization
  • Suspend/sleep In kernel 5.13 this has unpredictable behaviour and is not recommended. Sometimes it might just work. Other times it appears to work but fails to resume. This is being worked on and is mainly fixed in kernel 5.15 so you can either upgrade to that or instead enabling hibernate which is more reliable and survives battery failure, but slower to enter/resume. To do that, first make sure swap file at least as large as RAM (e.g. I used 50GB for my 40GB RAM bs=1G count=50) and then enable hibernate. If you would like both Suspend and Hibernate to work nicely, then you can try installing Xanmod Kernel 5.15 (also run sudo apt install nvidia-dkms-470 to enable NVIDIA GPU for non-Ubuntu kernels). You might also want to disable keyboard LED pulse during sleep asusctl led-mode -s false

Non-functioning and Semi-issues:

  • Fingerprint reader. There are people working on this and making progress but it is very rudamentary. The real issue is even if they get it woring perfectly, this device cant work with multiple OS on the same system with dual boot, as each OS will try to install its own keys on the device causing conflict.
  • Mediatek Wifi/BT The 2021 model comes with a Mediatek wifi chip which sucks (dropouts and crashes requiring fully powering off the device for minutes), even in Windows 11, and the Bluetooth doesn't work in Linux. Replace it with an Intel AX200. If after replacing it with Intel AX your wifi device disappears from Linux at some point, try a hard power off and reboot into Linux (by holding power button until shut down, while on battery). You can also check for errors in Intel wifi using sudo dmesg | grep iwl.

Future...

There are some guys at Asus Linux doing some great work to improve Linux support on these exceptional laptops. They work primarily on Arch so it not recommended to install their latest work on a production Ubuntu system which has older packages. In future, we may see these features supported in Ubuntu with future kernel updates, and asusctl-gex will provide additional functionality. You can join their Discord to be involved.

Links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment