Ubuntu MATE 20.04 with RTX 3070 on Ryzen 5900 - black screen after boot

when I looked for the link, it doesn’t exist. How can i install the packages?

How did you install the kernel in the first place? Does
sudo apt install linux-headers-$(uname -r)
work? Otherwise, download
https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.12/amd64/linux-headers-5.12.0-051200-generic_5.12.0-051200.202104252130_amd64.deb
and install.

I installed it with these two commands:

wget https://raw.githubusercontent.com/pimlie/ubuntu-mainline-kernel.sh/
master/ubuntu-mainline-kernel.sh
sudo ubuntu-mainline-kernel.sh –i

was this wrong?
I tried the two methods that you have suggested and they didn’t work. The command gives the error:

Package linux-headers-5.12.0-051200-generic is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package ‘linux-headers-5.12.0-051200-generic’ has no installation candidate

the file doesn’t install because: " it has unmet dependencies"

I don’t know what that script installs or not.
Please post the ouput of

sudo dpkg -l |grep "5.12.0-051200"

I got this result:
ii linux-headers-5.12.0-051200 5.12.0-051200.202104252130 all Header files related to Linux kernel version 5.12.0
ii linux-image-unsigned-5.12.0-051200-generic 5.12.0-051200.202104252130 amd64 Linux kernel image for version 5.12.0 on 64 bit x86 SMP
ii linux-modules-5.12.0-051200-generic 5.12.0-051200.202104252130 amd64 Linux kernel extra modules for version 5.12.0 on 64 bit x86 SMP

So the script is not usable, it doesn’t install the needed generic headers.
try installing it from file using the --nodeps option.

I am sorry but I am not very experienced with these issues. This is what I got when I installed ignoring the dependencies:
sudo dpkg --ignore-depends=bar -i linux-headers-5.12.0-051200-generic_5.12.0-051200.202104252130_amd64.deb

Preparing to unpack linux-headers-5.12.0-051200-generic_5.12.0-051200.202104252130_amd64.deb …
Unpacking linux-headers-5.12.0-051200-generic (5.12.0-051200.202104252130) over (5.12.0-051200.202104252130) …
dpkg: dependency problems prevent configuration of linux-headers-5.12.0-051200-generic:
linux-headers-5.12.0-051200-generic depends on libc6 (>= 2.33); however:
Version of libc6:amd64 on system is 2.31-0ubuntu9.3.

dpkg: error processing package linux-headers-5.12.0-051200-generic (–install):
dependency problems - leaving unconfigured
Errors were encountered while processing:
linux-headers-5.12.0-051200-generic

So it looks like they weren’t configured. (the option --nodeps didn’t work with this command).how do i solve this?

Edit:
After installing ubuntu 21.04, every thing worked perfectly. The nvidia graphics worked by default and there was no need for a solution or a work around (no startup freeze or black screen). Thanks alot @generix !

Ok, that dependency conflict isn’t easily solvable, so you should rather remove the 5.12 kernel and use a working 5.11 where the headers are installable.
Easier would be simply installing/upgrading to Ubuntu 21.04 which has just been released and comes with the correct kernel and all ootb.

1 Like

It is kindly of tricky. I later downloaded ubuntu kernel version 5.10.14-051014-generic
and it worked with nvidia.
I will look for where I made the note and send you the procedure I took and got it solved.
Recently, I updated and started to have nvidia-smi issues but I found that nvidia driver is now updated to 465.xxx instead of nvidia-460.xxx.
Simply run on terminal
$ ubuntu-drivers
And you will see a list of nvidia driver available and the most recent.
The solution is that you have to download some ryzen drivers that were missing. Also upgrade your bios firmware.

1 Like

Kindly find attachments of the Ryzen firmwares i downloaded and the note describing what I did.
All you need to do is to copy them to /lib/firmware/amdgpu and make sure you change the file permissions.
If you are confused, you can call me via google meet and we can talk about it.

Asus_Ryzen_fix (1.32 KB)

green_sardine_me.bin (67.8 KB)

green_sardine_asd.bin (177 KB)

green_sardine_ce.bin (35.8 KB)

green_sardine_dmcub.bin (116 KB)

green_sardine_mec.bin (262 KB)

green_sardine_mec.bin (262 KB)

green_sardine_pfp.bin (83.8 KB)

green_sardine_rlc.bin (38 KB)

green_sardine_ta.bin (32.8 KB)

green_sardine_sdma.bin (17 KB)

green_sardine_vcn.bin (447 KB)

1 Like

Thanks alot @cekwonu!
I have download ubuntu 21.04 and thankfully so far i haven’t faced any problem. I will keep the files just in case i experience this issue again in the future. I appreciate the help!

@generix I’m trying it on Ubuntu 18, 5800H and RTX3070 laptop and follow the instructions in the post by @predte4a, but it doesn’t work.

  1. Update the kernel to 5.10.14
  2. Copy the files from https://people.freedesktop.org/~agd5f/radeon_ucode/gs/
    to /lib/firmware/amdgpu and set the permissions
  3. Download the module maunally from https://raw.githubusercontent.com/torvalds/linux/master/scripts/module.lds.S
    then rename it module.lds and cover /usr/src/linux-headers-5.10.14-051014-generic/scripts/module.lds
    Finally, run
    sudo sed -i '$ d' /usr/src/linux-headers-5.10.2-051002-generic/scripts/module.lds
  4. sudo update initramfs -u and restart computer, then Ubuntu system info reports “AMD Renoir” as graphics device.
    run
    sudo journalctl -b 0 --no-pager |grep kernel >kernel.txt
    kernel.txt (105.5 KB)

the output of glxinfo |grep OpenGL:

OpenGL vendor string: X.Org
OpenGL renderer string: AMD RENOIR (DRM 3.40.0, 5.10.14-051014-generic, LLVM 10.0.0)
OpenGL core profile version string: 4.6 (Core Profile) Mesa 20.0.8
OpenGL core profile shading language version string: 4.60
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.6 (Compatibility Profile) Mesa 20.0.8
OpenGL shading language version string: 4.60
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 20.0.8
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:
  1. sudo add-apt-repository ppa:graphics-drivers/ppa And install the NVIDIA driver from “system → preferences → hardware → additional drivers”
    the output of the commands:
$ dpkg -l |grep nvidia-prime
ii  nvidia-prime                                0.8.16~0.18.04.1                                 all          Tools to enable NVIDIA's Prime
$ dpkg -l |grep ubuntu-drivers-common
ii  ubuntu-drivers-common                       1:0.5.2.5                                        amd64        Detect and install additional Ubuntu driver packages

run
sudo journalctl -b 0 --no-pager |grep kernel >kernel_2.txt
kernel_2.txt (126.1 KB)
run
sudo nvidia-bug-report.sh
nvidia-bug-report.log.gz (104.3 KB)

The instructions are outdated and don’t work anymore since the upstream script changed.
Please install a 5.11 kernel, and skip the 3rd step.

@generix The bad news is that when I install the 5.11 + kernel, the black screen crashes in a few seconds, and I enter the recovery mode, run sudo journalctl -b 0 --no-pager |grep kernel >kernel.txt
kernel.txt (118.4 KB)

If I want to install the 5.11.12 + kernel, the following error will appear
5.11.19.log (3.2 KB)

 linux-headers-5.11.19-051119-generic depends on libc6 (>= 2.33); however:
  Version of libc6:amd64 on system is 2.27-3ubuntu1.2.

dpkg: error processing package linux-headers-5.11.19-051119-generic (--install):
 dependency problems - leaving unconfigured

@generix
I tried to manually compile the 5.12.2 kernel and install it, but after a few seconds of displaying the desktop, the screen blacked out and did not respond
So I entered the recovery mode with network, run
sudo ubuntu-drivers autoinstall
reboot and It’s amazing that he can get into the system!

demo@demo-OMEN-Laptop-15-en1xxx:~$ nvidia-smi
Thu May 13 13:19:54 2021       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 460.73.01    Driver Version: 460.73.01    CUDA Version: 11.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  GeForce RTX 307...  Off  | 00000000:01:00.0 Off |                  N/A |
| N/A   41C    P8    11W /  N/A |      5MiB /  7982MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      1739      G   /usr/lib/xorg/Xorg                  4MiB |
+-----------------------------------------------------------------------------+
demo@demo-OMEN-Laptop-15-en1xxx:~$ glxinfo |grep OpenGL
si_init_perfcounters: max_sh_per_se = 2 not supported (inaccurate performance counters)
OpenGL vendor string: X.Org
OpenGL renderer string: AMD RENOIR (DRM 3.40.0, 5.12.2, LLVM 10.0.0)
OpenGL core profile version string: 4.6 (Core Profile) Mesa 20.0.8
OpenGL core profile shading language version string: 4.60
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.6 (Compatibility Profile) Mesa 20.0.8
OpenGL shading language version string: 4.60
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 20.0.8
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:

But the problem is that system > details > graphics still shows amd Renoir
Here is the new kernel log:
kernel.txt (138.1 KB)

In addition, the touchpad is not available at this time. I think this is another problem

You are now in “on-demand” aka render offload mode. to run something on the nvidia gpu prepend

__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia

e.g.

__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia glxinfo | grep vendor

To switch to nvidia always, run
sudo prime-select nvidia
and reboot.
Since it’s now fiddly to find a matching kernel, this procedure is not recommended anymore, rather install Ubuntu 21.04 which works ootb.

Still having this issue on a Strix G513QM 2021 model (RTX 3060, Ryzen 5800H) sadly, even after following all the instructions. Been trying to get everything installed for around 3 days now with no luck. Either I have the issue of the keyboard prompting a shutdown menu on every keypress, black screen on boot or Nvidia drivers failing to install at all. Tried Ubuntu 20.04, 21.04, Mint 20.04. Tried kernels from the default install all the way through to 5.12.1 with no joy, mostly trying 5.11.6 to 5.11.13.

I believe that I’ve followed all the instructions on here, and on Fixing black screen and keyboard shutdown issues on an ASUS ROG Strix Scar 2021 laptop in Ubuntu 20.04 LTS | by Liam Frappell | Medium to the letter where possible.

My general install method is to disable fast boot / secure boot then install Ubuntu 20.04 in safe graphics mode + nouveau.modeset=0 (otherwise the installer runs at 800x600 resolution and cuts half the screen off).

sudo apt update / sudo apt upgrade - reboot. Boot in nouveau.modeset=0 again and update kernel ( 5.11.13 most commonly) - reboot - sudo cp all files from Index of /~agd5f/radeon_ucode/gs to /lib/firmware/amdgpu and check chmod / chown matches - run the module.lds script on correct kernel version and then update initramfs - reboot and install 460 from additional drivers menu.

This installs the drivers, but the keyboard still prompts shutdown on every press (amd/nvidia driver install should have fixed it).

Installing Ubuntu 21.04 (which includes 5.11.x out of the box, which should have fixed the keyboard issue) has the same result! Drivers install, with some force, but keyboard still causes the shut down prompt to appear. Also tried 5.12.x and the new 5.13 rc kernel with the same issue

1 Like

Hi Figen, I believed we share the same laptop model, I have been trying to solve the same issue as well, below are the steps i used to get the gpu driver up, however i still have no luck on the keyboard shutdown issue:

  1. fresh install ubuntu 20.04
  2. go to Index of /~kernel-ppa/mainline/v5.12-rc2 install the amd64 version of 5.12-rc2
  3. update nvidia driver through the additional driver gui
  4. do a reboot
    When i run nvidia-smi, it shows that my gpu is in operation, however i still do not have an answer to the keyboard , hopefully someone here can help with this.

TIA.

1 Like

I am on pop os 21.04 and did the fixes above but with driver 465.24.02 and kernel 5.11.0-7614-generic. Then disabled my power button. This is a short term fix but it allows me to use my keyboard again (albeit slow) and my graphics card is working in all modes including hybrid and compute.

Edit: My laptop is an Asus G513QM

1 Like

I have the same problem as @Figen and @waihongtan on Asus G513QM.
thrancat’s short term fix was helpful but i’m still waiting for a fix to this bug…

1 Like