Glxinfo OpenGL shows llvmpipe instead of nvidia; also driver 460 produce black screen for Ubuntu 18.04

Hi, I just dualboot installed Ubuntu 18.04 on a newly bought laptop ROG Zephyrus G15 GA502IV-HN070T. The laptop is with AMD R9 4900HS and GeForce® RTX 2060 with Max-Q Design 6GB DDR 6 GPU.

My problem

I needed OpenGL 4.6+ but my OpenGL is only 3.3, even I have installed nvidia driver, the OpenGL version is still 3.3.

Information that I think could be relevant:

At first when I installed ubuntu, it shown a black screen instead of GUI. I tried to add nouveau.modeset=0 next to “… quiet splash” in grub boot menu and then press F10, I can enter the ubuntu GUI. But after I installed nvidia driver 460 in “Software and Update → Additional Driver” and reboot, it shows the black screen again. This time I cannot use the nouveau.modeset=0 to enter the ubuntu GUI.

Then I tried to reinstall ubuntu again. after using nouveau.modeset=0 to enter the ubuntu GUI, I choose to install nvidia driver 450 this time, after reboot I can enter the ubuntu GUI successfully. nvidia-smi is also giving me correct info. Not sure if the driver version is related to this glxinfo issue but driver 450 is the only working driver so I cant test it out.

$ uname -r
5.4.0-65-generic
$ nvidia-smi
Sun Feb  7 03:18:59 2021       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 450.102.04   Driver Version: 450.102.04   CUDA Version: 11.0     |
|-------------------------------+----------------------+----------------------+
| 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 206...  Off  | 00000000:01:00.0 Off |                  N/A |
| N/A   44C    P8     3W /  N/A |     11MiB /  5934MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      1178      G   /usr/lib/xorg/Xorg                  4MiB |
|    0   N/A  N/A      1678      G   /usr/lib/xorg/Xorg                  4MiB |
+-----------------------------------------------------------------------------+

$ inxi -G
Graphics:  Card-1: NVIDIA Device 1f12
           Card-2: Advanced Micro Devices [AMD/ATI] Device 1636
           Display Server: x11 (X.Org 1.20.8 )
           drivers: nvidia,fbdev,ati (unloaded: modesetting,vesa,radeon,nouveau)
           Resolution: 1920x1080@77.00hz
           OpenGL: renderer: llvmpipe (LLVM 10.0.0, 128 bits)
           version: 3.3 Mesa 20.0.8

$ glxinfo | grep OpenGL
OpenGL vendor string: VMware, Inc.
OpenGL renderer string: llvmpipe (LLVM 10.0.0, 128 bits)
OpenGL core profile version string: 3.3 (Core Profile) Mesa 20.0.8
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.1 Mesa 20.0.8
OpenGL shading language version string: 1.40
OpenGL context flags: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.1 Mesa 20.0.8
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10
OpenGL ES profile extensions:
: OpenGL ES 3.1 Mesa 20.0.8
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10
OpenGL ES profile extensions:

Thanks in advance for your help.
I have been dealing with this issue for a week, reinstalling nvidia driver for 20+ times.
nvidia-bug-report.log.gz (344.7 KB)

Ubuntu 18.04 isn’t really the best choice for your system, the kernel 5.4 it provides doesn’t support your amd gpu. Any requirements not running latest Ubuntu?

Thanks for the useful info that it is not supported.
I was trying to use Kinect Azure on Ubuntu (because it seems they only support Ubuntu 18.04 officially). But it seems it is possible to run on 20.04 as well.

I just tried to install Ubuntu 20.04 and now the nvidia driver is displaying 460 and glxinfo also giving me OpenGL 4.6. Thanks!