Results 1 to 4 of 4

Thread: Setup Guide 2020: Asus ROG Zephyrus GA502 Ryzen 7 3750H + Nvidia GTX 1660 Ti

  1. #1
    Join Date
    Feb 2018

    Setup Guide 2020: Asus ROG Zephyrus GA502 Ryzen 7 3750H + Nvidia GTX 1660 Ti

    After almost a year of owning my laptop I have come up with much better ways of using it. I have improved battery life, functionality, and speed. I worked very hard on this so please leave a thank you if this helped. I hope we can continue to make Asus ROG laptops more Linux friendly since they are great for the price.

    Original post:

    If you are thinking about buying this laptop for ANY GNU/Linux use DONT! (unless your okay with some compromise) There are better laptop options for maybe only $200 more.
    The GPU part of the guide should work on most if not all AMD/Nvidia hybrids.

    The full model name is: Asus-ROG-Zephyrus-G-GU502DU-GA502DU

    I can attest Ubuntu 19.04,19.10 and 20.04 LTS work great. I would recommend Ubuntu 20.04 since it uses Kernel 5.4, Has pre-installed drivers, and its LTS.

    Ubuntu works with some workarounds
    Battery life is great
    GPU is great
    System is quiet-ish when gaming
    Screen is great for the price.

    Keyboard special functions like back light controls and manual fan controls don't work
    The included Wi-Fi card is crap.
    The system can get very hot, leading to thermal thorttling to 400 Mhz after some gaming
    It has no webcam (but does any real GNU/Linux user care about that?!)

    You can now run scripts from This will help if you are concerend with messing somthing up manually. Thank you Saladhax!

    I will be using the command line and Nano for my text editor FYI. please be familar with it. If you cannout "write to a file" make sure you use Sudo.

    Out of the box, The system has only one major issue and that is the Realtek WiFi Driver. Follow this post here for fix - But here is the Answer anyway
    sudo apt-get install --reinstall git dkms build-essential linux-headers-$(uname -r)
    git clone
    cd rtl8821ce
    chmod +x
    chmod +x
    sudo ./
    For the Kernel config. I suggest putting the following in the /etc/default/grub after the word splash
     nouveau.modeset=0 tpm_tis.interrupts=0 acpi_osi=Linux i915.preliminary_hw_support=1 idle=nomwait

    You will need to install the Nvidia GPU driver if you do not have it already! The instructions change sometimes so I suggest doing a search on it. But its mostly just adding the graphics PPA and installing nvidia-utils-440 Once you follow the instructions and the driver as well as the xserver settings is installed go on to the next step.

     sudo add-apt-repository ppa:graphics-drivers/ppa
    Press enter to update the repos, then Install the latest Nvidia Driver. As of April, 2020
     sudo apt install nvidia-driver-440
    Then reboot

    So, here is the new thing that saves battery and allows the laptop to sleep! There is a new way to operate the GPUs. If your on the go, the best way is to do use the AMD Vega 10 with Nvidia GTX 1660 Ti as an GL/Vulkan offload card but that disables the USB-C DP Port or you can use the Nvidia card as the primary card for everything which enables the USB-C DP.

    So how do we go about setting this up? Lets go over the first part, Using the Nvidia as the primary card I will be following these instructions for the most part. This uses the PRIME feature of Xorg. It does not work with wayland
    Heres the original post on Nvidia Forums. I put the instructions here and made them more gamer/noob-friendly.
    Original Post:

    Make sure you have sudo ready since you will need it for most of this.
    Make sure this file does not exist /etc/X11/xorg.conf

    Edit /usr/share/X11/xorg.conf.d/10-amdgpu.conf
    as sudo and Replace
    Driver "amdgpu"
    Driver "modesetting"
    For faster AMD Acceleration, Put in the following in the Output Class, under the modesetting will work. This is optional and may use more battery life.
     Option "AccelMethod" "glamor"
    Option "DRI" "3"
    Save and exit

    inside the OutputClass of /usr/share/X11/xorg.conf.d/10-nvidia.conf
    Option "PrimaryGPU" "Yes"
    This makes Nvidia the primary GPU

    Save and exit.

    Create and edit

    [Desktop Entry]
    Exec=sh -c "xrandr --setprovideroutputsource modesetting NVIDIA-0; xrandr --auto"
    Do the same with this file below

    nano /usr/share/gdm/greeter/autostart/
    Save and exit the files

    nano /etc/X11/xorg.conf
    insert the code below in the file.

    Section "ServerLayout"
      Identifier "layout"
      Option "AllowNVIDIAGPUScreens"
    Reboot and when you login you should run
     glxinfo |grep "vendor"
    in a terminal and you should see
    server glx vendor string: NVIDIA Corporation
    client glx vendor string: NVIDIA Corporation
    OpenGL vendor string: NVIDIA Corporation
    Now to go into APU + Offload mode edit the /usr/share/X11/xorg.conf.d/10-nvidia.conf and comment out the Primary GPU Line Save the file. Then Log out and in again. But I suggest rebooting. You will use this file to switch between the APU + Nvidia Offload to Nvidia Only.

    You should be able to login. Run
     glxinfo |grep "vendor"
    and you should see
    server glx vendor string: SGI
    client glx vendor string: Mesa Project and SGI
    OpenGL vendor string: X.Org
    When you run this
    __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia glxinfo | grep vendor
    You should get
    server glx vendor string: NVIDIA Corporation
    client glx vendor string: NVIDIA Corporation
    OpenGL vendor string: NVIDIA Corporation
    Now you can run
    to use the GPU with steam and all of its child processes.

    Want the latest and greatest open source AMD Drivers? Add this PPA (This may cause issues but I haven't had any yet.)
     sudo add-apt-repository ppa:oibaf/graphics-drivers
    sudo apt-get dist-upgrade
    Okay here is the "hard" part. In order to get the thermal throttle issue fixed on the LTS Kernel we need to patch and build a Ubuntu Kernel from source

    First things first. we need to prepare our system so run these commands one at a time

    sudo apt-get install git build-essential kernel-package fakeroot libncurses5-dev
    cd ~
    mkdir kernel5.4-patched
    cd kernel5.4-patched/
    git clone git://
    (This will take a long time! do the next few steps while its doing it)

    open another terminal and cd ~/kernel5.4-patched/ubuntu-focal/

    type nano asus_wmi.patch and copy and paste the following (from into the file

    diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
    index f10ec9d745e5..469f1a852719 100644
    --- a/drivers/platform/x86/asus-wmi.c
    +++ b/drivers/platform/x86/asus-wmi.c
    @@ -1780,6 +1780,15 @@  static int throttle_thermal_policy_write(struct asus_wmi *asus)
         return 0;
    +static int throttle_thermal_policy_set_default(struct asus_wmi *asus)
    +    if (!asus->throttle_thermal_policy_available)
    +        return 0;
    +    asus->throttle_thermal_policy_mode = ASUS_THROTTLE_THERMAL_POLICY_DEFAULT;
    +    return throttle_thermal_policy_write(asus);
     static int throttle_thermal_policy_switch_next(struct asus_wmi *asus)
         u8 new_mode = asus->throttle_thermal_policy_mode + 1;
    @@ -2548,6 +2557,8 @@  static int asus_wmi_add(struct platform_device *pdev)
         err = throttle_thermal_policy_check_present(asus);
         if (err)
             goto fail_throttle_thermal_policy;
    +    else
    +        throttle_thermal_policy_set_default(asus);
         err = asus_wmi_sysfs_init(asus->platform_device);
         if (err)
    save and exit. Then enter nano asus_wmit.patch and copy and paste to create the second patch (from

    diff --git a/Documentation/ABI/testing/sysfs-platform-asus-wmi b/Documentation/ABI/testing/sysfs-platform-asus-wmi
    index 9e99f2909612..1efac0ddb417 100644
    --- a/Documentation/ABI/testing/sysfs-platform-asus-wmi
    +++ b/Documentation/ABI/testing/sysfs-platform-asus-wmi
    @@ -46,3 +46,13 @@  Description:
                 * 0 - normal,
                 * 1 - overboost,
                 * 2 - silent
    +What:        /sys/devices/platform/<platform>/throttle_thermal_policy
    +Date:        Dec 2019
    +KernelVersion:    5.6
    +Contact:    "Leonid Maksymchuk" <>
    +        Throttle thermal policy mode:
    +            * 0 - default,
    +            * 1 - overboost,
    +            * 2 - silent
    diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
    index 821b08e01635..f10ec9d745e5 100644
    --- a/drivers/platform/x86/asus-wmi.c
    +++ b/drivers/platform/x86/asus-wmi.c
    @@ -61,6 +61,7 @@  MODULE_LICENSE("GPL");
     #define NOTIFY_KBD_BRTDWN        0xc5
     #define NOTIFY_KBD_BRTTOGGLE        0xc7
     #define NOTIFY_KBD_FBM            0x99
    +#define NOTIFY_KBD_TTP            0xae
    @@ -81,6 +82,10 @@  MODULE_LICENSE("GPL");
     #define ASUS_FAN_BOOST_MODE_SILENT_MASK        0x02
     #define ASUS_FAN_BOOST_MODES_MASK        0x03
     #define USB_INTEL_XUSB2PR        0xD0
    @@ -198,6 +203,9 @@  struct asus_wmi {
         u8 fan_boost_mode_mask;
         u8 fan_boost_mode;
    +    bool throttle_thermal_policy_available;
    +    u8 throttle_thermal_policy_mode;
         // The RSOC controls the maximum charging percentage.
         bool battery_rsoc_available;
    @@ -1724,6 +1732,98 @@  static ssize_t fan_boost_mode_store(struct device *dev,
     // Fan boost mode: 0 - normal, 1 - overboost, 2 - silent
     static DEVICE_ATTR_RW(fan_boost_mode);
    +/* Throttle thermal policy ****************************************************/
    +static int throttle_thermal_policy_check_present(struct asus_wmi *asus)
    +    u32 result;
    +    int err;
    +    asus->throttle_thermal_policy_available = false;
    +    err = asus_wmi_get_devstate(asus,
    +                    &result);
    +    if (err) {
    +        if (err == -ENODEV)
    +            return 0;
    +        return err;
    +    }
    +    if (result & ASUS_WMI_DSTS_PRESENCE_BIT)
    +        asus->throttle_thermal_policy_available = true;
    +    return 0;
    +static int throttle_thermal_policy_write(struct asus_wmi *asus)
    +    int err;
    +    u8 value;
    +    u32 retval;
    +    value = asus->throttle_thermal_policy_mode;
    +    err = asus_wmi_set_devstate(ASUS_WMI_DEVID_THROTTLE_THERMAL_POLICY,
    +                    value, &retval);
    +    if (err) {
    +        pr_warn("Failed to set throttle thermal policy: %d\n", err);
    +        return err;
    +    }
    +    if (retval != 1) {
    +        pr_warn("Failed to set throttle thermal policy (retval): 0x%x\n",
    +            retval);
    +        return -EIO;
    +    }
    +    return 0;
    +static int throttle_thermal_policy_switch_next(struct asus_wmi *asus)
    +    u8 new_mode = asus->throttle_thermal_policy_mode + 1;
    +    asus->throttle_thermal_policy_mode = new_mode;
    +    return throttle_thermal_policy_write(asus);
    +static ssize_t throttle_thermal_policy_show(struct device *dev,
    +                   struct device_attribute *attr, char *buf)
    +    struct asus_wmi *asus = dev_get_drvdata(dev);
    +    u8 mode = asus->throttle_thermal_policy_mode;
    +    return scnprintf(buf, PAGE_SIZE, "%d\n", mode);
    +static ssize_t throttle_thermal_policy_store(struct device *dev,
    +                    struct device_attribute *attr,
    +                    const char *buf, size_t count)
    +    int result;
    +    u8 new_mode;
    +    struct asus_wmi *asus = dev_get_drvdata(dev);
    +    result = kstrtou8(buf, 10, &new_mode);
    +    if (result < 0)
    +        return result;
    +        return -EINVAL;
    +    asus->throttle_thermal_policy_mode = new_mode;
    +    throttle_thermal_policy_write(asus);
    +    return count;
    +// Throttle thermal policy: 0 - default, 1 - overboost, 2 - silent
    +static DEVICE_ATTR_RW(throttle_thermal_policy);
     /* Backlight ******************************************************************/
     static int read_backlight_power(struct asus_wmi *asus)
    @@ -2005,6 +2105,11 @@  static void asus_wmi_handle_event_code(int code, struct asus_wmi *asus)
    +    if (asus->throttle_thermal_policy_available && code == NOTIFY_KBD_TTP) {
    +        throttle_thermal_policy_switch_next(asus);
    +        return;
    +    }
         if (is_display_toggle(code) && asus->driver->quirks->no_display_toggle)
    @@ -2155,6 +2260,7 @@  static struct attribute *platform_attributes[] = {
    +    &dev_attr_throttle_thermal_policy.attr,
    @@ -2178,6 +2284,8 @@  static umode_t asus_sysfs_is_visible(struct kobject *kobj,
             devid = ASUS_WMI_DEVID_ALS_ENABLE;
         else if (attr == &dev_attr_fan_boost_mode.attr)
             ok = asus->fan_boost_mode_available;
    +    else if (attr == &dev_attr_throttle_thermal_policy.attr)
    +        ok = asus->throttle_thermal_policy_available;
         if (devid != -1)
             ok = !(asus_wmi_get_devstate_simple(asus, devid) < 0);
    @@ -2437,6 +2545,10 @@  static int asus_wmi_add(struct platform_device *pdev)
         if (err)
             goto fail_fan_boost_mode;
    +    err = throttle_thermal_policy_check_present(asus);
    +    if (err)
    +        goto fail_throttle_thermal_policy;
         err = asus_wmi_sysfs_init(asus->platform_device);
         if (err)
             goto fail_sysfs;
    @@ -2521,6 +2633,7 @@  static int asus_wmi_add(struct platform_device *pdev)
    diff --git a/include/linux/platform_data/x86/asus-wmi.h b/include/linux/platform_data/x86/asus-wmi.h
    index 60249e22e844..d39fc658c320 100644
    --- a/include/linux/platform_data/x86/asus-wmi.h
    +++ b/include/linux/platform_data/x86/asus-wmi.h
    @@ -58,6 +58,7 @@ 
     #define ASUS_WMI_DEVID_LIGHT_SENSOR    0x00050022 /* ?? */
     #define ASUS_WMI_DEVID_LIGHTBAR        0x00050025
     #define ASUS_WMI_DEVID_FAN_BOOST_MODE    0x00110018
     /* Misc */
     #define ASUS_WMI_DEVID_CAMERA        0x00060013
    Save and exit. Wait for git to finish downloading the kernel's code.

    Once done make sure you're in the ~/kernel5.4-patched/ubuntu-focal/ and that all the kernel source files are there along with our patch files. Now we patch the kernel with these commands. Do it in order. One at a time

    patch -p1 < asus_wmit.patch
    patch -p1 < asus_wmi.patch
    Next run cp /boot/config-`uname -r` .config to copy your current kernel config to the new one.
    Run make oldconfig To ensure that the config is setup properly. Press enter until its done.
    Run make menuconfig and make sure your terminal is large enough to show the program. Onces its loaded you can just exit out of it
    Run make clean to clean up any stray or unwanted files
    Finally, run make -j `getconf _NPROCESSORS_ONLN` deb-pkg LOCALVERSION=-patched you can put what you want after the - for example I used generic to keep things consistant.

    WARNING! This will compile our Kernel. IT MAY TAKE UP TO 2 HOURS! Be aware that the dpkg-deb may look like its stuck but it just takes a long time. Do not interupt it. Go grab a bite to eat or watch TV or somthing. You can keep using the laptop durring this but it will take a little longer.

    Once done run sudo dpkg -i ../*.deb and then wait I will need to rebuild the kernel modules such as the WiFI.
    To end it off, run sudo update-grub Then reboot

    If this is your newest kernel, It should be the top option. If not, go into Advance Options (under Ubuntu) and select our custom kernel

    If all goes well, You should be able to have temps below 50 dC and above 90 dC and not have any throttling issues. As well as fan control. To check sensors, Install psensor by running sudo apt install psensor
    and launch it with psensor (If you cannot find the sensor list you may need to drag it out from the left part of the window)

    Congrats! You just patched, compiled, and installed your very own custom kernel.

    Keyboard Backlight -

    Thanks to we can now control our keyboard backlight Run each line individually!

    git clone
    cd rogauracore 
    git checkout initialize_keyboard
    autoreconf -i 
    You can now run

    sudo ./rogauracore initialize_keyboard
    to initialize the keyboard and
    sudo ./rogauracore brightness 1
    to turn it on. This number can go up to 3.

    You will need to run this command at system startup in the rogauracore directory (most likley /home/rogauracore)
    sudo ./rogauracore initialize_keyboard
    If you are on Kernel 5.6 or newer, or have a patched kernel 5.4, you can now run
    echo 2 | sudo tee /sys/devices/platform/asus-nb-wmi/throttle_thermal_policy
    The number can be 0 for Balanced, 1 for turbo, and 2 for silent.

    Get more out of your Ryzen-
    Commands to keep handy
    sudo ./rogauracore initialize_keyboard #Prepares keyboard light. Run inside the ~/rogauracore direcory
    sudo ./rogauracore brightness 1 # can go up to 3
    echo 2 | sudo tee /sys/devices/platform/asus-nb-wmi/throttle_thermal_policy # 0 for Balanced, 1 for Turbo, and 2 for silent
    cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor # View CPU Govenor
    sudo bash -c 'for ((i=0;i<$(nproc);i++)); do cpufreq-set -c $i -g performance; done'   #Can be powersave, conservative, ondemand, userspace, or performance Each have their own benefits
     echo 0 | sudo tee /sys/devices/system/cpu/cpufreq/boost # 0 Disables turbo, 1 Enables Turbo.
    NOTE 0- I use GDM for my login screen and KDE as my main desktop. I also use GNOME sometimes. I suggest using GDM so all the scripts properly execute.

    NOTE 1- I tested both GNOME and KDE. My battery life has been increased by around 50% when i'm on the go (I now get around 6 hours when not gaming with 60% screen brightness). In my opinion the APU is powerful enough for most basic tasks and even HD gaming on the go. I use the Open Source AMD driver from Mesa. This has not been tested on Debian, PopOS or Mint but it should work if you get the proper drivers working. Gnome seems to have some issues with the HDMI

    NOTE 2- If you use any DisplayLink USB to VGA or docking station hardware you MUST use the Nvidia GPU in primary mode or else you will get some nasty lag. You also must install the driver with the Debian Displaylink installer on kernels newer than 5.3 (I am using 5.6.5 with no issues for the most part.)

    NOTE 3- INFO FOR THERMAL THROTTLING (5/2/2020)- I heard a rumor that new versions of Kernel 5.6 will be bringing a patch that will allow ASUS laptops to not throttle at 90 dC. When this upgrade comes out and I can prove it works (and wont break my system) I will update this Tutorial soon after! Personally, I run Kernel 5.6.5 (from Canonical) and still have the issue so we will see (possibly around kernel 5.7 release) what happens. I may also compile my own kernel from sources if I do not see it soon but hopfully it wont come to that (Its an easy, but long and boring process) I learned this from these two sources I DO NOT recommed you follow the instructions they provide (yet) I will update this tutorial if things work out.-

    NOTE 3 Update- The thermal throttling issue is fixed. I am running BIOS 302 with a patched kernel 5.4. I am assuming that you can use kernel 5.6 but it is not LTS so it will not be supported for long. My issue was that I had blacklist asus-nb-wmi inside of /etc/modprobe.d/blacklist.conf which should have been commented out. After that everything should work fine. If you want to use Kernel 5.4 from focal repos I will update this guide soon.

    Also when BestBuy opens back up in my area I will be taking my laptop in for "repair" (asus recommended me to)

    This is it for the tutorial. if you have anything to add feel free to add a comment. Anyone involved with this laptop should try to research the following. We're almost there to a perfect laptop!
    • Fan Control and Improving thermal issues //FIXED
    • Sleep Mode //(Mostly) FIXED
    • (Continue Improving) Battery life
    • Keyboard backlight // FIXED
    Last edited by andrewfer000; 3 Weeks Ago at 07:15 PM. Reason: Added Details

  2. #2
    Join Date
    Apr 2020

    Re: Setup Guide 2020: Asus ROG Zephyrus GA502 Ryzen 7 3750H + Nvidia GTX 1660 Ti

    as a beginner ubuntu user this helps me a lot. thank you very much for your help

  3. #3
    Join Date
    May 2013

    Re: Setup Guide 2020: Asus ROG Zephyrus GA502 Ryzen 7 3750H + Nvidia GTX 1660 Ti

    Thank you very much for such tutorial.

    For 20.04 the only difference is that you don't need the graphics drivers PPA. Newer Nvidia drivers versions are available in the main repositories already.

  4. #4
    Join Date
    Jun 2006
    Ubuntu 20.04 Focal Fossa

    Re: Setup Guide 2020: Asus ROG Zephyrus GA502 Ryzen 7 3750H + Nvidia GTX 1660 Ti

    Thread moved to Tutorials sub-forum.

    Tutorials Sub-forum – Guidelines
    Ubuntu 18.04 Desktop Guide - Ubuntu 20.04 Desktop Guide - Forum Guide to BBCode - Using BBCode code tags - IRC #ubuntuforums

    Member: Not Canonical Team

    Please do not PM me about your forum account unless you have been asked to. The correct place to contact an admin about your account is here.

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts