Enabling switchable graphics on AMD and Nvidia Hybrid GPU in Asus Tuf series Laptops on Linux

Hi Gurus,

I have a hybrid GPU laptop with AMD Ryzen 5 3550H with Radeon Vega Mobile Gfx (8) and NVIDIA GeForce GTX 1650 Mobile / Max-Q. I have installed Mint Linux as primary OS with kernel version 5.3.0-45-generic and DM Cinnamon 4.4.8.
I have installed 435.21 proprietary drivers and this is the output below,
Device-1: NVIDIA TU117M [GeForce GTX 1650 Mobile / Max-Q] vendor: ASUSTeK driver: nvidia v: 435.21 bus ID: 01:00.0 chip ID: 10de:1f91
Device-2: Advanced Micro Devices [AMD/ATI] Picasso vendor: ASUSTeK driver: amdgpu v: kernel bus ID: 05:00.0
chip ID: 1002:15d8
Display: x11 server: X.Org 1.20.5 driver: amdgpu,ati unloaded: fbdev,modesetting,nouveau,nvidia,vesa
resolution: 1920x1080~60Hz
OpenGL: renderer: AMD RAVEN (DRM 3.33.0 5.3.0-45-generic LLVM 9.0.0) v: 4.5 Mesa 19.2.8 direct render: Yes

The below output from lspci -k,
01:00.0 VGA compatible controller: NVIDIA Corporation TU117M [GeForce GTX 1650 Mobile / Max-Q] (rev a1)
Subsystem: ASUSTeK Computer Inc. Device 10cf
Kernel driver in use: nvidia
05:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Picasso (rev c2)
Subsystem: ASUSTeK Computer Inc. Device 18f1
Kernel driver in use: amdgpu

The below output from nvidia-smi,

±----------------------------------------------------------------------------+
| NVIDIA-SMI 435.21 Driver Version: 435.21 CUDA Version: 10.1 |
|-------------------------------±---------------------±---------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 1650 Off | 00000000:01:00.0 Off | N/A |
| N/A 51C P0 3W / N/A | 0MiB / 3911MiB | 0% Default |
±------------------------------±---------------------±---------------------+

±----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| No running processes found |
±----------------------------------------------------------------------------+

the below output is from glxinfo,

OpenGL renderer string: AMD RAVEN (DRM 3.33.0, 5.3.0-45-generic, LLVM 9.0.0)

and xrandr --listproviders,

Provider 0: id: 0x54 cap: 0x9, Source Output, Sink Offload crtcs: 4 outputs: 1 associated providers: 0 name:Unknown AMD Radeon GPU @ pci:0000:05:00.0

output from prime-selector,

nvidia

Kindly help me to configure switchable graphics on this device.

AMD/Nvidia combos needs some minor manual tweaks with Ubuntu and descendants, please see this:
https://forums.developer.nvidia.com/t/nvidia-xconfig-doesnt-do-what-i-want-it-to-nor-does-nvidia-settings/107883/7?u=generix

Hi Generix,

Thanks a lot for the solution it worked.

Regards,
Raja