[HowTo] Install Manjaro on the ASUS TUF FX505DY / FX705DY with Ryzen / Radeon combo

Difficulty: ★★☆☆☆

Manjaro Linux Guide for ASUS TUF FX505DY / FX705DY

Please note: This guide applies to the Ryzen CPU / Radeon RX 560X GPU versions of this device. While there may be some overlap with other versions hardware-wise, I can’t say what will and won’t work for them.

1.0: Installation

First things first, you need to get the most recent version of Manjaro and write it to a USB. I won’t cover that here. You will then need to shut down your laptop and power it up whilst mashing the Esc key. Select Enter Setup and then press F7 for Advanced settings. Navigate to Security and disable Secure Boot. Hit F10 to save and exit, and mash Esc again. Select your Manjaro USB and boot up. The defaults are fine so long as you are on a Manjaro image that is current or newer than the writing date of this guide (Nov 6, 2019).

Hardware Note: If you have the model with the WD Black Nvme SSD, you will need to add the following to your grub boot line: nvme_core.default_ps_max_latency_us=5500

Note 2: I have had odd graphical corruption issues with Manjaro XFCE on this device. It works just fine on Majaro KDE. I have not done any troubleshooting to determine exactly why this is, so YMMV if you use the XFCE ISO.

Okay, so now we are booted into the Manjaro live environment. Just do the installation as normal with whatever options work best for you, and reboot into your new OS. If you are using Ethernet for your network access you will be online already and can skip to part 2.2, otherwise please go on to part 2.1.

2.0: Configuration

2.1: Getting online to get online

If you are not using Ethernet for network access, you will notice that you have no Network access. Unfortunately the Wifi drivers for these laptops is a Realtek 8821CE that is not included in the Linux kernel by default, so you will need to find some way to get network access to install the driver. I recommend just tethering via USB to your phone, as it is the most simple method.

2.2: Getting Wifi Working

You will need to install rtl8821ce-dkms-git from the AUR in order to get the Wifi going. It uses DKMS, so it will automatically get re-set up each time you upgrade your kernel in the future. I will explain how I did it, but feel free to use whatever AUR helper you feel like - you don’t need to copy my method if you prefer another program.

$ sudo pacman -S yay $ yay rtl8821ce-dkms-git

After the installation finishes you can reboot, and your Wifi should be up and running. Don’t forget to turn off your phone USB tethering if you used it.

2.3: Fixing the Kernel

NOTE: this section on manually patching the Linux kernel will be out of date once Kernel 5.6 is released, as fixes for this issue have been upstreamed in that Kernel version.

As of the writing of this guide (Nov 6, 2019) the Linux kernel included with Manjaro has a bug with the ASUS WMI that throttles the CPU badly to 399Mhz when the CPU temp hits 70c, even though the fans spin up properly. This results in huge FPS drops and performance issues with gaming or any other intensive workloads. Fortunately @leonmaxx developed a patch for this issue that works with Kernel 5.3. To apply it, do the following:

2.4 Manually Patching the Linux Kernel

For now, manual patching of the kernel is required. First, we will pull down the Manjaro kernel by running:

$ git clone https://gitlab.manjaro.org/packages/core/linux53

and then you will want to grab the 3 diff files from @leonmaxx 's post to the LKML at LKML: Leonid Maksymchuk: [PATCH v4 0/3] asus_wmi: Support of ASUS TUF laptops on Ryzen CPUs . Save each diff into the linux53 directory as something like “asus_wmi1.patch”, “asus_wmi2.patch”, “asus_wmi3.patch”. You will see a bunch of other .patch files as well in the same directory, by the way, so don’t worry about that.

You then open up the file PKGBUILD in your editor of choice and add the lines

'asus_wmi1.patch'
'asus_wmi2.patch'
'asus_wmi3.patch'

in the area where the other patches are listed. You then go find the next section where patches are listed and add

patch -Np1 -i "${srcdir}/asus_wmi1.patch"
patch -Np1 -i "${srcdir}/asus_wmi2.patch"
patch -Np1 -i "${srcdir}/asus_wmi3.patch"

to the section where the other patches are similarly listed. Then save and exit. Run the command:

$ updpkgsums && makepkg -si

You then sit back, relax, and wait for the compiling and installation. Reboot, and you should be good to go. Optionally, if you want a faster compile you can do:

$ updpkgsums && MAKEFLAGS=-jX makepkg -si

Where X is the number of CPU cores to use on the compile (I personally use 4 or 6)

3.0: Gaming Configuration

As these laptops have two GPUs, the Radeon Vega iGPU and the RX 560X dGPU, you have to sometimes let games know which GPU to use. For OpenGL games, this can be done with the environment variable DRI_PRIME=1 - so to launch an OpenGL game you run it as follows: DRI_PRIME=1 ./Game . For Vulkan games, technically games using Vulkan ought to implement a method for you to select the GPU, but unfortunately this does not always occur. The problem here is that because BOTH of our GPUs are Radeon devices, many games that default to selecting the GPU they determine to be best pick the Vega iGPU. Luckily someone has developed a tool to force a specific GPU, vkdevicechooser. You can install it from the AUR with following command:

$ yay -S vkdevicechooser

Or if you want to install it manually, do the following:

$ git clone https://github.com/aejsmith/vkdevicechooser.git $ cd vkdevicechooser $ make install

To use vkdevicechooser, you launch it with these environment variables: ENABLE_DEVICE_CHOOSER_LAYER=1 VULKAN_DEVICE_INDEX=X where X is the desired device index reported by vulkaninfo . For this laptop, it is Device index 1, so you would launch a Vulkan game like this: ENABLE_DEVICE_CHOOSER_LAYER=1 VULKAN_DEVICE_INDEX=1 ./Game

For Steam games, you need to edit the launch options, and for OpenGL Games you use DRI_PRIME=1 %command% . For Vulkan Steam games that do not properly implement GPU selection, you use ENABLE_DEVICE_CHOOSER_LAYER=1 VULKAN_DEVICE_INDEX=1 %command%

3.1 Improving Performance

We can get a bit of extra Gaming performance by using Feral Interactive’s Game Mode, which is “a daemon/lib combo for Linux that allows games to request a set of optimisations be temporarily applied to the host OS and/or a game process.”. It can be easily installed easily from the repos:

$ sudo pacman -S gamemode lib32-gamemode

Game Mode is automatically used by several Feral Interactive games, and any game run with Lutris by default. For other games, you can use gamemoderun ./Game to run them with Game Mode. If you need to use the RX 560X, you can run them with GAMEMODERUNEXEC="env DRI_PRIME=1" gamemoderun ./Game for OpenGL games, or GAMEMODERUNEXEC="env ENABLE_DEVICE_CHOOSER_LAYER=1 VULKAN_DEVICE_INDEX=1" gamemoderun ./Game . For Steam games, you can modify the launchers accordingly following these same methods (Ex. GAMEMODERUNEXEC="env DRI_PRIME=1" gamemoderun %command% for OpenGL or GAMEMODERUNEXEC="env ENABLE_DEVICE_CHOOSER_LAYER=1 VULKAN_DEVICE_INDEX=1" gamemoderun %command% for Vulkan games).

4.0 Suspend Issues

By default, Suspend works, but the laptop display would just be blank upon trying to resume. However thanks to this forum post I was able to determine that disabling the Kwin compositor with Shift+Alt+F12 makes Suspend work properly. So we just have to automate that process in order to have a smooth suspend/resume process. In order to do this, we must do the following -

Create /etc/systemd/system/suspend@.service , which contains:

[Unit] Description=User suspend actions Before=sleep.target

[Service] User=%I Type=forking Environment=DISPLAY=:0 ExecStart=/usr/bin/qdbus org.kde.KWin /Compositor suspend ExecStartPost=/usr/bin/sleep 1

[Install] WantedBy=sleep.target

as well as /etc/systemd/system/resume@.service which contains:

[Unit] Description=User resume actions After=suspend.target

[Service] User=%I Type=simple ExecStart=/usr/bin/xrandr --output eDP --auto ; /usr/bin/qdbus org.kde.KWin /Compositor resume

[Install] WantedBy=suspend.target

and then enable both services via

$ sudo systemctl enable suspend@username
$ sudo systemctl enable resume@username

Alternatively, if you regularly use one or more external monitors with your laptop you could replace /usr/bin/xrandr --output eDP --auto from the resume configuration with /usr/bin/autorandr --change in order to have your display settings automatically adjust based on what monitors are plugged in. However you will need to install and configure autorandr in order to do so, and it is not needed if you only use your built-in display.

One note is that as I use Manjaro KDE, the program controlling desktop compositing for me is Kwin. So this specific solution only works for KDE, and the exact method to disable the compositor would vary for Gnome, XFCE, etc, but the principle is the same.

5.0 Fan Control

While the Fn+F5 key does work to control the fan mode (Silent, Normal, Overboost), by default it simply runs on Normal mode all of the time. Fortuantely, @leonmaxx has written a Daemon that monitors system temps and automatically adjusts the fans at whatever temperatures the user specifies. To install it, do the following:

$ mkdir asus_fanmode $ cd asus_fanmode $ wget https://github.com/leonmaxx/asus_fanmode-pkg/blob/master/PKGBUILD $ makepkg

$ sudo pacman -U asus_fanmode-0.1.0-1-x86_64.pkg.tar.xz $ sudo systemctl enable asus_fanmode $ sudo systemctl start asus_fanmode

You can check to make sure the Daemon is running via:

$ systemctl status asus_fanmode

And the temperature settings can be changed in /etc/asus_fanmode.conf

6.0: Upgrades

I have recently (Nov 20, 2019) upgraded my device from the Realtek RTL8821CE WiFi/Bluetooth card to an Intel AX200 WiFi 6 / Bluetooth 5.0 Card. The upgrade was quite simple, taking no more than 5 minutes to perform. The only mild annoyance was that the WiFi card installs under the NVMe SSD, so I had to remove that, switch the cards, connect the antennae, and then re-install the SSD. Afterwards I closed my system, booted up, and the Intel WiFi and Bluetooth worked with zero issues or configuration. I would heavily recommend this upgrade, as I get far better Network speeds now, and for only $24 it was a very good deal. If you do this upgrade don’t forget to

$ yay -R rtl8821ce-dkms-git

to remove the Realtek drivers. You will also need to re-pair any Bluetooth devices with the new Bluetooth adapter.

7.0: Fix screen tearing, enable FreeSync

To fix any screen tearing and enable FreeSync on the Laptop display, do the following:

$ sudo nano /etc/X11/xorg.conf.d/20-amdgpu.conf

and in that file, add the following:

Section "Device" Identifier "AMD" Driver "amdgpu" Option "VariableRefresh" "true" EndSection

Save and exit, and restart your system.

8.0: Conclusion

At this point everything ought to be working and Gaming performance ought to be decent. I have tested the following titles on my system and they all work very well:

  • World of Warcraft (WINE/DXVK via Lutris)
  • Hitman (Linux Native, via Steam)
  • Mad Max (Linux Native, via Steam)
  • Civilization 5 (Linux Native, via Steam)
  • Civilization 6 (Linux Native, via Steam)
  • Pillars of Eternity 2 (Linux Native, GOG version)
  • Middle Earth: Shadow of Mordor (Linux Native, via Steam)
  • Dead Cells (Linux Native, via Steam)
  • The Witcher 3 (WINE/DXVK via Proton in Steam)
  • Grand Theft Auto 5 (WINE/DXVK via Proton in Steam)

If there are any questions / issues, please feel free to reply below and I will do my best to answer them, and hopefully this guide is of help to some people!

Special thanks to @leonmaxx for making the patch that enables Fan Boost to function correctly, without his work none of the rest of this would really matter, and to djip.perois@free.fr / Djip007 · GitHub for providing the needed information about ACPI internals of FX705DY/FX505DY which enabled all of this.

6 Likes

Thanks for this. I just did the same and see 25-30% improvement in my throughput. :partying_face:

1 Like

thanks brother , this is a great help

Hello!
I’m trying this on an hp15S-EQ1019NS which appears to have the same Realtek card and not connecting to WIFI at all.
However when trying the yay rtl8821 command it asks about what packages to install, and I am clueless here. Any tips?

$yay rtl8821ce-dkms-git
1 aur/rtl8821ce-dkms-git 1.0.5.r36.gca4abd8-1 (+22 3.27) 
rtl8821CE driver with firmware
==> Paquetes a instalar (eg.: 1 2 3, 1-3 or ^4)

Thanks!

Marianne

i think you need to press 1 to select the package that need to be installed

You should create a new thread about your issue since it’s a different system than what this thread is about.

2 Likes

Thank you! That got me a bit further but I run into various 404s so I’m posting a new thread as suggested.
Have a nice day!

Hello, I got the Zephyrus G15 with Ryzen 4800HS CPU but the throttling problem still persists, no matter which BIOS I use and which kernel.
Currently I’m using BIOS version GA502IU.218 from the 19th of September and the problem is independent from kernel, used 5.6.x, 5.7.x and currently 5.8.11-1 and the CPU still goes down to 399MHz. How can I fix this? The bug is still there, can’t solve this problem since July… Please just try BOINC and I bet you’ll notice the bug too. Thanks in advance!

Does setting /sys/devices/platform/asus-nb-wmi/throttle_thermal_policy to 1 (overboost) solve your issues? Be aware that this will lead to very high power usage, since it forces your CPU and GPU to increase their clocks and drastically increases fan speed. The value will also reset to 0 on your next boot.

Thanks for the fast reply! When I do echo 1 | sudo tee /sys/devices/platform/asus-nb-wmi/throttle_thermal_policy my console says tee: /sys/devices/platform/asus-nb-wmi/throttle_thermal_policy: file or directory not found Furthermore, I don’t think this will fix as I assume this just disables throttling and stick to maximum frequency?

In that case, I am not surprised that you are throttling. Can we get the inxi --admin --verbosity=7 --filter --no-host output?

I read that it should be built in as of kernel 5.6.x… so I don’t quite understand why it’s not found. Here is the CPU part of the command you provided:

CPU:       Topology: 8-Core model: AMD Ryzen 7 

4800HS with Radeon Graphics bits: 64 type: MT MCP arch: Zen family: 17 (23)
model-id: 60 (96) stepping: 1 microcode: 8600104 L2 cache: 4096 KiB bogomips: 92666
Speed: 399 MHz min/max: 1400/2900 MHz boost: enabled Core speeds (MHz): 1: 399 2: 399 3: 399 4: 399 5: 399 6: 399
7: 399 8: 399 9: 399 10: 399 11: 399 12: 399 13: 399 14: 399 15: 399 16: 399
Flags: 3dnowprefetch abm adx aes aperfmperf apic arat avic avx avx2 bmi1 bmi2 bpext cat_l3 cdp_l3 clflush
clflushopt clwb clzero cmov cmp_legacy constant_tsc cpb cpuid cqm cqm_llc cqm_mbm_local cqm_mbm_total cqm_occup_llc
cr8_legacy cx16 cx8 de decodeassists extapic extd_apicid f16c flushbyasid fma fpu fsgsbase fxsr fxsr_opt ht
hw_pstate ibpb ibrs ibs irperf lahf_lm lbrv lm mba mca mce misalignsse mmx mmxext monitor movbe msr mtrr mwaitx
nonstop_tsc nopl npt nrip_save nx osvw overflow_recov pae pat pausefilter pclmulqdq pdpe1gb perfctr_core
perfctr_llc perfctr_nb pfthreshold pge pni popcnt pse pse36 rdpid rdpru rdrand rdseed rdt_a rdtscp rep_good sep sev
sha_ni skinit smap smca sme smep ssbd sse sse2 sse4_1 sse4_2 sse4a ssse3 stibp succor svm svm_lock syscall tce
topoext tsc tsc_scale umip v_vmsave_vmload vgif vmcb_clean vme vmmcall wbnoinvd wdt xgetbv1 xsave xsavec xsaveerptr
xsaveopt xsaves
Vulnerabilities: Type: itlb_multihit status: Not affected
Type: l1tf status: Not affected
Type: mds status: Not affected
Type: meltdown status: Not affected
Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via prctl and seccomp
Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization
Type: spectre_v2 mitigation: Full AMD retpoline, IBPB: conditional, IBRS_FW, STIBP: conditional, RSB filling
Type: srbds status: Not affected
Type: tsx_async_abort status: Not affected

Do you need more information? There are other outputs for GPU, Memory, etc.

Well you removed all the important parts, so yea. pastebin.net it or something else.

Please define important. :slight_smile: I made a pastebin, hope you can open it: inxi --admin --verbosity=7 --filter --no-host - Pastebin.com

That’s an interesting one, what’s the output of ls /sys/devices/platform/asus-nb-wmi/

Thought so too. I already did ls -la after trying to probe the status, it’s just not there:

insgesamt 0
drwxr-xr-x 26 root root 0 18. Okt 15:49 .
drwxr-xr-x 23 root root 0 18. Okt 15:49 …
drwxr-xr-x 4 root root 0 18. Okt 15:49 AMDI0010:03
drwxr-xr-x 5 root root 0 18. Okt 15:49 AMDI0030:00
drwxr-xr-x 3 root root 0 18. Okt 15:49 ASUS2018:00
drwxr-xr-x 3 root root 0 18. Okt 15:49 ASUS9001:00
drwxr-xr-x 3 root root 0 18. Okt 15:49 ATK4002:00
drwxr-xr-x 3 root root 0 18. Okt 15:49 bootsplash.0
drwxr-xr-x 3 root root 0 18. Okt 15:49 efi-framebuffer.0
drwxr-xr-x 3 root root 0 18. Okt 15:49 efivars.0
drwxr-xr-x 3 root root 0 18. Okt 15:49 microcode
drwxr-xr-x 3 root root 0 18. Okt 15:49 MSFT0101:00
drwxr-xr-x 4 root root 0 18. Okt 15:49 pcspkr
drwxr-xr-x 3 root root 0 18. Okt 15:49 PNP0103:00
drwxr-xr-x 3 root root 0 18. Okt 15:49 PNP0C0C:00
drwxr-xr-x 3 root root 0 18. Okt 15:49 PNP0C0E:00
drwxr-xr-x 4 root root 0 18. Okt 15:49 PNP0C14:00
drwxr-xr-x 2 root root 0 19. Okt 11:05 power
drwxr-xr-x 4 root root 0 18. Okt 15:49 reg-dummy
drwxr-xr-x 3 root root 0 18. Okt 15:49 regulatory.0
drwxr-xr-x 3 root root 0 18. Okt 15:49 rtc-efi.0
drwxr-xr-x 4 root root 0 18. Okt 15:49 serial8250
drwxr-xr-x 3 root root 0 18. Okt 15:49 snd-soc-dummy
drwxr-xr-x 3 root root 0 18. Okt 15:49 sp5100-tco
-rw-r–r-- 1 root root 4096 18. Okt 15:49 uevent
drwxr-xr-x 5 root root 0 18. Okt 15:49 USBC000:00
drwxr-xr-x 3 root root 0 18. Okt 15:49 vboxdrv.0

This is all my content from /sys/devices/platform/

Huh? Why is asus-nb-wmi missing for you?? Can you load it using modprobe -v asus-nb-wmi?

My pleasure, welcome to my current ASUS notebook world. :slight_smile: It’s just not possible to probe it:

insmod /lib/modules/5.8.11-1-MANJARO/kernel/drivers/input/serio/i8042.ko.xz
modprobe: ERROR: could not insert ‘asus_nb_wmi’: No such device

Found something: a fix when adding the kernel parameter i8042.nopnp to grub, see Kernel 5.8.0 patches, Archlinux: No charge control with rog-core (#9) · Issues · ZappeL / ASUS ROG Zephyrus G14 · GitLab.
Don’t know exactly what that parameter does, pnp could stand for PlugNPlay though. After applying, rebuilding grub and checking to modprobe asus-nb-wmi there’s no error message anymore(!). What’s more, there is now the directory asus-nb-wmi with contents as follows on my machine:

drwxr-xr-x 5 root root 0 19. Okt 12:48 .
drwxr-xr-x 28 root root 0 19. Okt 12:48 …
–w------- 1 root root 4096 19. Okt 12:49 cpufv
lrwxrwxrwx 1 root root 0 19. Okt 12:48 driver -> …/…/…/bus/platform/drivers/asus-nb-wmi
-rw-r–r-- 1 root root 4096 19. Okt 12:49 driver_override
drwxr-xr-x 3 root root 0 19. Okt 12:48 hwmon
drwxr-xr-x 3 root root 0 19. Okt 12:48 input
-r–r--r-- 1 root root 4096 19. Okt 12:49 modalias
drwxr-xr-x 2 root root 0 19. Okt 12:49 power
lrwxrwxrwx 1 root root 0 19. Okt 12:48 subsystem -> …/…/…/bus/platform
-rw-r–r-- 1 root root 4096 19. Okt 12:48 throttle_thermal_policy
-rw-r–r-- 1 root root 4096 19. Okt 12:48 uevent

This really seemed to fix my issues as now I’m running BOINC and my frequency was capped at 399MHz when CPU temp hit 70C or more. Now it’s running at 80+C and no capping. :slight_smile: Pretty happy now! This CPU can go up to 105C according to official AMD documentation, so never understood the faulty behaviour anyways.

RE the WD NVMe SSD (possibly) in the FX505DY

Even with nvme_core.default_ps_max_latency_us=5500, I kept having intermittent issues with the trackpad and keyboard not working correctly. Sometimes it would work, sometimes it wouldn’t. In the LiveCD and in an installed environment. I finally got tired of it and just replaced the NVMe SSD with a SATA SSD and moved on with my life. Slower? Some, yes, but not so much that I really care. :man_shrugging: