Skip to content
This repository has been archived by the owner on Jun 25, 2024. It is now read-only.

Not working on Nvidia #9

Closed
mycroftsnm opened this issue Jan 31, 2021 · 21 comments
Closed

Not working on Nvidia #9

mycroftsnm opened this issue Jan 31, 2021 · 21 comments

Comments

@mycroftsnm
Copy link

Gdm does not load after reboot, remove /usr/share/X11/xorg.conf.d/20-intel fixes it. I supposse this only work on intel cards? Any ideas for nvidia gpu's?
nvidia 750ti btw

@ManeraKai
Copy link

I've tried every possible way I can. no options software wise for Nvidia proprietary drivers yet, but there are hardware options:
This video shows you how to plug a normal HDMI to VGA convertor and fool the GPU:
https://youtu.be/rMPAlWMvfsY
There are also dummy plugs on Amazon:
https://www.amazon.com/s?k=dummy+plug&ref=nb_sb_noss_2

@bocklucas
Copy link

bocklucas commented Feb 14, 2021

Gdm does not load after reboot, remove /usr/share/X11/xorg.conf.d/20-intel fixes it. I supposse this only work on intel cards? Any ideas for nvidia gpu's?
nvidia 750ti btw

Having the same issue and same solution here, in that removing the file fixes it.

@dianariyanto
Copy link
Owner

I think it needs to create a specific configuration for other graphic cards.

File : 20-intel.conf

Section "Device"
    Identifier "intelgpu0"
    Driver "intel"
    Option "VirtualHeads" "2"
EndSection

@bocklucas
Copy link

I think it needs to create a specific configuration for other graphic cards.

File : 20-intel.conf

Section "Device"
    Identifier "intelgpu0"
    Driver "intel"
    Option "VirtualHeads" "2"
EndSection

@dianariyanto do you have any plans to make a config for Nvidia cards?

@hsparkastro
Copy link

I think it needs to create a specific configuration for other graphic cards.
File : 20-intel.conf

Section "Device"
    Identifier "intelgpu0"
    Driver "intel"
    Option "VirtualHeads" "2"
EndSection

@dianariyanto do you have any plans to make a config for Nvidia cards?

@dianariyanto Your solution works only for intel CPUs with integrated graphics. With this setting, the integrated gpu takes care of the virtual screen, not Nvidia cards.

@bocklucas I have the same problem. I found nvidia's official guide on how to set x11vnc for headless servers. It's not for a secondary virtual display, but it's the closest to the solution I could find.

https://docs.nvidia.com/grid/9.0/grid-vgpu-user-guide/index.html#configuring-x11vnc-checking-gpu-linux-server

@bocklucas
Copy link

I think it needs to create a specific configuration for other graphic cards.
File : 20-intel.conf

Section "Device"
    Identifier "intelgpu0"
    Driver "intel"
    Option "VirtualHeads" "2"
EndSection

@dianariyanto do you have any plans to make a config for Nvidia cards?

@dianariyanto Your solution works only for intel CPUs with integrated graphics. With this setting, the integrated gpu takes care of the virtual screen, not Nvidia cards.

@bocklucas I have the same problem. I found nvidia's official guide on how to set x11vnc for headless servers. It's not for a secondary virtual display, but it's the closest to the solution I could find.

https://docs.nvidia.com/grid/9.0/grid-vgpu-user-guide/index.html#configuring-x11vnc-checking-gpu-linux-server

@hsparkastro awesome thanks! I'll give it a try!

@hsparkastro
Copy link

@bocklucas On a closer look, the guide I provided seems to be intended for the problem of X not loading without a physical monitor present. Not exactly what we're looking for. From what I've been reading in other forums, we might have to use nvidia-settings to work around the problem, rather than using xorg.conf or xrandr......

@bocklucas
Copy link

@bocklucas On a closer look, the guide I provided seems to be intended for the problem of X not loading without a physical monitor present. Not exactly what we're looking for. From what I've been reading in other forums, we might have to use nvidia-settings to work around the problem, rather than using xorg.conf or xrandr......

@hsparkastro ahhhh! Hmmm thats fair! Have you played around with nvidia-settings before?

@hsparkastro
Copy link

@bocklucas Sadly, no. I'm just reading the README file atm.

@bocklucas
Copy link

@hsparkastro sweet, I'll check it out too and let you know what turns up!

@hsparkastro
Copy link

@bocklucas Hey, I found a solution! The trick is to use Nvidia's TwinView and force the graphics card to see unconnected ports as connected using Option "ConnectedMonitors". TwinView allows multiple monitors to be configured in a single X Screen, and ConnnectedMonitors is supported for old monitors that doesn't support Display Data Channel (DDC) protocols.

Here's the README for TwinView.
https://download.nvidia.com/XFree86/Linux-x86_64/460.39/README/configtwinview.html

First, create a basic xorg.conf file using nvidia-xconfig in terminal:

nvidia-xconfig

This will create an xorg.conf in /etc/X11/.
Then, edit the created file and add the following Options in the Screen Section:

Section "Screen"
     ...
    Option         "MetaModes" "DP-0: 1920x1200_60 +0+0, HDMI-0: 1920x1080_60 +1920+120"
    Option         "ConnectedMonitor" "DP-0, HDMI-0"
     ...
EndSection

These options are supported by the nvidia driver and not X (I think...)
You'll have to change DP-0: 1920x1200_60 +0+0, HDMI-0: 1920x1080_60 +1920+120 to suit your configuration. For me, DP-0 is connected to a primary (physical) monitor, and I and using HDMI-0 to trick the gpu to think there is a monitor connected (which I'll use for vnc secondary display). +0+0 and +1920+120 is the offset from the left topmost corner of the X screen. However, the resolution of the virtual screen does not seem to matter, and will default to the first option in xrandr unless commanded via xrandr --output.

Logout and login to see the effect. You'll see that the cursor moves beyond the primary monitor, and if you xrandr, you'll see that HDMI-0 is seen as connected.

I am using my iPad for vnc'ing, which has a 2224x1668 resolution, but it makes the screen too small, so I created a custom resolution (1080x810) for HDMI-0 using xrandr. So,

cvt 1080 810

which outputs the mode configuration for my resolution. Copy the second line of the output and create the mode using newmode

xrandr --newmode "1080x810"   71.25  1080 1136 1248 1416  810 813 817 841 -hsync +vsync

the options after --newmode will be different for your configuration. Then add the mode to HDMI-0 and set it to that mode.

xrandr --addmode HDMI-0 "1080x810"
xrandr --output HDMI-0 --mode "1080x810"

If you vnc now, you'll see the whole Screen (both monitors). I use x11vnc for the vnc server, which allows me to clip the output and allow multiple pointers (the server's pointer will be visible to the client, the client's will be visible to the server).

x11vnc -multiptr -clip 1080x810+1920+0 

Feel free to set more secure options if necessary. Let me know how it goes.

@bocklucas
Copy link

Holy crap @hsparkastro thats awesome!!

I'll try that out and let you know how it goes!!

@vcampitelli
Copy link

@hsparkastro Awesome!! It's working! Thank you :)

dianariyanto added a commit that referenced this issue Jul 12, 2021
Thanks for @hsparkastro for the great and clear tutorial #9
@lavenderdotpet
Copy link

lavenderdotpet commented Sep 15, 2021

nvidia xconfig doesnt work for some reason

[lavender@lav-x570 ~]$ nvidia-xconfig 

WARNING: Unable to locate/open X configuration file.


WARNING: Unable to parse X.Org version string.


ERROR: Unable to write to directory '/etc/X11'.

@hallgchris
Copy link

@MissLav You'll need root permissions for it to write to /etc, i.e.

sudo nvidia-xconfig

@AlexandreHertzog
Copy link

I tried doing what @hsparkastro mentioned and I couldn't get it to work. After a reboot, it seems that Gnome crashes and it doesn't output anything anymore, to the point that the monitor enters power save mode. I could use ctrl + alt + F2 (which turns on the monitor) to access the TTY and undo the file nvidia-xconfig generated, switching that by the auto-generated xorg.conf backup file.

For some reason, it seems to me that my version of nvidia-xconfig is generating files that crash my X server, but I'll test that later.

PS: Before I rebooted, I tried just logged out of the system, on which the monitor turned itself off for a lack of signal. But when accessing the TTY in this session and checking dmesg, I caught a glimpse of a gnome segfault. It did not happen after the reboot, though.

My system information:

Fedora 34
NVidia proprietary drivers version 470.74

@palexdev
Copy link

palexdev commented Nov 4, 2021

@hsparkastro
Thanks, I have a second virtual display now, but I cannot set it to 1920x1080
I always get "BadMatch" error from xrandr, any way to bypass this?

@YaoLiMuMu
Copy link

@bocklucas Hey, I found a solution! The trick is to use Nvidia's TwinView and force the graphics card to see unconnected ports as connected using Option "ConnectedMonitors". TwinView allows multiple monitors to be configured in a single X Screen, and ConnnectedMonitors is supported for old monitors that doesn't support Display Data Channel (DDC) protocols.

Here's the README for TwinView. https://download.nvidia.com/XFree86/Linux-x86_64/460.39/README/configtwinview.html

First, create a basic xorg.conf file using nvidia-xconfig in terminal:

nvidia-xconfig

This will create an xorg.conf in /etc/X11/. Then, edit the created file and add the following Options in the Screen Section:

Section "Screen"
     ...
    Option         "MetaModes" "DP-0: 1920x1200_60 +0+0, HDMI-0: 1920x1080_60 +1920+120"
    Option         "ConnectedMonitor" "DP-0, HDMI-0"
     ...
EndSection

These options are supported by the nvidia driver and not X (I think...) You'll have to change DP-0: 1920x1200_60 +0+0, HDMI-0: 1920x1080_60 +1920+120 to suit your configuration. For me, DP-0 is connected to a primary (physical) monitor, and I and using HDMI-0 to trick the gpu to think there is a monitor connected (which I'll use for vnc secondary display). +0+0 and +1920+120 is the offset from the left topmost corner of the X screen. However, the resolution of the virtual screen does not seem to matter, and will default to the first option in xrandr unless commanded via xrandr --output.

Logout and login to see the effect. You'll see that the cursor moves beyond the primary monitor, and if you xrandr, you'll see that HDMI-0 is seen as connected.

I am using my iPad for vnc'ing, which has a 2224x1668 resolution, but it makes the screen too small, so I created a custom resolution (1080x810) for HDMI-0 using xrandr. So,

cvt 1080 810

which outputs the mode configuration for my resolution. Copy the second line of the output and create the mode using newmode

xrandr --newmode "1080x810"   71.25  1080 1136 1248 1416  810 813 817 841 -hsync +vsync

the options after --newmode will be different for your configuration. Then add the mode to HDMI-0 and set it to that mode.

xrandr --addmode HDMI-0 "1080x810"
xrandr --output HDMI-0 --mode "1080x810"

If you vnc now, you'll see the whole Screen (both monitors). I use x11vnc for the vnc server, which allows me to clip the output and allow multiple pointers (the server's pointer will be visible to the client, the client's will be visible to the server).

x11vnc -multiptr -clip 1080x810+1920+0 

Feel free to set more secure options if necessary. Let me know how it goes.

Does it work for amd cpu?

@KestutisMa
Copy link

In case it would be useful for someone: you will have BadMatch errors and limited resolutions if refresh rate is not set, then you need to add to monitor section in xorg.conf:

HorizSync  30-82
VertRefresh  56-76

as in https://askubuntu.com/a/380817
optionally you can specify refresh rates in

@IceDBorn
Copy link

I get Bad Match when trying to add a mode to the virtual monitor, the monitor does not have any modes setup by default too.

@martonlente
Copy link

martonlente commented Apr 29, 2022

Hello,

I'm trying to set this up accordingly to @hsparkastro instructions. However, it seems after running nvidia-xconfig I can no longer login with Xorg, but Wayland on Fedora 35 with Gnome. It seems that the presence of the generated xorg.xonf breaks X server: I can no longer see Xorg-based session options on login screen, so that my sessions default to Wayland.

I tested this, and it also happens with the deafult generated xorg.conf file, with no additional options. The issue might be similar, or the same what @AlexandreHertzog described above.

Do you have any suggestions or workarounds for this? Thanks in advance!

An extra question: do you think there's an alternative way of making these settings within the Nvidia X Server Settings GUI app?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests