ROG Zephyrus G14 (2022) GA402

From Gentoo Wiki
Jump to:navigation Jump to:search

The Asus Republic of Gamers (ROG) Zephyrus G14 (2022) GA402 is an AMD Advantage gaming laptop.[1] It features Asus' AniMe Matrix and vapor chamber cooling plus AMD's Smartshift[2] and Smart Access Memory[3] technologies. Depending on the model (GA402RJ or GA402RK), it has either the 6700S[4] or 6800S[5] Navi 23[6] dGPU. It has a 1440p 16:10 120 Hz display and has been shown to operate with 40 GB of DDR5 memory.

Hardware

Note
On vendor IDs — 1002 is ATI, 1022 is AMD.[7][8]


Standard

Table

Device Make/model Vendor ID / Product ID Status Kernel driver(s) Kernel version Notes
APU AMD Ryzen 9 6900HS with Radeon Graphics[9][10][11] Model: 25.68.1. Part No: 100-000000544, 100-000000560. Works amdgpu 6.13.1 Zen 3+ CPU, codename Rembrandt-H, AMD Radeon 680M iGPU. The 680M requires Yellow Carp[12][13][14] firmware, see below. The 6.12.1+ kernel is affected by a known bug which causes screen flickering,[15][16][17] especially when scrolling, but it can be tolerated. This issue is fixed since 6.12.11.
dGPU AMD Navi 23 [Radeon RX 6650 XT / 6700S / 6800S] (rev c2) 1002:73ef[18] Works amdgpu[19] 6.13.1 RDNA 2.0, requires Dimgrey Cavefish[20] firmware (see below) and Mesa 20.3 or later.[21]
Host bridge Advanced Micro Devices, Inc. [AMD] Family 17h-19h PCIe Root Complex (rev 01) 1022:14b5 Works N/A 6.13.1
IOMMU Advanced Micro Devices, Inc. [AMD] Family 17h-19h IOMMU 1022:14b6 Works N/A 6.13.1
Host bridge Advanced Micro Devices, Inc. [AMD] Family 17h-19h PCIe Dummy Host Bridge (rev 01) 1022:14b7 Works N/A 6.13.1
PCI bridge Advanced Micro Devices, Inc. [AMD] Device 14b8 (prog-if 00 [Normal decode]) 1022:14b8 Works pcieport 6.13.1 Subsystem: ASUSTeK Computer Inc. Device 1d42
Host bridge Advanced Micro Devices, Inc. [AMD] Family 17h-19h PCIe Dummy Host Bridge (rev 01) 1022:14b7 Works N/A 6.13.1
PCI bridge Advanced Micro Devices, Inc. [AMD] Family 17h-19h PCIe GPP Bridge (prog-if 00 [Normal decode]) 1022:14ba Works pcieport 6.13.1 IOMMU groups 3-5
Host bridge Advanced Micro Devices, Inc. [AMD] Family 17h-19h PCIe Dummy Host Bridge (rev 01) 1022:14b7 Works N/A 6.13.1 IOMMU group 6-8
PCI bridge Advanced Micro Devices, Inc. [AMD] Family 17h-19h Internal PCIe GPP Bridge (rev 10) (prog-if 00 [Normal decode]) 1022:14b9 Works pcieport 6.13.1 IOMMU groups 9-10
SMBus Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller (rev 71) 1022:790b Works piix4_smbus 6.13.1 66 MHz
ISA Bridge Advanced Micro Devices, Inc. [AMD] FCH LPC Bridge (rev 51) 1022:790e Works N/A 6.13.1 66 MHz
Host bridge Advanced Micro Devices, Inc. [AMD] Rembrandt Data Fabric: Device 18h; Functions 0-7 1022:1679 - 1022:1680 Works k10temp 6.13.1 IOMMU group 12. Kernel driver used by Function 3.
PCI bridge Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 XL Upstream Port of PCI Express Switch (rev c2) (prog-if 00 [Normal decode]) 1002:1478[22] Works pcieport 6.13.1
PCI bridge Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 XL Downstream Port of PCI Express Switch (prog-if 00 [Normal decode]) 1002:1479[23] Works pcieport 6.13.1
Audio device Advanced Micro Devices, Inc. [AMD/ATI] Navi 21/23 HDMI/DP Audio Controller 1002:ab28 Works snd_hda_intel 6.13.1
SD Host controller O2 Micro, Inc. SD/MMC Card Reader Controller (rev 01) (prog-if 01) 1217:8520 Works sdhci-pci 6.13.1
Network controller MEDIATEK Corp. MT7922 802.11ax PCI Express Wireless Network Adapter 14c3:7922 Works mt7921e 6.13.1 In the past, it occasionally failed to work and a reboot or power off/on was required. This doesn't seem to occur any more since perhaps around the time of the 6.8 kernels.
Non-Volatile memory controller Samsung Electronics Co Ltd NVMe SSD Controller PM9A1/PM9A3/980PRO (prog-if 02 [NVM Express]) 144d:a80a Works nvme 6.13.1 2 TB drives work fine.
VGA compatible controller Advanced Micro Devices, Inc. [AMD/ATI] Rembrandt [Radeon 680M] (rev c7) (prog-if 00 [VGA controller]) 1002:1681 Works amdgpu 6.13.1 See APU section above.
Audio device Advanced Micro Devices, Inc. [AMD/ATI] Rembrandt Radeon High Definition Audio Controller 1002:1640 Works snd_hda_intel 6.13.1
Encryption controller Advanced Micro Devices, Inc. Advanced Micro Devices, Inc. [AMD] VanGogh PSP/CCP 1022:1649 Tested ccp 6.13.1 AMD's fTPM RNG has the infamous sporadic stutter issue.[24][25][26]
USB controller Advanced Micro Devices, Inc. [AMD] Rembrandt USB4 XHCI controller #3, #4, #5, #6, #8 (prog-if 30 [XHCI]) 1022:161d - 1022:161f, 1022:15d6 - 1022:15d7 Tested xhci_hcd 6.13.1 USB 4 does not work despite the hardware support because Asus has not updated the BIOS for it yet. A beta BIOS is available for those interested.[27] USB 3 is fine.
Multimedia controller Advanced Micro Devices, Inc. [AMD] ACP/ACP3X/ACP6x Audio Coprocessor (rev 60) 1022:15e2 Works snd_pci_acp6x 6.13.1
Audio device Advanced Micro Devices, Inc. [AMD] Family 17h/19h HD Audio Controller 1022:15e3 Works snd_hda_intel 6.13.1
Webcam IMC Networks 13d3:56eb[28] Works xhci_hcd/3p, uvcvideo 6.13.1 720p
Touchpad ASUE120A:00[29] 04F3:319B Works i2c_hid, usbhid 6.13.1 Add libinput and synaptics to INPUT_DEVICES, see package.use below.

lscpu

root #lscpu


AMD virtualisation flags
Abbreviation Name Description Notes
decodeassists Decode assists
flushbyasid Flush-by-ASID (Address-space identifiers[30])
lbrv LBR (Last branch record) virtualization
npt Nested page tables
nrip_save SVM (Secure virtualization machine) next_rip save
pausefilter Filtered pause intercept
pfthreshold Pause filter threshold
svm_lock SVM locking MSR
tsc_scale TSC (Timestamp-counter) scaling
vmcb_clean VMCB clean bits

lspci

root #lspci -k -n -vvv

lsusb

root #lsusb -v -t

Ports

The laptop has 2 USB-C ports. The one on the left outputs from the iGPU and the one on the right outputs from the dGPU. The one on the left can also be used to power the laptop. The HDMI port on the left outputs from the dGPU.[31] There are 2 USB-A 3.2 ports and a MicroSD card slot on the right[32] plus a 3.5 mm audio jack on the left.

Accessories

Device Make/model Vendor ID / Product ID Status Kernel driver(s) Kernel version Notes
RAM Vengeance DDR5 SODIMM 32GB (1x32GB) DDR5 4800 (PC5-38400) C40 1.1 V[33] CMSX32GX5M1A4800C40 Works N/A 6.13.1
USB-C Cable Anker 765 (140W Nylon)[34] N/A Works N/A 6.13.1
USB-C Hub Anker 565[35] 0b95:1790[36], 2537:1081[37], 2109:0822[38], 14cd:8601[39], 2109:2822[40] Tested sdhci 6.13.1 Trying to output to 2 monitors simultaneously may not work. 1 monitor should work fine, including when the laptop's HDMI port is connected to an external monitor.
USB Power Adaptor Anker 737 Charger (GaNPrime 120W)[41] N/A Works N/A 6.13.1 Works well with the cable listed above for USB-C power delivery.

Installation

00cpu-flags

FILE /etc/portage/package.use/00cpu-flags
*/* CPU_FLAGS_X86: aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sha sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3

make.conf

FILE /etc/portage/make.conf
# Go
GOAMD64="v3"
# Grub
GRUB_PLATFORMS="efi-64"

package.license

FILE /etc/portage/package.license
sys-kernel/linux-firmware @BINARY-REDISTRIBUTABLE

package.use

radeon does not need to be globally added to VIDEO_CARDS, only to x11-libs/libdrm if that is installed.

FILE /etc/portage/package.use/package.use
*/* INPUT_DEVICES:        -* libinput synaptics
*/* VIDEO_CARDS:          -* amdgpu radeonsi

media-libs/mesa           gles2 vaapi vdpau vulkan wayland
media-video/libva-utils   vainfo
sys-apps/fwupd            -dell nvme spi synaptics tpm uefi
x11-libs/libdrm           video_cards_radeon

Kernel

Important
Kernel 6.7.5 does not boot, hanging between the ALSA device list and Freeing unused kernel image (initmem) memory steps.
Important
With kernels 6.10.4-6.10.8, connecting an external display freezes the system. 6.10.10+ is okay.
Important
With kernels 6.10.11-6.12.8, about 1/4 of the time, the system freezes upon boot. 6.12.11 seems to have corrected the issue.
Note
For AMD_MEM_ENCRYPT to become visible, set EFI_STUB=y.
Note
Setting KVM=y can cause issues with VirtualBox in 6.12+.[42][43]
KERNEL make menuconfig
[*] 64-bit kernel
    Processor type and features  --->
        [*] AMD ACPI2Platform devices support
            Processor family (AMD-Native optimizations autodetected by the compiler)
        [*] Supported processor vendors  --->
                [ ] Support Intel processors
                [*] Support AMD processors
        [*] Old AMD GART IOMMU support
        [*] Machine Check / overheating reporting
        [ ]   Intel MCE features
        [*]   AMD MCE features
            Performance monitoring  --->
                <*> Intel/AMD rapl performance events
                <*> AMD Processor Power Reporting Mechanism
                <*> AMD Uncore performance events
                [*] AMD Zen3 Branch Sampling support
        [*] AMD Secure Memory Encryption (SME) support
        [ ]   Activate AMD Secure Memory Encryption (SME) by default
[*] Mitigations for CPU vulnerabilities  --->
        [*] Remove the kernel mapping in user mode
        [*] Avoid speculative indirect branches in kernel
        [*]   Enable return-thunks
        [*]     Enable UNRET on kernel entry
        [*] Enable IBPB on kernel entry
        [*] Mitigate speculative RAS overflow on AMD
        [*] Mitigate Straight-Line-Speculation
        [*] Mitigate RETBleed hardware bug
        [*] Mitigate SPECTRE V1 hardware bug
        [*] Mitigate SPECTRE V2 hardware bug
        [*] Mitigate Speculative Store Bypass (SSB) hardware bug
    Power management and ACPI options --->
            CPU Frequency scaling  --->
                [*] CPU Frequency scaling --->
                    Default CPUFreq governor (performance)  --->
                -*- 'performance' governor
                <*> 'powersave' governor
                [*] AMD Processor P-State driver
                (3)   AMD Processor P-State default mode
                <M> selftest for AMD Processor P-State driver
                < >   ACPI Processor P-States driver
[*] Virtualization
        <M> KVM for AMD processors support
        [*]   AMD Secure Encrypted Virtualization (SEV) support
-*- Networking support  --->
        <*> Bluetooth subsystem support  --->
                [*] Bluetooth Classic (BR/EDR) features
                <*>   RFCOMM protocol support
                [*]   Bluetooth Low Energy (LE) features
                    Bluetooth device drivers  --->
                        <*> HCI USB driver
                        [*]   MediaTek protocol support
                        <*> MediaTek HCI SDIO driver
                        <*> MediaTek HCI UART driver
        -*- Wireless  --->
                <*> cfg80211 - wireless configuration API
                <*> Generic IEEE 802.11 Networking Stack (mac80211)
    Device Drivers  --->
        [*] PCI support  --->
                [*] PCI Express Port Bus support
                [*] PCI Express ASPM control
            NVME Support  --->
                <*> NVM Express block device
            SCSI device support  --->
                <*> SCSI disk support
        [*] Network device support  --->
                [*] Ethernet driver support  --->
                        [*] AMD devices
                [*] Wireless LAN  --->
                        [*] MediaTek devices
                        <M>   MediaTek MT7615E and MT7663E (PCIe) support
                        <*>   MediaTek MT7921E (PCIe) support
                        <*>   MediaTek MT7921S (SDIO) support 
                        <*>   MediaTek MT7921U (USB) support 
                [*] Realtek devices
                <M>   Realtek 8180/8185/8187SE PCI support
            Character devices  --->
                -*- Hardware Random Number Generator Core support  --->
                        <*> AMD HW Random Number Generator support
                -*- TPM Hardware Support  --->
                        [ ] TPM HW Random Number Generator support
        [*] SPI support  --->
                <*> AMD SPI controller
        -*- Pin controllers  --->
                [*] AMD GPIO pin control
        -*- Hardware Monitoring support  --->
                <*> AMD Family 10h+ temperature sensor
                <*> ASUS ATK0110
                <*> ASUS WMI X370/X470/B450/X399
                <*> ASUS EC Sensors
        [*] Watchdog Timer Support  --->
                <*> AMD/ATI SP5100 TCO Timer/Watchdog
            Graphics support  --->
                [*] Laptop Hybrid Graphics - GPU switching support
                <*> Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)  --->
                < > ATI Radeon
                <*> AMD GPU
                [*]   Enable amdgpu support for SI parts
                [*]   Enable amdgpu support for CIK parts
                -*-   Always enable userptr write support
                [ ]   Force the compiler to throw an error instead of a warning when compiling
                      ACP (Audio CoProcessor) Configuration  --->
                          [*] Enable AMD Audio CoProcessor IP support
                      Display Engine Configuration  --->
                          [*] AMD DC - Enable new display engine
                          [*] AMD DC support for Southern Islands ASICs 
                          [ ] Enable kgdb break in DC 
                          [*] Enable secure display support 
                [*] HSA kernel driver for AMD GPU devices
                [*]   Enable HMM-based shared virtual memory manager
                < > Nouveau (NVIDIA) cards
                < > Intel 8xx/9xx/G3x/G4x/HD Graphics
                <*> Simple framebuffer driver
                    Frame buffer Devices  --->
                        <*> Support for frame buffer devices  --->
                                <*> VGA 16-color graphics support
                                < > Userspace VESA VGA graphics support
                                [ ] VESA VGA graphics support 
                                [*] EFI-based Framebuffer Support
                    Console display driver support  --->
                        [*] Framebuffer Console support
                        [ ]   Enable legacy fbcon hardware acceleration code
        <*> Sound card support  --->
                <*> Advanced Linux Sound Architecture  --->
                        <*> ALSA for SoC audio support  --->
                                <*> AMD Audio Coprocessor support
                                <*> AMD Audio Coprocessor-v6.x Yellow Carp support
                                <*>   AMD YC support for DMIC
                                -*- AMD ACP configuration selection
                                <*> AMD Audio ACP Common support
                                <*> AMD Audio Coprocessor-v6.2 RPL support
                                <*> support for AMD platforms with ACP version >= 6.3
        [*] HID bus support  --->
                -*- HID bus core support
                <*>   Generic HID driver
                      Special HID drivers  --->
                          <*> Asus
                    AMD SFH HID Support  --->
                        <*> AMD Sensor Fusion Hub
        [*] USB support  --->
                <*> xHCI HCD (USB 3.0) support
                <*> EHCI HCD (USB 2.0) support
                <*> USB Mass Storage support
                <*> USB Type-C Support  --->
                        <*> USB Type-C Port Controller Manager
                        <*> Type-C Port Controller Interface driver
                        <*> USB Type-C Connector System Software Interface driver 
        <*> MMC/SD/SDIO card support  ---> 
                <*> Secure Digital Host Controller Interface support
                <*> MediaTek SD/MMC Card Interface support
        -*- X86 Platform Specific Device Drivers  --->
                <M> WMI support for MXM Laptop Graphics
                <*> AMD Platform Management Framework
                <*> AMD SoC PMC driver
                <*> Asus Laptop Extras
                <*> Asus Wireless Radio Control Driver
                <*> ASUS WMI Driver
                <*>   Asus Notebook WMI Driver
        [*] IOMMU Hardware Support  --->
                [*] AMD IOMMU support
        <*> Unified support for USB4 and Thunderbolt  --->
        <*> Trusted Execution Environment support  --->
                <*> AMD-TEE
    Security options  --->
        <*> TRUSTED KEYS
        [*]   TPM-based trusted keys
        [*]   TEE-based trusted keys
-*- Cryptographic API  --->
            Crypto core or helper  --->
                <*> Parallel crypto engine
            Accelerated Cryptographic Algorithms for CPU (x86)  --->
                <*> Ciphers: AES, modes: ECB, CBC, CTS, CTR, XTR, XTS, GCM (AES-NI)
                {*} CRC32c (SSE4.2/PCLMULQDQ)
        [*] Hardware crypto devices  --->
                [*] Support for AMD Secure Processor
                <*>   Secure Processor device driver
                [*]     Cryptographic Coprocessor device
                <*>       Encryption and hashing offload support
                [*]     Platform Security Processor (PSP) device

Firmware

For wifi, bluetooth, the two GPUs, microcode updates, and to eliminate the boot error messages about not finding regulatory.db, add the following firmware files:

FILE /usr/src/linux/.config
CONFIG_EXTRA_FIRMWARE="regulatory.db regulatory.db.p7s mediatek/BT_RAM_CODE_MT7922_1_1_hdr.bin mediatek/WIFI_MT7922_patch_mcu_1_1_hdr.bin mediatek/WIFI_RAM_CODE_MT7922_1.bin amd/amd_sev_fam17h_model0xh.sbin amd/amd_sev_fam17h_model3xh.sbin amd/amd_sev_fam19h_model0xh.sbin amd-ucode/microcode_amd_fam17h.bin amd-ucode/microcode_amd_fam19h.bin amdgpu/yellow_carp_asd.bin amdgpu/yellow_carp_ce.bin amdgpu/yellow_carp_dmcub.bin amdgpu/yellow_carp_me.bin amdgpu/yellow_carp_mec2.bin amdgpu/yellow_carp_mec.bin amdgpu/yellow_carp_pfp.bin amdgpu/yellow_carp_rlc.bin amdgpu/yellow_carp_sdma.bin amdgpu/yellow_carp_ta.bin amdgpu/yellow_carp_toc.bin amdgpu/yellow_carp_vcn.bin amdgpu/dimgrey_cavefish_ce.bin amdgpu/dimgrey_cavefish_dmcub.bin amdgpu/dimgrey_cavefish_me.bin amdgpu/dimgrey_cavefish_mec2.bin amdgpu/dimgrey_cavefish_mec.bin amdgpu/dimgrey_cavefish_pfp.bin amdgpu/dimgrey_cavefish_rlc.bin amdgpu/dimgrey_cavefish_sdma.bin amdgpu/dimgrey_cavefish_smc.bin amdgpu/dimgrey_cavefish_sos.bin amdgpu/dimgrey_cavefish_ta.bin amdgpu/dimgrey_cavefish_vcn.bin"
CONFIG_EXTRA_FIRMWARE_DIR="/lib/firmware"

In order for regulatory.db to be present, run:

root #emerge --ask net-wireless/wireless-regdb

Emerge

Firmware

root #emerge --ask sys-apps/fwupd sys-kernel/linux-firmware

Graphics/Mesa/Vulkan

root #emerge --ask dev-util/vulkan-tools media-video/libva-utils media-libs/mesa media-libs/vulkan-loader media-libs/vulkan-layers x11-apps/mesa-progs x11-drivers/xf86-video-amdgpu

Power

root #emerge --ask sys-power/tlp

initramfs

If using genkernel to make an initramfs, pass the option --no-ramdisk-modules. They are not needed for the system to boot successfully, and with the AMD binary blobs for the GPUs, the initramfs file will be over 200 MB otherwise. Pass other parameters as desired.

root #genkernel --install --kernel-config=/usr/src/linux/.config --no-ramdisk-modules initramfs

Configuration

AMD P-State

The AMD P-State driver should be used with this laptop.

Kernels 6.1.* and earlier

These kernels do not have the EPP modes built-in:

FILE /etc/default/grubGRUB config
GRUB_CMDLINE_LINUX_DEFAULT="amd-pstate=passive acpi_osi=Linux"

The parameter acpi_osi=Linux has no functional impact, but will change this boot message:

kernel: ACPI: [Firmware Bug]: BIOS _OSI(Linux) query ignored

to this:

kernel: ACPI: [Firmware Bug]: BIOS _OSI(Linux) query honored via cmdline.

Refer to the power management guide's section on AMD P-State for more details.

Kernels 6.5.5 and later

The variable amd-pstate=passive can be removed from the GRUB config, as the value can now be set via CONFIG_X86_AMD_PSTATE_DEFAULT_MODE (shown in the kernel config above).[44]

asusctl

OpenRC

Currently only systemd is supported upstream.[45][46] For those interested in using asusctl with OpenRC, this documents some previous efforts.

BIOS

The latest BIOS[47] version as of June 2024 is 319 and can be safely upgraded to.

Important
It is generally recommended to watch forums for user reports prior to updating as previous updates have caused issues (notably, 313[48]).

Firmware updates

Use sys-apps/fwupd and refer to its page for more details. So far, only UEFI revocation database[49] updates have been available.

Hyprland

The configuration for the built-in laptop display is:

FILE ~/.config/hypr/hyprland.confMonitor
monitor=eDP-2,2560x1600@120,auto,1

/dev/dri/card0 is the 6700S/6800S and /dev/dri/card1 is the 680M. Because the iGPU is tied to the display controller, to make Hyprland run on the dGPU, one must write

Note
The previous WLR_DRM_DEVICES environmental variable has been replaced by AQ_DRM_DEVICES[50].
FILE ~/.config/hypr/hyprland.confTo use dGPU
env = AQ_DRM_DEVICES,/dev/dri/card0:/dev/dri/card1

to set the dGPU as primary and the iGPU as secondary. If the :/dev/dri/card1 part is omitted, Hyprland will not start because there is no display. For the same reason, trying to use env = DRI_PRIME,1 will also not work.

To use the 680M and extend battery life, one would reverse the above:

FILE ~/.config/hypr/hyprland.confTo use iGPU
env = AQ_DRM_DEVICES,/dev/dri/card1:/dev/dri/card0

Function keys and hot keys

Asus has programmed several of the Fn key combinations to perform unique tasks, as shown by the pictograms on the keys. For example, Fn + F6 is meant to open a screenshot utility. The Windows-only applications which would usually instantiate this functionality like MyASUS or Armoury Crate are entirely unnecessary for replication of similar behaviour on Linux, though the means of implementation will vary with one's desktop environment or window manager.

Depending on whether the current environment is X11 or Wayland, either xev[51] (available at x11-apps/xev) or wev[52] (available in GURU) can be used to reveal the keysym[53][54] input which occurs after pressing a physical key. Usually there is a clear 1-1 correspondence, but for this laptop, there are some non-obvious ones:

Physical key input Keysym input Keycode input Notes
Fn + Meta none none Meta is the Windows key, or SUPER in a Hyprland config. This key combo disables or enables the meta key. No keysym input occurs in either case.
Fn + F4 XF86Launch3 202 Intended to toggle the "Aura lighting effect"
Fn + F5 XF86Launch4 203 Meant for switching between fan modes
Fn + F6 Super_L + Shift_L + S 125 + 42 + 31 Super_L is the left CTRL key.
Fn + F9 Super_L + p 125 + 25 Meant for switching between "display modes" when external displays are connected.
Fn + F10 XF86TouchpadToggle 191 Enable or disable the touchpad
Fn + Super_L Return + Menu 127 This key combo is equivalent to right-clicking.
M4 XF86Launch1 148 Meant to open the Armoury Crate application.

The command showkey[55] can be used to get the keycodes. The user manual lists what Asus intended for these keys on page 43.

Keyboard brightness

Install app-misc/brightnessctl from GURU. Then add the following lines:

FILE ~/.config/hypr/hyprland.confKeyboard brightness keybinds
bind=, XF86KbdBrightnessUp, exec, brightnessctl --device='asus::kbd_backlight' set +1
bind=, XF86KbdBrightnessDown, exec, brightnessctl --device='asus::kbd_backlight' set 1-

Screenshots

Install gui-apps/grim. Then add the following line to use the Fn + F6 combination mentioned above:

FILE ~/.config/hypr/hyprland.confScreenshots with Asus F6 key
bind= Super_L Shift_L, S, exec, grim -g "$(slurp && sleep 0.5)"

KDE Wayland

Note
The variable WLR_DRM_DEVICES doesn't work to set the dGPU as primary under KDE.

KWIN_COMPOSE=O2ES[56] may be necessary to eliminate graphical glitches. Firefox doesn't work well with DRI_PRIME=1 in this case.

TLP

Here are TLP[57] settings that work well for performance on AC, maximizing battery life on battery, and limiting battery charge to 90% to extend battery life. 90% works fine despite the boot warning message about Asus laptops potentially not respecting it. These settings are based on a kernel with the P-State EPP driver (not the 6.1.* kernels) and TLP ≥ 1.6.0.

FILE /etc/tlp.conf
TLP_ENABLE=1

CPU_DRIVER_OPMODE_ON_AC=active
CPU_DRIVER_OPMODE_ON_BAT=active

CPU_SCALING_GOVERNOR_ON_AC=powersave
CPU_SCALING_GOVERNOR_ON_BAT=powersave

CPU_ENERGY_PERF_POLICY_ON_AC=balance_performance
CPU_ENERGY_PERF_POLICY_ON_BAT=balance_power

CPU_BOOST_ON_AC=1
CPU_BOOST_ON_BAT=0

PLATFORM_PROFILE_ON_AC=balanced
PLATFORM_PROFILE_ON_BAT=quiet

RADEON_DPM_STATE_ON_AC=performance
RADEON_DPM_STATE_ON_BAT=battery

RADEON_POWER_PROFILE_ON_AC=default
RADEON_POWER_PROFILE_ON_BAT=default

PCIE_ASPM_ON_BAT=powersupersave

USB_EXCLUDE_PHONE=1

STOP_CHARGE_THRESH_BAT0=90

Troubleshooting

680M freezes

There is a known issue, perhaps related to DPMS, which may cause the system to freeze in a way that requires forcibly powering it off.[58] Investigation into a final solution is still ongoing. The link contains a long discussion of attempts to fix or reduce the occurrence of the issue for those interested.

Warning
A recent instance of this issue which seemed to occur simultaneously with attempting to put the laptop to sleep caused a root btrfs file system to become unrecoverable (bad tree block start, open_ctree failed, checksum verify failed, etc.[59][60][61]) Consider using ext4.

ccp_crypto: cannot load

If the message ccp_crypto: Cannot load: there are no available CCPs appears in the boot log, it is because Encryption and hashing offload support (CRYPTO_DEV_CCP_CRYPTO) was built into the kernel ([*]) rather than set as a module ([m]). Set it to module (shown in the kernel config section above), and the message should not appear after rebooting.

fTPM RNG stutters

See the "Encryption controller" row in the hardware table for references, and ensure that TPM HW Random Number Generator support is disabled as shown in the kernel configuration above.

Machine learning

Despite not being officially supported by ROCm[62], the 6700S/6800S can be used with PyTorch or Tensorflow. Set the environmental variable HSA_OVERRIDE_GFX_VERSION=10.3.0 to spoof the gfx1030 group of cards.[63] It can be prepended to terminal commands (e.g. HSA_OVERRIDE_GFX_VERSION=10.3.0 jupyter-notebook) or placed in a file like /etc/environment or a Hyprland config file:

FILE /etc/environment
HSA_OVERRIDE_GFX_VERSION=10.3.0
FILE ~/.config/hypr/hyprland.conf
env = HSA_OVERRIDE_GFX_VERSION,10.3.0

A list of currently available AMDGPU_TARGETS can be seen on the pages for packages like sci-libs/rocRAND. This variable can be set in package.use as follows:

FILE /etc/portage/package.use/package.use
*/* AMDGPU_TARGETS: -* gfx1030 gfx1031 gfx1032 gfx1033 gfx1034 gfx1035

Only gfx1030 and gfx1031 are currently in place. gfx1032 is the 6700S[64] and gfx1035 is the 680M.[65]

Mesa 23.1 crashes

Mesa (media-libs/mesa) 23.1.3 causes VA-API-related crashes when using the radeonsi driver on this laptop (e.g., when playing YouTube videos on Firefox).[66] 23.0.3-r1 and ≥ 23.1.5 do not have this issue.

rocminfo

Version 5.4.3 of dev-util/rocminfo works as expected. Newer 5.* versions gave this error:

user $rocminfo
ROCk module is NOT loaded, possibly no GPU devices

6.* versions work fine.

Suspend

It used to be that this laptop could be put to sleep and woken back up, but the fans would not spin after waking and a reboot was needed to get them back. This has happily been recently fixed[67][68][69] and is no longer an issue as of the 6.1.41 kernel. The following command can be used to suspend from the terminal:

root #systemctl suspend

Running it as a normal user will result in a reboot.

Notes

The "Header and Data" data under "Handle 0x0009, DMI type 44" was removed, along with serial numbers and OEM Strings.

Benchmarks

Some benchmarks of the 6700S dGPU are available here.

6900HS

Some generic 6900HS benchmarks are available.

Compiling
Note
This is with --jobs=14 and --load-average=9 in make.conf.

Firefox with jumbo-build, lto, and pgo.

root #qlop -a firefox
www-client/firefox: 1:07:46 average for 26 merges.
Cryptography
root #cryptsetup benchmark
# Tests are approximate using memory only (no storage IO).
PBKDF2-sha1      2713003 iterations per second for 256-bit key
PBKDF2-sha256    5356710 iterations per second for 256-bit key
PBKDF2-sha512    2330168 iterations per second for 256-bit key
PBKDF2-ripemd160  907072 iterations per second for 256-bit key
PBKDF2-whirlpool  834853 iterations per second for 256-bit key
argon2i      10 iterations, 1048576 memory, 4 parallel threads (CPUs) for 256-bit key (requested 2000 ms time)
argon2id     10 iterations, 1048576 memory, 4 parallel threads (CPUs) for 256-bit key (requested 2000 ms time)
#     Algorithm |       Key |      Encryption |      Decryption
        aes-cbc        128b      1460.5 MiB/s      5726.7 MiB/s
    serpent-cbc        128b       139.0 MiB/s      1008.5 MiB/s
    twofish-cbc        128b       233.9 MiB/s       255.0 MiB/s
        aes-cbc        256b      1104.3 MiB/s      4781.2 MiB/s
    serpent-cbc        256b       139.2 MiB/s      1004.6 MiB/s
    twofish-cbc        256b       233.8 MiB/s       255.2 MiB/s
        aes-xts        256b      4688.8 MiB/s      4723.3 MiB/s
    serpent-xts        256b       901.3 MiB/s       894.6 MiB/s
    twofish-xts        256b       481.9 MiB/s       494.3 MiB/s
        aes-xts        512b      4022.1 MiB/s      3989.7 MiB/s
    serpent-xts        512b       909.4 MiB/s       894.3 MiB/s
    twofish-xts        512b       491.7 MiB/s       493.8 MiB/s

dmidecode

root #dmidecode

GPU features

Note
All of the below data was collected under the environmental condition of WLR_DRM_DEVICES = /dev/dri/card0:/dev/dri/card1.

OpenCL

With HSA_OVERRIDE_GFX_VERSION=10.3.0 as an environmental variable, running clinfo will hang indefinitely if run as a normal user, but not when run as root. If it is set to 10.3.2 or 10.3.5, this is not an issue. The first clinfo output below was run with HSA_OVERRIDE_GFX_VERSION=10.3.0 as an environmental variable. The OpenCL hardware database has other reports on these devices as well.[70][71]

root #clinfo
user $HSA_OVERRIDE_GFX_VERSION=10.3.2 clinfo
user $HSA_OVERRIDE_GFX_VERSION=10.3.5 clinfo

OpenGL

680M
user $DRI_PRIME=1 glxinfo -B
6700S
user $glxinfo -B

ROCm

user $rocminfo

VAAPI

user $vainfo

VDPAU

680M
user $VDPAU_DRIVER=radeonsi DRI_PRIME=1 vdpauinfo
6700S
user $VDPAU_DRIVER=radeonsi vdpauinfo

Vulkan

user $vulkaninfo --summary

GPU monitoring

Install the 9999 version of app-misc/radeontop. Version 1.4 is from 2021 and will display UNKNOWN_CHIP for the dGPU otherwise.[72]

FILE /etc/portage/package.accept_keywords/package.accept_keywords
app-misc/radeontop   **

It will default to showing the stats for the iGPU. To see dGPU stats, use this command:

user $radeontop -b 3

See also

  • AMD — a semiconductor company. AMD is best known for producing CPUs based on x86 intruction set, motherboard chipsets and their own line of GPUs.
  • AMDGPU — the open source graphics drivers for AMD Radeon and other GPUs.
  • AMDGPU-PRO — the next generation closed source graphics component that operates on top of the open source AMDGPU drivers for newer AMD/ATI Radeon graphics cards.
  • AMD microcode — describes updating the microcode for AMD processors.
  • Dmidecode — a software tool that enables extraction of detailed hardware information from a system by decoding the DMI (Desktop Management Interface) table
  • GPU passthrough with virt-manager, QEMU, and KVM — directly present an internal PCI GPU as-is for direct use by a virtual machine
  • libinput — an input device driver for Wayland compositors and X.org window system.
  • List of software for Wayland — various desktop related packages for Wayland
  • PowerTOP — a Linux utility that can monitor and display a system's electrical power usage.
  • radeon — a family of open source graphics drivers for older AMD/ATI Radeon graphics cards.
  • ROCm — brand name for ROCm open software platform (for software) or the ROCm™ open platform ecosystem
  • Ryzen — a multithreaded, high performance processor manufactured by AMD.
  • synaptics — the open source input driver for Synaptics and ALPS touchpads.
  • VAAPI — provides access to graphics hardware (GPU) acceleration for video processing.
  • VDPAU — how to setup the Video Decode and Presentation API for Unix (VDPAU).
  • Vulkan — a next-generation graphics API created by The Khronos Group.
  • Wayland — a replacement for the X11 window system protocol and architecture with the aim to be easier to develop, extend, and maintain
  • Xorg/Hardware 3D acceleration guide — a guide to getting 3D acceleration working using the DRM with Xorg in Gentoo.

External resources

References

  1. Advanced Micro Devices, Inc., AMD Advantage Gaming Laptops, amd.com 2022, Retrieved on October 8th, 2023.
  2. Advanced Micro Devices, Inc., AMD SmartShift Technology, amd.com 2020, Retrieved on October 28th, 2023.
  3. Advanced Micro Devices, Inc., AMD Smart Technologies, amd.com 2023, Retrieved on December 19th, 2023.
  4. Advanced Micro Devices, Inc., AMD Radeon™ RX 6700S Mobile Graphics, amd.com 2022, Retrieved on December 19th, 2023.
  5. Advanced Micro Devices, Inc., AMD Radeon™ RX 6800S Mobile Graphics, amd.com 2022, Retrieved on December 19th, 2023.
  6. Wikipedia, Radeon RX 6000 series#Mobile, wikipedia.org 2021, Retrieved on December 19th, 2023.
  7. The PCI ID Repository, Advanced Micro Devices, Inc. (ATI), https://pci-ids.ucw.cz/ 2024, Retrieved on August 12th, 2024.
  8. The PCI ID Repository, Advanced Micro Devices, Inc. (AMD), https://pci-ids.ucw.cz/ 2024, Retrieved on August 12th, 2024.
  9. https://www.amd.com/en/product/11561
  10. https://bsd-hardware.info/?id=cpu:amd-25-68-1-ryzen-9-6900hs-with-radeon-graphics
  11. https://www.techpowerup.com/cpu-specs/ryzen-9-6900hs.c2528
  12. https://www.phoronix.com/news/AMDGPU-Yellow-Carp-FW
  13. https://www.phoronix.com/review/amd-radeon-680m
  14. https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/commit/?id=198ac651f46b7d4efd660a1f5ab4f93ca422947d
  15. https://lore.kernel.org/all/bug-219468-2300@https.bugzilla.kernel.org%2F/T/
  16. https://gitlab.freedesktop.org/drm/amd/-/issues/3743
  17. https://gitlab.freedesktop.org/drm/amd/-/issues/3651
  18. https://admin.pci-ids.ucw.cz//read/PC/1002/73ef
  19. https://cateee.net/lkddb/web-lkddb/DRM_AMDGPU.html
  20. https://www.phoronix.com/news/AMDGPU-Dimgrey-Cavefish
  21. https://www.phoronix.com/news/Mesa-20.3-Released
  22. https://admin.pci-ids.ucw.cz/read/PC/1002/1478
  23. https://admin.pci-ids.ucw.cz/read/PC/1002/1479
  24. https://www.phoronix.com/news/Linux-Disables-RNG-AMD-fTPMs
  25. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=554b841d470338a3b1d6335b14ee1cd0c8f5d754
  26. https://bugzilla.kernel.org/show_bug.cgi?id=217719
  27. https://rog.asus.com/uk/support/FAQ/1049059
  28. https://linux-hardware.org/?id=usb:13d3-56eb
  29. https://linux-hardware.org/?id=ps/2:04f3-319b-asue120a-00-04f3-319b-mouse
  30. https://stackoverflow.com/questions/52713940/purpose-of-address-spaced-identifiersasids
  31. https://www.rtings.com/laptop/reviews/asus/rog-zephyrus-g14-2022
  32. https://www.tomsguide.com/reviews/asus-rog-zephyrus-g14-2022
  33. https://www.corsair.com/us/en/p/memory/cmsx32gx5m1a4800c40/vengeance-ddr5-sodimm-32gb-1x32gb-ddr5-4800-pc5-38400-c40-1-1v-cmsx32gx5m1a4800c40
  34. https://www.anker.com/products/a8866
  35. https://www.anker.com/products/a8388
  36. ASIX Electronics Corp. AX88179 Gigabit Ethernet
  37. Norelsys NS1081
  38. VIA Labs, Inc. USB 3.1 Hub
  39. Super Top 4-Port hub
  40. VIA Labs, Inc. USB 2.0 Hub
  41. https://www.anker.com/products/a2148
  42. https://forums.virtualbox.org/viewtopic.php?t=112580
  43. https://bbs.archlinux.org/viewtopic.php?id=301155
  44. https://www.phoronix.com/news/AMD-P-State-Active-Default
  45. https://gitlab.com/asus-linux/asusctl/-/issues/93
  46. https://forums.gentoo.org/viewtopic-p-8688242.html
  47. https://rog.asus.com/laptops/rog-zephyrus/rog-zephyrus-g14-2022-series/helpdesk_bios/
  48. https://photon-reddit.com/r/ZephyrusG14/comments/x0jmc8/bios_313_a_survivors_guide/
  49. https://uefi.org/revocationlistfile
  50. https://github.com/hyprwm/hyprland-wiki/pull/721/files/6913c30e17d421ad0a33805004b542da92fa775a
  51. https://docstore.mik.ua/orelly/unix3/upt/ch06_02.htm
  52. https://github.com/jwrdegoede/wev
  53. https://www.oreilly.com/library/view/xlib-reference-manual/9780937175262/16_appendix-h.html
  54. https://www.cl.cam.ac.uk/~mgk25/ucs/keysymdef.h
  55. https://www.geeksforgeeks.org/showkey-command-in-linux-with-examples/
  56. https://community.kde.org/KWin/Environment_Variables
  57. https://linrunner.de/tlp/index.html
  58. https://gitlab.freedesktop.org/drm/amd/-/issues/2068
  59. https://unix.stackexchange.com/questions/517689/btrfs-bad-tree-block-start-prevents-mount-and-repair
  60. https://forum.rockstor.com/t/btrfs-wont-mount-says-open-ctree-failed/3122/2
  61. https://forums.opensuse.org/t/btrfs-error-cant-read-tree-root-bad-tree-blcok-start/147355/7
  62. https://docs.amd.com/en/latest/release/gpu_os_support.html
  63. https://github.com/RadeonOpenCompute/ROCm/issues/1756
  64. https://www.techpowerup.com/gpu-specs/radeon-rx-6700s.c3868
  65. https://www.techpowerup.com/gpu-specs/radeon-680m.c3871
  66. https://bugs.gentoo.org/906222
  67. https://lore.kernel.org/lkml/CAF9VpL4ZavjF9pwbRC_mj7+YAajgCJXTBdnnwNK3gHSS2VUxYw@mail.gmail.com/T/
  68. https://lore.kernel.org/lkml/20220909180509.638-1-mario.limonciello@amd.com/
  69. https://gitlab.com/marcaux/g14-2021-s3-dsdt
  70. https://opencl.gpuinfo.org/listreports.php?devicename=gfx1032&platform=
  71. https://opencl.gpuinfo.org/listreports.php?devicename=gfx1035&platform=
  72. https://github.com/clbr/radeontop/issues/133
  73. https://bugs.gentoo.org/827002