batocera-linux / batocera.linux

batocera.linux
https://batocera.org
Other
1.92k stars 494 forks source link

No HDMI output on laptop with Hybrid Graphics #4451

Open sizzleweet opened 3 years ago

sizzleweet commented 3 years ago

Hello,

I'm running an ACER Predator Helios 300 with a hybrid graphics card (nvidia 1660TI). In batocera under video output it's not showing an option for HDMI just EDP-1. When connected to a screen via HDMI, it boots, the splash screen shows on the connected screen, but once it's fully booted it returns to showing on the laptop screen.

I've configured the batocera-boot.conf to:

nvidia-driver=true nvidia-prime=true

Here is the output of xrandr and lspci:

https://pastebin.com/N9YCxK1c

There was a previously open issue regarding this that got closed with no explanation here: https://github.com/batocera-linux/batocera.linux/issues/4431

Bullet-Hell commented 3 years ago

👍

dmanlfc commented 3 years ago

What happens if you disable nvidia-prime=true ? Have you checked your BIOS to see if there is a GPU preference, sometimes you need to set it to Nvidia by default...

What is the output of xrandr --listproviders ?

sizzleweet commented 3 years ago

I don't have an option to change gpu preference in my bios unfortunately.

When I set nvidia-driver=true as the only option it shows the intel MESA graphics in system information.

Here is the xrandr --listproviders when ONLY that option is uncommented:

xrandr --listproviders Providers: number : 2 Provider 0: id: 0x43 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 1 associated providers: 0 name:modesetting Provider 1: id: 0x26f cap: 0x2, Sink Output crtcs: 4 outputs: 3 associated providers: 0 name:NVIDIA-G0

When I uncomment both nvidia-driver=true AND nvidia-prime=true, it shows up correctly in system information and the xrandr --listproviders command outputs the same thing.

dmanlfc commented 3 years ago

Go to the terminal - hit F1, Applications, terminal or via ssh do this... Then type: nano /etc/X11/xorg.conf.d/10-gpu.conf Take the following code & add it to that conf file and save it. (ctrl+x) then hit y

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

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

Section "Screen"
    Identifier "nvidia"
    Device "nvidia"
EndSection

Section "Device"
    Identifier  "intel"
    Driver      "intel"
    BusID       "PCI:0:2:0"
EndSection

Section "Screen"
    Identifier "intel"
    Device "intel"
EndSection

Then type: batocera-save-overlay Finally type: reboot

Hopefully that works for you...

Bullet-Hell commented 3 years ago

Go to the terminal - hit F1, Applications, terminal Make sure you can rw to boot by typing: mount -o remount,rw /boot Then type: nano /etc/X11/xorg.conf.d/10-gpu.conf Take the following code & add it to that conf file and save it. (ctrl+x) then hit y

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

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

Section "Screen"
    Identifier "nvidia"
    Device "nvidia"
EndSection

Section "Device"
    Identifier  "intel"
    Driver      "intel"
    BusID       "PCI:0:2:0"
EndSection

Section "Screen"
    Identifier "intel"
    Device "intel"
EndSection

Then type: batocera-save-overlay Finally type: reboot

Hopefully that works for you...

Thanks Bro. You are amazing It's working very well 👍👍👍👍👍

dmanlfc commented 3 years ago

You're welcome. I'm glad it worked for you. 🥳

sizzleweet commented 3 years ago

You're welcome. I'm glad it worked for you. 🥳

I’ll check it on Monday. I’m a at from my pc until then.

Will this be something that gets applied automatically in future updates?

dmanlfc commented 3 years ago

Not automatically but I will create an option for it as this shouldn't be applied to everyone. Please test it against multiple Emulators, Vulkan and overall performance.

sizzleweet commented 3 years ago

Not automatically but I will create an option for it as this shouldn't be applied to everyone. Please test it against multiple Emulators, Vulkan and overall performance.

What state should the batocera-boot.conf be in with this setup?

dmanlfc commented 3 years ago

Just nvidia-driver=true should be fine. Please test with nvidia-prime=true enabled & disabled too please.

sizzleweet commented 3 years ago

Is it something I can do over ssh instead of at the PC itself?

dmanlfc commented 3 years ago

Yes provided you "mount -o remount,rw /boot" first to be able to edit the file.

Bullet-Hell commented 3 years ago

Is it something I can do over ssh instead of at the PC itself?

nvidia-prime=true nvidia-driver=true

And when you enter to terminal write su first and press enter and then write this

mount -o remount,rw /boot

nano /etc/X11/xorg.conf.d/10-gpu.conf

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

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

Section "Screen" Identifier "nvidia" Device "nvidia" EndSection

Section "Device" Identifier "intel" Driver "intel" BusID "PCI:0:2:0" EndSection

Section "Screen" Identifier "intel" Device "intel" EndSection

sizzleweet commented 3 years ago

Yes provided you "mount -o remount,rw /boot" first to be able to edit the file.

Seems like things worked fine for getting it to display with HDMI out, but once this is added there's no longer a way to output to the laptop screen? in screen output I ONLY have the HDMI option now.

I'll start testing games etc. With JUST nvidia-driver=true enabled the correct Graphics card IS being shown in system information. We'll see how it goes.

dmanlfc commented 3 years ago

Batocera is designed for single display output like most of the the games we emulate. i.e. Self made arcade machines, handhelds, TV connected devices etc.

The problem with your laptop is that the output's are hard wired to the two GPU's. Therefore when Batocera queries the card it get's the relevant output for the primary card. The xorg conf code I provided makes the Nvidia card the primary - therefore Batocera see's your HDMI connection. I know this is not ideal... hence asking you to test.

That being said we should still have access to the output to change them & still use the Nvidia GPU for rendering.

Via ssh, type: xrandr --setprovideroutputsource intel nvidia

And then in the GUI see if it you can then select the laptop screen.

dmanlfc commented 3 years ago

Chaps I have added this option in code so it will be in the next release but before I commit, I need some answers.

Does typing: xrandr --setprovideroutputsource intel nvidia allow you to see all output connections or is it just the output from the intel chip?

sizzleweet commented 3 years ago

I'll check on this as soon as I'm able dmanlfc.

sizzleweet commented 2 years ago

Chaps I have added this option in code so it will be in the next release but before I commit, I need some answers.

Does typing: xrandr --setprovideroutputsource intel nvidia allow you to see all output connections or is it just the output from the intel chip?

dmanlfc, I ssh'd into the box,

did:

# export DISPLAY=:0.0
# xrandr --setprovideroutputsource intel nvidia
Could not find provider with name intel
xrandr output:
# xrandr
Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 32767 x 32767
DP-0 disconnected primary (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
HDMI-0 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 1600mm x 900mm
   3840x2160     60.00 +  59.94    50.00    29.97    25.00    23.98    23.98
   4096x2160     59.94    50.00    29.97    25.00    24.00    23.98
   1920x1080    119.88*  100.00    60.00    59.94    50.00    29.97    25.00    23.98
   1360x768      60.02
   1280x1024     60.02
   1280x720      59.94    50.00
   1152x864      60.00
   1024x768      60.00
   800x600       60.32
   720x576       50.00
   720x480       59.94
   640x480       59.95    59.94    59.93

This is with the previous changes made to /etc/X11/xorg.conf.d/10-gpu.conf in place.

m59peacemaker commented 2 years ago

My situation is remarkably similar on an MSI GS65 with an Nvidia RTX 2060. My xrandr output look the same in these cases, but my HDMI-0 doesn't show "connected" even with the 10-gpu.conf fix. I tried with nvidia-prime true and with it false.

Regarding xrandr --setprovideroutputsource intel nvidia, I have this output from --listproviders:

Providers: number : 1
Provider 0: id: 0x1b8 cap: 0x1, Source Output crtcs: 4 outputs: 3 associated providers: 0 name:NVIDIA-0

So of course I get Could not find provider with name intel as well.

I have tried Batocera on a very similar laptop, the MSI PS63 with Nvidia 1660, and its HDMI output worked seamlessly - no fiddling required. Both have Nvidia/Intel with Optimus and are generally similar laptops, so I was surprised it works on one and not the other.

moacmoa commented 2 years ago

Hi. Got same issue on my Dell G3 (i5-10300H 2.5GHz, GTX 1660Ti) running V31.

@dmanlfc your trick with 10-gpu.conf worked fine for me too. Thank you very much !!! But I have the same problem : can't choose my display with menu. Other way sould be good (but doesn't work) : auto switch on internal screen when HDMI cable is not connected on boot.

If it can help, here are some command outpouts on my device. Feel free to ask any other command output you need.

1) Without 10-gpu.conf trick :

2) With 10-gpu.conf trick :

fgom-dev commented 2 years ago

Vá para o terminal - pressione F1, Aplicativos, terminal Certifique-se de que você pode rw para inicializar digitando: mount -o remount,rw /boot Em seguida, digite: nano /etc/X11/xorg.conf.d/10-gpu.conf Pegue o seguinte código e adicione-o a esse arquivo conf e salve-o. (ctrl+x) então aperte y

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

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

Section "Screen"
    Identifier "nvidia"
    Device "nvidia"
EndSection

Section "Device"
    Identifier  "intel"
    Driver      "intel"
    BusID       "PCI:0:2:0"
EndSection

Section "Screen"
    Identifier "intel"
    Device "intel"
EndSection

Então digite: batocera-save-overlay Finalmente digite:reboot

Espero que funcione para você...

How would it be with ATI Mobility Radeon HD 5000 Series?

WhatsApp Image 2022-05-18 at 19 45 39

shlomir432 commented 8 months ago

hi im triying to add this file 10-gpu.conf by tayping that commnd terminal Make sure you can rw to boot by typing: mount -o remount,rw /boot Then type: nano /etc/X11/xorg.conf.d/10-gpu.conf Take the following code & add it to that conf file and save it. (ctrl+x) then hit y and i got this masseg "error writing /etc/X11/xorg.conf.d/10-gpu.conf no such file or directory how do i make this file ?

HappyKool commented 3 months ago

Hello, have anyone among you tested a machine with the Batocera v39 (AMD 64x2 5000+ with a Geforce 9500GT, 8 GB of ram.) In theory the PC could accept it but in practice as soon as I arrives at the interface after a certain time everything freezes. And I can't figure out where it could come from even though version 37 passes without any problem. thanks in advance

samuelssardinha commented 1 month ago

Tenho uma instalação do batocera no QEmu e para ter proveito da GPU dedicado fiz o PASSTHROUHG da placa de video dedicada RTX 3070, porém o sistema inicializa, mostra a tela de "splashscreen", a logo do batocera animada mas carrega a interface na tela secvundaria da maquina virtual. Não aparece o monitor em que está a gpu NVIDIA para seleciona-la como saída padrão de video.

samuelssardinha commented 1 month ago

I have a Batocera installation on QEmu and to take advantage of the dedicated GPU I PASSTHROUHG the dedicated RTX 3070 video card, but the system starts up, shows the "splashscreen", the batocera logo animated but loads the interface on the secondary screen of the virtual machine. The monitor on which the NVIDIA gpu is located does not appear to select it as the standard video output.

dmanlfc commented 1 month ago

Batocera on qemu emulation is not supported. We support bare metal only.