Fixing black screen and keyboard shutdown issues on an ASUS ROG Strix Scar 2021 laptop in Ubuntu 20.04 LTS

Liam Frappell
5 min readMar 15, 2021

--

The following describes the steps to fix a problem with Ubuntu Linux running on the ASUS ROG Strix laptops, with modern Ryzen 5000 series CPU’s and NVIDIA RTX 3000 series GPU’s. I haven’t tested it on other ROG Strix laptops, but I believe it should be relevant for all of these recent laptops with 2021 hardware. This may work for existing Ubuntu installs, but I don’t recommend it due to potential driver conflicts.

We recently bought a new 2021 ASUS ROG Strix Scar laptop for one of our AI Developers— it’s a compact “beast”, with an AMD Ryzen 5900 processor and a NVIDIA RTX 3080 GPU — Our AI Developer needed the 16GB of VRAM for AI Model training.

Unfortunately, ASUS doesn’t officially provide Linux support (for this laptop, or any, from a quick google). This caused a slew of issues —Just installing Ubuntu 20.04 LTS , our developers distro of choice was an issue due to a resolution bug.

Once we had a “working” install, hitting any key on the laptop keyboard would cause a soft shutdown, as if you hit the dedicated shutdown button, in both a terminal and in gnome3 (the default GUI). We were able to use an external keyboard and mouse — but this led to our next issue — installing the latest proprietary NVIDIA drivers (nvidia-driver-460, required for utilizing CUDA, training AI models, and nearly everything we do) causes an X.org crash on startup and dumping you into a terminal.

Installing an older NVIDIA driver — I tried 430, 440 and 450 — would “fix” this problem, but a quick check with nvidia-smi in a console shows that the Graphics card isn’t correctly detected — this makes sense, as at the time of writing the NVIDIA RTX 30 series is less then 6 months old, and the two latest drivers (455 and 460) are the only officially supported versions.

The generic open-source nouveau drivers worked, but at the cost of no CUDA which defeats the purpose of this laptop.

Quite a pickle.

A note on Fast/Secure boot

Secureboot doesn’t always play well with Linux installs. Fast boot can also cause issues.

If you plan to dual boot, you may need to leave one or both of these enabled.

Typically, I would install partition drives, install windows, and then install Linux in that order. In this case, Windows isn’t required, so I disabled both and continued with my day.

Ubuntu installer issues

First things first — Installing Ubuntu was troublesome. The installer only picked up one resolution, 800 x 600, which makes installation difficult due to the small fact that the buttons to proceed don’t fit in the window, and moving or resizing the window is impossible. I wasn’t able to improve the resolution from the installer, but some investigation indicates you could also change the default installer settings — I didn’t test this, and as the issue is a driver one, I’m not convinced it will work.

To fix the problem, select “Install Ubuntu (Safe Graphics)” at the GRUB boot menu for the installer. Press “e”, and add nouveau.modeset=0 to the end of the line starting with “linux”, and boot into the installer. From here, you can install as normal. Don’t install any NVIDIA drivers yet.

You should have a “working” install now, with the all keyboard buttons cause shutdown issue.

You should switch to a USB keyboard and potentially mouse, although the track-pad on our machine wasn’t causing issue. You could also use the onscreen keyboard if you don’t have a USB keyboard.

I did an sudo apt update and sudo apt upgrade at this stage to ensure all packages are up to date.

Post install Kernel madness

Support for NVIDIA and Ryzen 5000 series processors isn’t in the default linux kernel that ships with the current Ubuntu LTS (20.04, kernel 5.8.x-generic), so you need to install a kernel later then 5.11.x. I installed 5.11.6.

First, check your kernel version with uname -r. If you’re already on ≥ 5.11.x then you should skip this step.

Installing a new kernel under Ubuntu is surprisingly easy. You need to download 4 .deb files from https://kernel.ubuntu.com/~kernel-ppa/mainline/ based on your chosen kernel version and target architecture (amd64, for this install): linux-headers, linux-image, linux-modules and the linux-headers-*_all.deb. I used the generic versions.

Once you have these downloaded, copy them to a folder, cd to it (It should just contain all 4 .deb files) and run sudo dpkg -i *.deb to install the new kernel.

You can reboot to confirm this was successful — using another uname -r — if it wasn’t you can always select advance options at the GRUB launcher, and choose the older kernel, clean the kernel files and try again before proceeding to the next step.

Keep note of your exact kernel version from uname with generic if applicable, you’ll need it later.

AMD and NVIDIA patch

These steps came from the NVIDIA developer forums — shoutout to @generix: https://forums.developer.nvidia.com/t/ubuntu-mate-20-04-with-rtx-3070-on-ryzen-5900-black-screen-after-boot/167681/30

You can follow the steps there, or I’ll repeat them here for clarity.

Download all .bin files from https://people.freedesktop.org/~agd5f/radeon_ucode/gs/ and move them to the /lib/firmware/amdgpu directory on your new install. You should double check they have the same permissions as all other files in that directory — mine did by default (I did a sudo cp downloadedFiles/* /lib/firmware/amdgpu, you can quickly check with a long file list ls -l /lib/firmware/amdgpu and check for permissions consistency).

Download the following script with this command. You need to replace the kernel version with the one you installed and noted earlier: sudo wget https://raw.githubusercontent.com/torvalds/linux/master/scripts/module.lds.S -O /usr/src/linux-headers-5.10.2–051002-generic/scripts/module.lds

Then run the following, also replacing the kernel version with the one you are using with sudo sed -i ‘$ d’ /usr/src/linux-headers-5.10.2–051002-generic/scripts/module.lds

Next, update your root filesystem with the patches with sudo update-initramfs -u

If successful, reboot. The laptop keyboard still causes a soft shutdown, but we’re getting somewhere.

NVIDIA Drivers Install (Finally)

Super close now, you just need to install the Proprietary NVIDIA drivers.

Add the graphics card repo with sudo add-apt-repository ppa:graphics-drivers/ppa

Next, install the latest driver. APT couldn’t find the latest by default, so I just used the default GUI software updater, changed to the “Additional drivers” tab and selected “Proprietary NVIDIA driver”. Once the drivers install, you can safely reboot.

Some internet users suggested sudo ubuntu-drivers install , which I didn’t try. While testing additional driver versions, I used sudo apt install nvidia-driver-460 , replacing 460 with your preferred version, but I wouldn’t recommend playing with this at this early stage of the NVIDIA RTX 30 series release.

Finishing Up

Upon rebooting, the keyboard should magically start working again without causing a soft shutdown. Our AI developer reports that the setup is working just fine, with only one outstanding issue — if the screen goes to sleep at the login screen, the display lags a little. Logging in clears this up.

This was a tedious, and fun problem to solve. Hopefully, with future updates to Ubuntu and NVIDIA drivers, this won’t be necessary.

Shout-out to the NVIDIA Developers forum and Linux kernel team for the fix.

--

--