Jump to content

# Lenovo ThinkPad X13 Gen 2 (AMD)

From ArchWiki

Hardware | PCI/USB ID | Working?
--- | --- | ---
Touchpad |  | Yes
J-Mouse |  | Yes
Video |  | Yes
Webcam | `5986:213c` | Yes
Bluetooth |  | No
Bluetooth (Realtek) | `0bda:4852` | Yes
Audio | `1022:15e3` | Yes
Wireless |  | Yes
Fingerprint reader | `27c6:6594` | Yes
TPM |  | Untested

## Accessibility

The BIOS offers two modes of operation, GUI and Simple Text.

The GUI can be navigated to some degree via the keyboard. `Left` and `Right` arrow keys to move the selection and `Space` to activate.

For full keyboard support switching to simple text would likely be better.

That can be accomplished by:

- Selecting and activating Config on the left side under Setup
- `Right` arrowing until the drop down to the right of Setup UI is selected
- active the drop down and select Simple Text
- `F10` (save and exit)

Note: Blind users may want to request the help of a sighted person to change BIOS settings

## Hardware

### Bluetooth

Bluetooth doesn't appear to work with the stock Qualcomm Wi-Fi 6E QCNFA765 modem. The modem is an M.2 2230 form factor and not soldered (on the AMD variant of the X13 Gen 2), and can be replaced easily with an Intel AX210.NGW.

### Video

#### Brightness control

As of kernel 5.9 use the native brightness controller, use the `acpi_backlight=native` kernel parameter.

### Audio

PulseAudio seems to work fine without manual intervention, but the ALSA audio device chosen by default may not be correct. You may need to change the default device.

    /etc/asound.conf

    defaults.pcm.card 2
    defaults.ctl.card 2

You should remember to unmute the volume.

### NVME / Oculink

The NVME port complies with the 4x PCIE 4.0 standard. It accepts other types of peripherals, including e-gpu solutions with Oculink standard for connecting an external NVIDIA or AMD GPU (Intel's Arc GPU does not work at present, for unknown reasons).

Currently tested: Nvidia GTX 1650 (Low profile) with EXP GDC 10.6 connected via Oculink on the NVME port: Note! Final Fantasy VII Rebirth successfully launched, as the GTX 16XX series is the only GTX to support meshes shaders 6.6 and the laptop CPU supports AVX2 instructions. Note that the Renoir GPU integrated into the AMD APU does not support meshe shaders 6.6, and it will be impossible to launch a new-generation game depending on it. Pyroveil (https://github.com/ValveSoftware/Proton/issues/8408#issuecomment-2657340142) must be used with the dedicated Nvidia fix to get around the poor support for meshes shaders 6.6 provided by proprietary drivers, as things stand. Optiscaler was tested too for enabling DLSS + FSR3 replacement and frame generation support.

No bandwidth problems noted in any of these situations, whether connecting a monitor directly to the external gpu, or using the display managed by the APU's integrated AMD GPU, on the laptop screen or an external monitor, while taking advantage of the external gpu.

## Firmware

fwupd does not support this device yet.

### UEFI

It is recommended to run the latest UEFI version.

The "BIOS update" can be downloaded as an ISO image from the X13 support page and loaded to a USB stick.

Additionally, there is a UEFI option for customizing the Power profile that by default is tuned to Windows 10. See #Power Management.

Note: According to Lenovo engineer, the Windows 10 setting may be preferred if the kernel supports it.

## Power Management

The UEFI provides two choices for the sleep mode in Config > Power > Sleep State. The Windows 10 mode (s2idle) is recommended, and results in about a 0.5%/hour drain while sleeping. Using the Linux mode (s3) may help if you are running an older kernel.

See Power management/Suspend and hibernate#Changing suspend method.

## Function keys

Key | Visible?1 | Marked?2 | Effect
--- | --- | --- | ---
`Fn` | Yes | No | `XF86WakeUp`
`Fn+Esc` | No | Yes | Enables Fn lock
`Fn+F1` | Yes | Yes | `XF86AudioMute`
`Fn+F2` | Yes | Yes | `XF86AudioLowerVolume`
`Fn+F3` | Yes | Yes | `XF86AudioRaiseVolume`
`Fn+F4` | Yes | Yes | `XF86AudioMicMute`
`Fn+F5` | No | Yes | `XF86MonBrightnessDown`
`Fn+F6` | No | Yes | `XF86MonBrightnessUp`
`Fn+F7` | Yes | Yes | `XF86Display`
`Fn+F8` | Yes | Yes | `XF86WLAN`3
`Fn+F9` | No | Yes |
`Fn+F10` | No | Yes |
`Fn+F11` | No | Yes |
`Fn+F12` | Yes | Yes | `XF86Favorites`
`Fn+Space` | No | Yes | Enables/disables keyboard backlight
`Fn+4` | Yes | No | `XF86Sleep`3
`Fn+B` | Yes | No | `Ctrl_L + Break`
`Fn+P` | Yes | No | `Pause`
`Fn+K` | Yes | No | `Scroll Lock`
`Fn+Left` | Yes | No | `Home`
`Fn+Right` | Yes | No | `End`
`Fn+S` | Yes | No | `Alt_L + SysRq`
`Fn+End` | Yes | Yes | `Ins`

1. The key is visible via `xev` and similar tools
2. The physical key has a symbol on it, which describes its function
3. systemd-logind handles this by default

## Gaming

This article or section needs language, wiki syntax or style improvements. See Help:Style for reference.

Reason: Written like a blog post, some irrelevant details (e.g. game launchers), needs to interlink with existing pages and avoid big config dumps. (Discuss in Talk:Lenovo ThinkPad X13 Gen 2 (AMD))

The APU incorporates a RENOIR from AMD GPU. It is possible to make a few optimizations to be able to run recent games that would otherwise have great difficulty.

To do this, you need a few tools and configurations:

-znver3 Linux kernel: Available via chaotic-aur or AUR, required for WineFSync support and other optimisations.

-ProtonUP: to install a customised version of Proton/DXVK with FSR support.

-Proton-GE: proton fork with native FSR support.

-Steam: to launch your games

-Heroic: to launch your games

-LACT: to manually specify the GPU frequency, which is necessary for certain games that don't push it to the limit, with a clear degradation in performance in this case.

If you only want a game machine, you can optimise the launch parameters via /etc/default/grub wich removing mitigations too (enable it if you prefer security by removing mitigations=off) :

    /etc/default/grub

    GRUB_CMDLINE_LINUX_DEFAULT="apparmor=0 security=apparmor lsm=landlock,lockdown,yama,integrity,apparmor,bpf udev. log_priority=3 clearcpuid=514 module_blacklist=pcspkr,snd_pcsp tsc=unstable mitigations=off iommu=pt amd_pstate=active amdgpu.abmlevel=0 idle=nomwait rcu_nocbs=0-$(($(nproc)-1)) processor.max_cstate=5’

Editing environment variables :

    /etc/environment

    WINEFSYNC=1
    #DX12 support
    VKD3D_DEBUG=none
    VKD3D_SHADER_COMPILE_OPTIONS=fast_math
    VKD3D_FRAME_RATE=24 # choose 24 or 30fps max
    #Enable FSR for Proton-GE or Wine-GE, works only with DXVK
    WINE_FULLSCREEN_FSR=1
    WINE_FULLSCREEN_FSR_MODE=performance # choose performance, medium, quality
    #Choose global config file for directx 9/10/11 support with DXVK. (Alternatively, you can comment this line and include this file next to the executable in each game)
    DXVK_CONFIG_FILE=/home/youruser/.config/dxvk.conf
    #Force using radeon vulkan support
    VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/radeon_icd.i686.json:/usr/share/vulkan/icd.d/radeon_icd.x86_64.json
    #Correcting Bug texture with AMD
    AMD_DEBUG=dpc
    RADV_PERFTEST=video_decode
    #MESA_LOADER_DRIVER_OVERRIDE=zink # Enable only for OpenGL support via Vulkan. GDM will only launch under Wayland, no longer with X.

    #Various optimisations and HUD display for Vulkan.
    VK_INSTANCE_LAYERS=VK_LAYER_MESA_overlay VK_LAYER_MESA_OVERLAY_CONFIG=fps,frame_timing=0,device=0,format=0 VK_LAYER_KHRONOS_validation VK_LAYER_L>
    VK_LAYER_KHRONOS_validation=0
    MESA_VK_WSI_PRESENT_MODE=mailbox
    VK_SWAPCHAIN_COLORS=bt709
    vblank_mode=0
    VK_LAYER_LUNARG_standard_validation=0
    MESA_NO_ERROR=1
    VK_LOADER_DISABLE_EXTENSIONS=VK_EXT_debug_marker,VK_KHR_surface

Edit /home/youruser/.config/dxvk.conf or your dxvk.conf next to the game executable :

    dxvk.conf

    ----------Various---------
    dxgi.syncInterval = 0
    d3d11.relaxedBarriers = True
    d3d11.apitrace = False

    Enable HUD---------
    dxvk.hud = api,fps,memory,gpuload,version

    Optimisation---------

    d3d11.ignoreGraphicsBarriers = True

    HDR---------
    dxgi.enableHDR = False
    dxgi.enableUe4Workarounds = False

    Fix framerate 24 or 30---------
    dxgi.maxFrameLatency = 2
    d3d9.maxFrameLatency = 2

    dxgi.maxFrameRate = 24
    d3d9.maxFrameRate = 24

    dxgi.numBackBuffers = 2
    d3d9.numBackBuffers =2

    Fast Vsync-----
    dxvk.tearFree = False

    Vsync-----
    dxgi.syncInterval = -1
    d3d9.presentInterval = -1

    Disable Anisotropic Fltering---------
    (0-16)-------
    d3d11.samplerAnisotropy  = 0
    dxgi.samplerAnisotropy  = 0
    d3d9.samplerAnisotropy  = 0

    Texture sharpening
    ( -2-1)--------
    d3d11.samplerLodBias = 0.1
    dxgi.samplerLodBias = 0.1
    d3d9.samplerLodBias = 0.1
    d3d11.clampNegativeLodBias = True
    d3d9.clampNegativeLodBias = True

    Supersampling---------
    (True-False)--------------
    d3d11.forceSampleRateShading = False
    d3d9.forceSampleRateShading = False

    Optimisation--------------

    d3d11.dcSingleUseMode = True
    d3d11.maxFeatureLevel = 11_0
    d3d11.maxTessFactor = 8
    d3d11.relaxedBarriers = False

    Vram max 2048 or 4096--------------
    dxgi.maxDeviceMemory = 2048
    dxgi.maxSharedMemory = 2048

Now if your on Gnome, on login screen, choose Wayland which offers a much smoother gaming experience when the frame rate drops.

Launch Proton-Up and choose lateste version of Proton-GE for Steam/Heroic, and config them to using this version.

In Gnome, don't forget to set power to performance in settings.

Launch LACT tool for AMD GPU, and choose in "OC" TAB to enable service, then reboot system.

Launch LACT again, and in OC Tab, choose Highest Clocks. This will increase the GPU's capacity to its maximum. Note that this is not overclocking.

Launch your game and enjoy. :-)

You can optimize config file for engines too.

Example of Engine.ini for Unreal Engine 4 (here for Final Fantasy VII Remake Intergrade, but could works for others games too) :

    Engine.ini

    [SystemSettings]

    r.VSync=0
    r.SetRes=1920x1080f
    #r.FramerateLimit=30
    #r.MaxFrameRate=30

    r.TextureStreaming=1
    r.DynamicRes.OperationMode=0
    r.DynamicRes.MinScreenPercentage=100
    r.DynamicRes.MaxScreenPercentage=100
    r.PostProcess.ScreenResolution=60
    r.MaxAnisotropy=16
    r.PostProcess.AntiAliasingQuality=2

    r.Shadow.Quality=0
    r.Shadow.MaxResolution=512
    r.Shadow.MaxCSMResolution=1024
    r.Shadow.RadiusThreshold=0.06
    r.Shadow.DistanceScale=0.8

    r.Effects.Quality=1
    r.Foliage.Quality=0
    r.DistanceFieldQuality=0
    r.Water.Quality=0
    r.Particle.Quality=0

    r.MotionBlurQuality=0
    r.DepthOfFieldQuality=0
    r.BloomQuality=2

    r.TextureQuality=2
    r.Texture.LODBias=-0.5
    r.Streaming.MipBias=1

    tessellation.MaxDisplacement=0

    r.ParticleLODBias=2
    r.ParticleLightQuality=0

    r.ViewDistanceScale=0.9

    r.AmbientOcclusionLevels=0
    r.AmbientOcclusionRadiusScale=0.5

    r.SkeletalMeshLODBias=2

    r.DefaultFeature.MotionBlur=0

    r.AllowAsyncCompute=0
    r.AsyncComputeBudget=4

    r.FastVRam.BokehDOF=1
    r.FastVRam.CombineLUTs=1
    r.FastVRam.DistanceFieldAODownsampledBentNormal=1
    r.FastVRam.DistanceFieldAOHistory=1
    r.FastVRam.DistanceFieldAOScreenGridResources=1
    r.FastVRam.DistanceFieldCulledObjectBuffers=1
    r.FastVRam.DistanceFieldNormal=1
    r.FastVRam.DistanceFieldShadows=1
    r.FastVRam.DistanceFieldTileIntersectionResources=1
    r.FastVRam.DistortHistory=1
    r.FastVRam.Distortion=1
    r.FastVRam.DOFPostfilter=1
    r.FastVRam.DOFReduce=1
    r.FastVRam.DOFSetup=1
    r.FastVRam.Downsample=1
    r.FastVRam.EyeAdaptation=1
    r.FastVRam.ForwardLightingCullingResources=1
    r.FastVRam.Histogram=1
    r.FastVRam.HistogramReduce=1
    r.FastVRam.HZB=1
    r.FastVRam.LPV=1
    r.FastVRam.MotionBlur=1
    r.FastVRam.PostProcessMaterial=1
    r.FastVRam.SceneColor=1
    r.FastVRam.SceneDepth=1
    r.FastVRam.ScreenSpaceShadowMask=1
    r.FastVRam.ScreenSpaceShadowMask=1
    r.FastVRam.ShadowCSM=1
    r.FastVRam.ShadowPerObject=1
    r.FastVRam.Tonemap=1
    r.FastVRam.Upscale=1
    r.FastVRam.VelocityFlat=1
    r.FastVRam.VelocityMax=1
    r.FastVRam.VolumetricFog=1

    [RenderSettings]
    r.Shadow.Quality=0
    r.Effects.Quality=1
    r.Foliage.Quality=0
    r.DistanceFieldQuality=0
    r.Water.Quality=0
    r.Particle.Quality=0

Or Unreal Engine 5 (here for Dragon Ball Sparking Zero, but could works for other games) add in Engine.ini :

    Engine.ini

    [Engine.Engine]
    ; Limit Max FPS
    bSmoothFrameRate=True
    MinSmoothedFrameRate=30
    MaxSmoothedFrameRate=30

    [/script/engine.engine]
    FixedFrameRate=30

    [SystemSettings]
    bUseFixedFrameRate=True
    bSmoothFrameRate=False
    FixedFrameRate=30
    FrameRateLimit=30

    ; Resolution and details
    r.ScreenPercentage=75             ; Renders the game at 75% of the native resolution for an FPS boost
    r.ViewDistanceScale=1.5           ; Reduces the view distance
    r.StaticMeshLODDistanceScale=1.5  ; Increases the use of LOD (Low-Detail Objects)
    r.SkeletalMeshLODBias=1           ; Reduces character quality at a distance

    ; Shadows
    r.ShadowQuality=1                 ; Reduces shadow quality
    r.Shadow.MaxResolution=128        ; Limits shadow resolution
    r.Shadow.RadiusThreshold=0.05     ; Reduces shadows on small objects
    r.Shadow.DistanceScale=0.5        ; Decreases shadow range

    ; Lighting and visual effects
    r.VolumetricFog=0                 ; Disables volumetric fog
    r.VolumetricCloud=0               ; Disables volumetric clouds
    r.MotionBlurQuality=0             ; Disables motion blur
    r.BloomQuality=0                  ; Disables bloom
    r.LensFlareQuality=0              ; Disables lens flares
    r.SceneColorFringeQuality=0       ; Disables chromatic aberration
    r.DepthOfFieldQuality=0           ; Disables depth of field

    ; Textures and streaming
    r.TextureStreaming=1              ; Enables texture streaming
    r.Streaming.PoolSize=768          ; Texture pool size (for 12 GB of system RAM)
    r.MaxAnisotropy=16                ; Limits anisotropic filtering to 4x

    ; Anti-aliasing
    r.TemporalAACurrentFrameWeight=0.2 ; Reduces temporal anti-aliasing artifacts
    r.TemporalAASamples=0             ; Adjusts temporal anti-aliasing samples

    ; FPS optimization
    r.HZBOcclusion=0                  ; Disables hierarchical occlusion
    r.DistanceFieldShadowing=0        ; Disables distance field shadows
    r.GenerateMeshDistanceFields=0    ; Disables the generation of distance fields

## See also

- Specifications: https://psref.lenovo.com/syspool/Sys/PDF/ThinkPad/ThinkPad_x13_Gen_2_AMD/ThinkPad_x13_Gen_2_AMD_Spec.PDF
- Official service manual: https://download.lenovo.com/pccbbs/mobiles_pdf/t14s_gen2_x13_gen2_hmm_en.pdf
- https://ubuntu.com/certified/202107-29283

Category:

- Lenovo

Hidden category:

- Pages or sections flagged with Template:Style