Hybrid Graphics Troubles: Round 2

Questions about hardware, drivers and peripherals
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
Luxdragon
Level 2
Level 2
Posts: 50
Joined: Sat Feb 01, 2020 10:15 am

Hybrid Graphics Troubles: Round 2

Post by Luxdragon »

Greetings,

I have a series of new problems that I stumbled upon once I switched from LM19.3 to LM20.

On LM19.3 I had no HDMI output on my hybrid graphics laptop (Nvidia GeForce 1650 with AMD integrated graphics), but the issue was solved in this thread: viewtopic.php?t=316110

This time around I have more problems. Firstly when I boot Linux Mint, the logo shows, but is then followed by a black screen. Unless I load LM through recovery mode, I cannot boot the OS. This is very troublesome, because booting through recovery mode also disables hardware acceleration. Nvidia X Server Settings are empty.
Image

If I enter the following commands into

Code: Select all

sudo prime-select nvidia
and then reboot, the Nvidia profile is selected, but nothing has changed and Nvidia settings remain empty. Entering

Code: Select all

sudo prime-select intel
and rebooting also changes nothing. Linux Mint 20 has graphics switching support, but I can't access any of these new services.

Interesting Observation:

When I boot my laptop and connect it to the TV via HDMI, the Linux Mint logo can be seen both on my laptop and TV screen, after that both the TV and my laptop are left with a black screen.

System information:

Code: Select all

inxi -Fxxxz

Code: Select all

System:
  Kernel: 5.4.0-40-generic x86_64 bits: 64 compiler: gcc v: 9.3.0 
  Desktop: Cinnamon 4.6.6 wm: muffin 4.6.2 dm: LightDM 1.30.0 
  Distro: Linux Mint 20 Ulyana base: Ubuntu 20.04 focal 
Machine:
  Type: Laptop System: ASUSTeK product: TUF Gaming FX705DT_FX705DT v: 1.0 
  serial: <filter> 
  Mobo: ASUSTeK model: FX705DT v: 1.0 serial: <filter> 
  UEFI: American Megatrends v: FX705DT.310 date: 12/24/2019 
Battery:
  ID-1: BAT0 charge: 21.8 Wh condition: 59.3/67.0 Wh (89%) volts: 14.4/16.3 
  model: FX70542 type: Li-ion serial: <filter> status: Discharging 
CPU:
  Topology: Quad Core model: AMD Ryzen 7 3750H with Radeon Vega Mobile Gfx 
  bits: 64 type: MT MCP arch: Zen+ rev: 1 L2 cache: 2048 KiB 
  flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm 
  bogomips: 36731 
  Speed: 1222 MHz min/max: 1400/2300 MHz boost: enabled Core speeds (MHz): 
  1: 1222 2: 1223 3: 1256 4: 1394 5: 1270 6: 1222 7: 1265 8: 1274 
Graphics:
  Device-1: NVIDIA TU117M [GeForce GTX 1650 Mobile / Max-Q] vendor: ASUSTeK 
  driver: nvidia v: 440.100 bus ID: 01:00.0 chip ID: 10de:1f91 
  Device-2: AMD Picasso vendor: ASUSTeK driver: N/A bus ID: 05:00.0 
  chip ID: 1002:15d8 
  Display: x11 server: X.Org 1.20.8 driver: ati,fbdev 
  unloaded: modesetting,nouveau,nvidia,radeon,vesa 
  resolution: 1920x1080~77Hz 
  OpenGL: renderer: llvmpipe (LLVM 10.0.0 128 bits) v: 3.3 Mesa 20.0.8 
  compat-v: 3.1 direct render: Yes 
Audio:
  Device-1: NVIDIA vendor: ASUSTeK driver: snd_hda_intel v: kernel 
  bus ID: 01:00.1 chip ID: 10de:10fa 
  Device-2: AMD Family 17h HD Audio vendor: ASUSTeK driver: snd_hda_intel 
  v: kernel bus ID: 05:00.6 chip ID: 1022:15e3 
  Sound Server: ALSA v: k5.4.0-40-generic 
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet 
  vendor: ASUSTeK driver: r8169 v: kernel port: e000 bus ID: 02:00.0 
  chip ID: 10ec:8168 
  IF: enp2s0 state: down mac: <filter> 
  Device-2: Realtek RTL8821CE 802.11ac PCIe Wireless Network Adapter 
  vendor: AzureWave driver: rtl8821ce v: v5.5.2.1_35598.20191029 port: d000 
  bus ID: 04:00.0 chip ID: 10ec:c821 
  IF: wlp4s0 state: up mac: <filter> 
Drives:
  Local Storage: total: 476.94 GiB used: 17.12 GiB (3.6%) 
  ID-1: /dev/nvme0n1 vendor: Intel model: SSDPEKNW512G8 size: 476.94 GiB 
  speed: 31.6 Gb/s lanes: 4 serial: <filter> rev: 002C scheme: GPT 
Partition:
  ID-1: / size: 110.50 GiB used: 17.09 GiB (15.5%) fs: ext4 
  dev: /dev/nvme0n1p5 
Sensors:
  System Temperatures: cpu: 46.6 C mobo: N/A 
  Fan Speeds (RPM): cpu: 2400 
Info:
  Processes: 258 Uptime: 16m Memory: 15.14 GiB used: 1.72 GiB (11.4%) 
  Init: systemd v: 245 runlevel: 5 Compilers: gcc: 9.3.0 alt: 9 Shell: bash 
  v: 5.0.16 running in: gnome-terminal inxi: 3.0.38
Link to

Code: Select all

cat /var/log/Xorg.0.log | nc termbin.com 9999
is available on: https://termbin.com/0of0

Any help would be greatly appreciated, because this issue seriously hinders comfortable usage.

Kind regards
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
roblm
Level 15
Level 15
Posts: 5939
Joined: Sun Feb 24, 2013 2:41 pm

Re: Hybrid Graphics Troubles: Round 2

Post by roblm »

Did you do all the other steps in your other topic, which were to edit the 10-nvidia.conf and 10-amdgpu.conf files?

What is the output of this command: xrandr --listproviders
User avatar
Luxdragon
Level 2
Level 2
Posts: 50
Joined: Sat Feb 01, 2020 10:15 am

Re: Hybrid Graphics Troubles: Round 2

Post by Luxdragon »

I edited the 10-nvidia.conf and 10-amdgpu.conf files. If I sudo prime-select nvidia my laptop screen becomes black and I can only access my desktop via HDMI on some external screen - also the colours on the external screen are worse than in LM19.3. If I sudo prime-select intel the desktop loads normally on my laptop screen, but there is no HDMI output. In neither configuration can I find the Nvidia Optimus applet.

My PC also won't boot with either configuration, I can only access LM20 through recovery mode.
$xrandr --listproviders
Providers: number : 0
User avatar
roblm
Level 15
Level 15
Posts: 5939
Joined: Sun Feb 24, 2013 2:41 pm

Re: Hybrid Graphics Troubles: Round 2

Post by roblm »

I suggest you try another method. Reverse the changes you made to the 10-nvidia.conf and 10-amdgpu.conf files. This method is similar but not exactly the same as a method you tried in the other topic.

Open the File Manager. Create a document in Home (/home/your-user-name) named .login and add these lines:

Code: Select all

xrandr --setprovideroutputsource amdgpu NVIDIA-0
xrandr --auto
Right click on the file and select Properties > Permissions. Mark the checkbox next to Allow executing file as program.

Open the 70-linuxmint.conf file: xed admin:///etc/lightdm/lightdm.conf.d/70-linuxmint.conf

Add this line: display-setup-script=/home/your-user-name/.login, changing your-user-name to your actual user name.

Create an xorg.conf file: sudo touch /etc/X11/xorg.conf

Open the file for editing: xed admin:///etc/X11/xorg.conf

Add these lines:

Code: Select all

Section "ServerLayout"
    Identifier "layout"
    Screen 0 "nvidia"
    Inactive "amdgpu"
EndSection

Section "Device"
    Identifier "nvidia"
    Driver "nvidia"
    BusID  "PCI:1:0:0"
EndSection

Section "Screen"
    Identifier "nvidia"
    Device "nvidia"
    Option "AllowEmptyInitialConfiguration"
EndSection

Section "Device"
    Identifier "amdgpu"
    Driver "amdgpu"
    BusID  "PCI:5:0:0"
EndSection

Section "Screen"
    Identifier "amdgpu"
    Device "amdgpu"
EndSection
Reboot.

If there is a problem getting back to the desktop, then press Ctrl+Alt+F1 to enter virtual console tty1. Use this command to remove the xorg.conf file and reboot: sudo rm /etc/X11/xorg.conf; reboot
User avatar
Luxdragon
Level 2
Level 2
Posts: 50
Joined: Sat Feb 01, 2020 10:15 am

Re: Hybrid Graphics Troubles: Round 2

Post by Luxdragon »

Done everything as stated above. After the Linux Mint logo the result was only a blinking underscore. After deleting /etc/X11/xorg.conf in tty and rebooting, the screen was black again.
User avatar
roblm
Level 15
Level 15
Posts: 5939
Joined: Sun Feb 24, 2013 2:41 pm

Re: Hybrid Graphics Troubles: Round 2

Post by roblm »

Repeat the previous steps but change this line:

Code: Select all

xrandr --setprovideroutputsource amdgpu NVIDIA-0
To this:

Code: Select all

xrandr --setprovideroutputsource 1 0
User avatar
Luxdragon
Level 2
Level 2
Posts: 50
Joined: Sat Feb 01, 2020 10:15 am

Re: Hybrid Graphics Troubles: Round 2 [SOLVED]

Post by Luxdragon »

Eureka!

It works and not just that it works even better than on Linux Mint 19.3. I can finally boot into Linux Mint again, both LightDM and the desktop display normally on my screen, hardware acceleration works, here is HDMI output at all times and the Nvidia X Server settings work again. Awesome!

I have just one side question; How do I use/activate the Nvidia Optimus applet as described here: https://www.linuxmint.com/rel_ulyana_cinnamon_whatsnew.php? I don't see the "Run with Nvidia GPU" option when right-clicking on programmes. But that's just a flashy extra in case you know, either way you helped me a ton.

Thanks a lot!
User avatar
roblm
Level 15
Level 15
Posts: 5939
Joined: Sun Feb 24, 2013 2:41 pm

Re: Hybrid Graphics Troubles: Round 2 [SOLVED]

Post by roblm »

Luxdragon wrote: I have just one side question; How do I use/activate the Nvidia Optimus applet as described here: https://www.linuxmint.com/rel_ulyana_cinnamon_whatsnew.php?
That link doesn't work. That applet is for Optimus laptops (Intel+Nvidia). It may work if you could configure your system the way it was done for Mint 19.3, by changing the amdgpu driver to modesetting in the 10-amdgpu.conf file. However, as I said in your other topic, this results in your system using the modesetting driver to drive the Integrated AMD GPU, which is inferior in performance to the amdgpu driver. Otherwise, the presence or absence of the xorg.conf file will determine if the Nvidia GPU is used. The file can be disabled by using this command to rename it. Then log out and back in or reboot:
sudo mv /etc/X11/xorg.conf /etc/X11/xorg.conf.old

Now only the integrated graphics will be used. To revert back to the Nvidia GPU, use this command to enable the xorg.conf file again: sudo mv /etc/X11/xorg.conf.old /etc/X11/xorg.conf

Instead of using those commands, I suggest using a desktop script to automatically switch the GPU that will be doing the graphics rendering. For situations where you don’t need the greater processing power of the Nvidia GPU, then the integrated AMD GPU should be used. This will keep laptop temperatures down and prevent overheating problems. Of course, if you need to use the monitor attached to the HDMI port, then the Nvidia GPU will need to be selected, since the port is connected internally to it.

To create the desktop script, right click on the desktop and select Create New Document > Empty Document. Name it Switch GPU. Open the file and add these lines: Correction: the word If in the third line below should be if

Code: Select all

#!/bin/sh

If [ $(ls /etc/X11/ | grep xorg.conf) = "xorg.conf" ]; then
   gvfs-set-attribute $HOME/Desktop/Switch\ GPU -t string metadata::custom-icon file://$HOME/Pictures/AMD-logo.svg   
   sudo mv /etc/X11/xorg.conf /etc/X11/xorg.conf.old; reboot

elif [ $(ls /etc/X11/ | grep xorg.conf) = "xorg.conf.old" ]; then
   gvfs-set-attribute $HOME/Desktop/Switch\ GPU -t string metadata::custom-icon file://$HOME/Pictures/Nvidia-logo.svg  
   sudo mv /etc/X11/xorg.conf.old /etc/X11/xorg.conf; reboot
fi
Save the file and close it. Right click on it and select Properties > Permissions. Mark the checkbox next to Allow executing file as program. When you click on the desktop script, choose the option Run in Terminal.
The script’s icon will be changed to show what GPU is now doing the graphics rendering. It will look like one of the two icons below:

Switch GPU AMD+Nvidia.png
Switch GPU AMD+Nvidia.png (11.87 KiB) Viewed 7217 times

For this feature to work, download the switch-gpu.zip file below, which contains the Nvidia-logo.svg and AMD-logo.svg icons. Right click on it and select Extract Here. Move the icons to the Pictures folder.

switch-gpu.zip
(18.21 KiB) Downloaded 134 times

If the icon is not changed, then check in /etc/X11/. Only xorg.conf or xorg.conf.old should be listed.
There should not be any other file with xorg.conf in it, such as xorg.conf.nvidia-xconfig-original.
User avatar
Luxdragon
Level 2
Level 2
Posts: 50
Joined: Sat Feb 01, 2020 10:15 am

Re: Hybrid Graphics Troubles: Round 2

Post by Luxdragon »

Greetings,

sadly I have found that this issue is not yet solved. Until recently everything worked fine, because my computer was always plugged in. A few days ago, I tried to boot into LM and suddenly I got a broken pixelated screen, almost exactly like in the image below.
Image
After some experimentation I have found that LM cannot boot properly whenever my laptop is unplugged and works completely fine when it is charged. If I boot it while charging and then plug the charger off, the screen still works normally. In a similar way, if I do an unplugged boot and then plug the charger in, the screen will not change. When unplugged Crtl+Alt+F3 doesn't work and tty can neither be accessed in a regular boot or in recovery mode. Switching to the AMD GPU gives a completely black screen, while Nvidia makes that strange spasticated white noise. Recovery mode changes nothing. The only way to access the desktop is to plug in the laptop's charger and reboot.

It's quite odd.
User avatar
roblm
Level 15
Level 15
Posts: 5939
Joined: Sun Feb 24, 2013 2:41 pm

Re: Hybrid Graphics Troubles: Round 2

Post by roblm »

In Power Management, are the settings the same for A/C Power and Battery?

Check if the result is the same running a live session with the Mint installation USB / DVD.
User avatar
Luxdragon
Level 2
Level 2
Posts: 50
Joined: Sat Feb 01, 2020 10:15 am

Re: Hybrid Graphics Troubles: Round 2

Post by Luxdragon »

The settings are the same. When I run a live session from a USB, everything works fine regardless if the PC is plugged in or not.
User avatar
roblm
Level 15
Level 15
Posts: 5939
Joined: Sun Feb 24, 2013 2:41 pm

Re: Hybrid Graphics Troubles: Round 2

Post by roblm »

I suggest you boot to the desktop, switch to the AMD GPU, if not already done, and open the 70-linuxmint.conf file:
xed admin:///etc/lightdm/lightdm.conf.d/70-linuxmint.conf

Add a hash mark in front of this line to disable it: display-setup-script=/home/your-user-name/.login

So it will now look like this: # display-setup-script=/home/your-user-name/.login

Reboot and check.
User avatar
Luxdragon
Level 2
Level 2
Posts: 50
Joined: Sat Feb 01, 2020 10:15 am

Re: Hybrid Graphics Troubles: Round 2

Post by Luxdragon »

If the laptop is connected to power or not, LM doesn't boot. I only get a blinking _ in the top left corner.
User avatar
roblm
Level 15
Level 15
Posts: 5939
Joined: Sun Feb 24, 2013 2:41 pm

Re: Hybrid Graphics Troubles: Round 2

Post by roblm »

Try reversing the last change you made. At the black screen, press Ctrl+Alt+F1 to enter virtual console tty1. Open the 70-linuxmint.conf file: sudo nano -t /etc/lightdm/lightdm.conf.d/70-linuxmint.conf

Remove the hash mark you added. Press Ctrl+X to save and exit. Type reboot

If you can't enter tty1, then select Advanced options > Recovery Mode at the GRUB boot menu. If no menu shows, then hold down the Shift key while starting. In the menu, select “root - drop to root shell prompt ” and press ENTER. Press ENTER again.

Use this command to change the file permissions to read and write: mount -o remount,rw /

Open the 70-linuxmint.conf file: nano -t /etc/lightdm/lightdm.conf.d/70-linuxmint.conf

Repeat the steps above for tty1. See if you can get to the desktop.
User avatar
Luxdragon
Level 2
Level 2
Posts: 50
Joined: Sat Feb 01, 2020 10:15 am

Re: Hybrid Graphics Troubles: Round 2

Post by Luxdragon »

I already got back to the desktop and removed # from the etc/lightdm/lightdm.conf.d/70-linuxmint.conf file. I typed reboot in the tty and could then access the desktop without hardware acceleration from recovery mode>resume. Things are back as before.
User avatar
roblm
Level 15
Level 15
Posts: 5939
Joined: Sun Feb 24, 2013 2:41 pm

Re: Hybrid Graphics Troubles: Round 2

Post by roblm »

I can’t think of anything causing the problem, unless some recent update or program you installed is at fault. In a recent topic, another user with a similar AMD+Nvidia hybrid graphics laptop, used the same steps you did and has not reported any similar problem yet.
viewtopic.php?f=59&t=325007

Another user with a Intel+Nvidia hybrid graphics laptop is using a similar method in LMDE 4, which I have also tested with AC and battery power.

If you have a Timeshift restore point that goes back to a time before you made any configuration changes, then I suggest using it. Otherwise, I would do a re-installation of Mint, repeat the config changes and then create a Timeshift restore point.

You can also try the other method used in your other topic. I think you may have left out a step.
Locked

Return to “Hardware Support”