AMD ryzen 7 and nvidia gtx. Driver doesn't detect HDMI port / Super-high battery consumption when using nvidia driver

I’m using the 435 driver in ubuntu 18.04 and the computer doesn’t detect hdmi ports so I can’t use dual screen.
I am also concerned about the dual graphics and the energy consumption, for the battery life is far from the promised by the manufacturer even with a tlp.

nvidia-bug-report.log.gz (1.11 MB)

Your logs are flooded with info messages from the wifi adapter, an rtl8821ce, where did you get the driver for it? It prevents me from seeing the init messages from your amd and nvidia gpus so I can only give you the generic instructions for your hw:
https://devtalk.nvidia.com/default/topic/1063152/linux/problem-with-dedicated-gtx-1660ti-gpu-in-asus-fx505d/post/5383928/#5383928
Since that log flood leads to disk thrashing, you should look into silencing it.

I got it from github, but if you recommend to purge it and get another one where sohuld I look?

This one?
https://github.com/tomaspinho/rtl8821ce
In that case, edit the Makefile changing

CONFIG_RTW_LOG_LEVEL = 4

to

CONFIG_RTW_LOG_LEVEL = 2

and reinstall it. That should change the loglevel from info to errors only.

Yes, that’s the one, the only one I could find for the rtl8821ce.
Thank you, I’ll do as you say and update a new bug-report

I switched to driver 430 an followed your instructions.
Here’s the new bug report with the lower log level of the network driver.
nvidia-bug-report.log.gz (1.11 MB)

Ok, you just added “Option PrimaryGPU” to the wrong file, please remove that from the amdgpu config file and add it to /usr/share/X11/xorg.conf.d/10-nvidia.conf

Ok, i returned the /usr/share/X11/xorg.conf.d/10-amdgpu.conf to:

Section “OutputClass”
Identifier “AMDgpu”
MatchDriver “amdgpu”
Driver “amdgpu”

EndSection

And made /usr/share/X11/xorg.conf.d/10-nvidia.conf to be:

Section “OutputClass”
Identifier “nvidia”
MatchDriver “nvidia-drm”
Driver “nvidia”
Option “AllowEmptyInitialConfiguration”
ModulePath “/usr/lib/x86_64-linux-gnu/nvidia-430/xorg”
Option “PrimaryGPU” “Yes”
EndSection

Now I have a cursor duplicate in the screen.

The one in the bottom right doesn’t do a thing, but it won’t disapear even when rebooting or turning off the computer

Now you reverted the needed change to the amdgpu file,
Driver “modesetting”

Done, but the hdmi port is sstill not detected and the battery consumption rates didn’t change at all.

Please create a new nvidia-bug-report.log in the current state.

Here
nvidia-bug-report.log.gz (1.13 MB)

You need to concentrate yourself a little bit more, now you added a typo:
Option “PrymaryGPU” “Yes”
should be
Option “PrimaryGPU” “Yes”

Thank you, but still, after correcting it, nothing changed.

Edit: Now the xrandr detects an HDMI port but says it’s disconnected even if it is connected.

Please create a new nvidia-bug-report.log in the current state.

Here, this time I couldn’t run the “startx – -logverbose 6” because it crashes.

Edit: The crash:
$ ls -l /var/crash

total 3692
-rw-r----- 1 root whoopsie 3779371 sep 28 18:23 _usr_lib_xorg_Xorg.0.crash

nvidia-bug-report.log.gz (1.13 MB)

startx doesn’t work when in prime mode without changes to the Xsession config, so ignore that.
Otherwise, looks fine so far, the HDMI port not working might be either due to a broken cable or GDM starting a wayland session for the login. Please try:
https://askubuntu.com/questions/975094/how-to-disable-wayland-in-17-10-in-gdm3-login-screen
if that doesn’t help, try:
run

grep modeset /etc/modprobe.d/* /lib/modprobe.d/*

to find the file containing

options nvidia-drm modeset=1

and change it to

options nvidia-drm modeset=0

then run

sudo update-initramfs -u

and reboot.

It doesn’t appear to exist such line, I’ve searched for both “nvidia-drm” and for “modeset” and grep doesn’t find anything

Edit: The HDMI works only in one port (1 in the PC and 3 in the TV) but is all I need. Thank you very much for your guidance. It was driving me mad and I wouldn’t have been able to solve it without your instructions.
Thank you once again generix

All the best