Steam plays games on wrong monitor - Nvidia [ Solved * ]

Anything related to gaming on Linux Mint including game discussion or questions concerning Steam or Wine.
Forum rules
Before you post please read how to get help
Post Reply
havenorl
Level 1
Level 1
Posts: 9
Joined: Tue Nov 17, 2020 9:49 am

Steam plays games on wrong monitor - Nvidia [ Solved * ]

Post by havenorl »

Hello,

I'm new to Linux, as I changed from Windows.
I'm not bothered about the lack of gaming on Linux, I moved over for privacy and security reasons.

I copied over some games, steam, gog, battle net onto my external hdd.
For Stream. I copied over Path Of Exile to test it first.

I have two monitors both the same.
One faces me - main monitor,
One to the left - second monitor.
I game on the main monitor.

Steam and NVidia Server X choose the second monitor on the left to launch the game, and big picture.
There's a workaround for PathOfExile, change it to windowed mode, and move it over to the main monitor.
And it works. But that won't work for all the games. All of them run in full screen mode, or windowed fullscreen..

I've changed the NVidia Server X setting for my main monitor, but it keeps reverting back to the second montior.
Annoying glitch or what ever it is.

How to force Steam to launch the games on the main monitor?

I have it set in the system settings, my main monitor faces me.
That works fine for the desktop.

Thanks, system info below

Code: Select all

System:    Kernel: 5.4.0-54-generic x86_64 bits: 64 compiler: gcc v: 9.3.0 Desktop: Cinnamon 4.6.7 
           wm: muffin dm: LightDM Distro: Linux Mint 20 Ulyana base: Ubuntu 20.04 focal 
Machine:   Type: Desktop System: Gigabyte product: X570 AORUS ULTRA v: -CF serial: <filter> 
           Mobo: Gigabyte model: X570 AORUS ULTRA serial: <filter> UEFI: American Megatrends 
           v: F20 date: 07/07/2020 
Battery:   Device-1: hidpp_battery_0 model: Logitech G305 Lightspeed Wireless Gaming Mouse 
           serial: <filter> charge: 100% (should be ignored) status: Discharging 
CPU:       Topology: 8-Core model: AMD Ryzen 7 3700X bits: 64 type: MT MCP arch: Zen 
           L2 cache: 4096 KiB 
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm bogomips: 114989 
           Speed: 2150 MHz min/max: 2200/3600 MHz Core speeds (MHz): 1: 2149 2: 2140 3: 4304 
           4: 2146 5: 2073 6: 2997 7: 2130 8: 2359 9: 4291 10: 2146 11: 2081 12: 2808 13: 2346 
           14: 1948 15: 2107 16: 2146 
Graphics:  Device-1: NVIDIA TU104 [GeForce RTX 2070 SUPER] vendor: ASUSTeK driver: nvidia 
           v: 455.38 bus ID: 08:00.0 chip ID: 10de:1e84 
           Display: x11 server: X.Org 1.20.8 driver: nvidia tty: N/A 
           OpenGL: renderer: GeForce RTX 2070 SUPER/PCIe/SSE2 v: 4.6.0 NVIDIA 455.38 
           direct render: Yes 
Audio:     Device-1: NVIDIA TU104 HD Audio vendor: ASUSTeK driver: snd_hda_intel v: kernel 
           bus ID: 08:00.1 chip ID: 10de:10f8 
           Device-2: AMD Starship/Matisse HD Audio vendor: Gigabyte driver: snd_hda_intel 
           v: kernel bus ID: 0a:00.4 chip ID: 1022:1487 
           Device-3: SteelSeries ApS SteelSeries Arctis 5 type: USB 
           driver: hid-generic,snd-usb-audio,usbhid bus ID: 7-3:3 chip ID: 1038:12aa 
           Sound Server: ALSA v: k5.4.0-54-generic 
Network:   Device-1: Intel Wi-Fi 6 AX200 driver: iwlwifi v: kernel bus ID: 03:00.0 
           chip ID: 8086:2723 
           IF: wlp3s0 state: up mac: <filter> 
           Device-2: Intel I211 Gigabit Network vendor: Gigabyte driver: igb v: 5.6.0-k port: f000 
           bus ID: 04:00.0 chip ID: 8086:1539 
           IF: enp4s0 state: up speed: 100 Mbps duplex: full mac: <filter> 
Drives:    Local Storage: total: 7.28 TiB used: 1.97 TiB (27.0%) 
           ID-1: /dev/sda vendor: Samsung model: SSD 860 EVO 1TB size: 931.51 GiB speed: 6.0 Gb/s 
           serial: <filter> 
           ID-2: /dev/sdb vendor: Crucial model: CT1000MX500SSD1 size: 931.51 GiB speed: 6.0 Gb/s 
           serial: <filter> 
           ID-3: /dev/sdc vendor: Western Digital model: WD4005FZBX-00K5WB0 size: 3.64 TiB 
           speed: 6.0 Gb/s serial: <filter> 
           ID-4: /dev/sdd type: USB vendor: Western Digital model: WD My Passport 259F 
           size: 1.82 TiB serial: <filter> 
Partition: ID-1: / size: 915.40 GiB used: 32.68 GiB (3.6%) fs: ext4 dev: /dev/sda2 
USB:       Hub: 1-0:1 info: Full speed (or root) Hub ports: 6 rev: 2.0 chip ID: 1d6b:0002 
           Device-1: 1-1:2 info: Integrated Express ITE Device(8595) type: Keyboard 
           driver: hid-generic,usbhid rev: 2.0 chip ID: 048d:8297 
           Device-2: 1-3:3 info: Corsair Vengeance K70R keyboard type: Keyboard,HID 
           driver: corsair,usbhid rev: 2.0 chip ID: 1b1c:1b09 
           Hub: 1-6:4 info: Genesys Logic Hub ports: 4 rev: 2.0 chip ID: 05e3:0608 
           Hub: 2-0:1 info: Full speed (or root) Hub ports: 4 rev: 3.1 chip ID: 1d6b:0003 
           Hub: 3-0:1 info: Full speed (or root) Hub ports: 6 rev: 2.0 chip ID: 1d6b:0002 
           Device-3: 3-5:2 info: Intel type: Bluetooth driver: btusb rev: 2.0 chip ID: 8087:0029 
           Hub: 3-6:3 info: Genesys Logic Hub ports: 4 rev: 2.0 chip ID: 05e3:0608 
           Hub: 4-0:1 info: Full speed (or root) Hub ports: 4 rev: 3.1 chip ID: 1d6b:0003 
           Device-4: 4-4:2 info: Western Digital My Passport Ultra (WD10JMVW) type: Mass Storage 
           driver: usb-storage rev: 3.0 chip ID: 1058:259f 
           Hub: 5-0:1 info: Full speed (or root) Hub ports: 2 rev: 2.0 chip ID: 1d6b:0002 
           Hub: 6-0:1 info: Full speed (or root) Hub ports: 4 rev: 3.1 chip ID: 1d6b:0003 
           Hub: 7-0:1 info: Full speed (or root) Hub ports: 4 rev: 2.0 chip ID: 1d6b:0002 
           Device-5: 7-1:2 info: Logitech USB Receiver type: Keyboard,Mouse,HID 
           driver: logitech-djreceiver,usbhid rev: 2.0 chip ID: 046d:c53f 
           Device-6: 7-3:3 info: SteelSeries ApS SteelSeries Arctis 5 type: Audio,HID 
           driver: hid-generic,snd-usb-audio,usbhid rev: 2.0 chip ID: 1038:12aa 
           Hub: 8-0:1 info: Full speed (or root) Hub ports: 4 rev: 3.1 chip ID: 1d6b:0003 
Sensors:   System Temperatures: cpu: 55.8 C mobo: N/A gpu: nvidia temp: 46 C 
           Fan Speeds (RPM): N/A gpu: nvidia fan: 0% 
Repos:     No active apt repos in: /etc/apt/sources.list 
           Active apt repos in: /etc/apt/sources.list.d/brave-browser-release.list 
           1: deb [arch=amd64] https: //brave-browser-apt-release.s3.brave.com/ stable main
           Active apt repos in: /etc/apt/sources.list.d/official-package-repositories.list 
           1: deb http: //ftp.heanet.ie/pub/packages.linuxmint.com ulyana main upstream import backport
           2: deb http: //ftp.heanet.ie/pub/ubuntu focal main restricted universe multiverse
           3: deb http: //ftp.heanet.ie/pub/ubuntu focal-updates main restricted universe multiverse
           4: deb http: //ftp.heanet.ie/pub/ubuntu focal-backports main restricted universe multiverse
           5: deb http: //security.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
           6: deb http: //archive.canonical.com/ubuntu/ focal partner
           Active apt repos in: /etc/apt/sources.list.d/spotify.list 
           1: deb http: //repository.spotify.com stable non-free
           2: deb http: //repository.spotify.com stable non-free
Info:      Processes: 389 Uptime: 1h 36m Memory: 15.64 GiB used: 4.06 GiB (26.0%) Init: systemd 
           v: 245 runlevel: 5 Compilers: gcc: 9.3.0 alt: 9 Client: Unknown python3.8 client 
           inxi: 3.0.38 
Last edited by havenorl on Fri Nov 20, 2020 5:36 am, edited 2 times in total.
ugly
Level 4
Level 4
Posts: 378
Joined: Thu Nov 24, 2016 9:17 pm

Re: Steam plays games on wrong monitor - Nvidia

Post by ugly »

This isn't a very helpful response, but I have a similar monitor setup and I notice similar issues. It does happen with some games, and even some programs that aren't games. I have an AMD video card, but that doesn't seem to be the issue.

For whatever reason, it seems a lot of programs do not respect the primary monitor setting and just assumes that the leftmost monitor (probably pixel location 0,0), is the location of the primary monitor. This is probably only something people notice when they have two monitors and the primary monitor is on the right.

Most programs do work properly. It seems like with the latest version of Proton (5.13), I've noticed more games opening on the wrong (left) monitor. Previous Proton versions weren't as bad.

The best solution I've found is basically what you already described. Change to window mode and move it to the primary monitor and then change back to fullscreen. Although, I can't remember any games that I've played recently where I was stuck on the secondary monitor.
havenorl
Level 1
Level 1
Posts: 9
Joined: Tue Nov 17, 2020 9:49 am

Re: Steam plays games on wrong monitor - Nvidia

Post by havenorl »

Thanks for the response. I will have to research a lot more then, and test with other games.
A nice challenge. Easy answer is unplug the second monitor, but I'll never do that.
Work on a solution.
ugly
Level 4
Level 4
Posts: 378
Joined: Thu Nov 24, 2016 9:17 pm

Re: Steam plays games on wrong monitor - Nvidia

Post by ugly »

Instead of unplugging, you could make a script with xrandr commands to disable the monitor. You have one script that disables the monitor that you can run before you play the game, and then another script to re-enable your secondary monitor after you are done playing.

You can look into a program called arandr that will help you generate these scripts.
havenorl
Level 1
Level 1
Posts: 9
Joined: Tue Nov 17, 2020 9:49 am

Re: Steam plays games on wrong monitor - Nvidia

Post by havenorl »

Nice idea, I will do yeah, thanks.

---
After further research with xrandr, I know what the problem is.
Steam is playing the games at 0 0 (X Y).
How to change it to start playing the games at 1920 0?

My monitor setup is;
DP-0 at 0 0, DP-4 (primary) at 1920 0

This is my xrandr conf file from ChrisTitusTech's video.

Code: Select all

Section "Monitor"
### Monitor Identity - Typically HDMI-0 or DisplayPort-0
    Identifier    "DP-4"

### Setting Resolution and Modes
## Modeline is usually not required, but you can force resolution with it    
    Modeline "1920x1080" 172.80 1920 2040 2248 2576 1080 1081 1084 1118
    Option "PreferredMode" "1920x1080"
    Option        "TargetRefresh" "119.98"

### Positioning the Monitor
## Basic
    Option "RightOf" "DP-0"
## Advanced
    Option        "Position" "1920 0"

## Disable a Monitor
     Option        "Disable" "false"
EndSection

Section "Monitor"
### Monitor Identity - Typically HDMI-0 or DisplayPort-0
    Identifier    "DP-0"

### Setting Resolution and Modes
## Modeline is usually not required, but you can force resolution with it    
    Modeline "1920x1080" 172.80 1920 2040 2248 2576 1080 1081 1084 1118
    Option "PreferredMode" "1920x1080"
    Option        "TargetRefresh" "119.98"

### Positioning the Monitor
## Basic
    Option "LeftOf" "DP-4"
## Advanced
    Option        "Position" "0 0"

## Disable a Monitor
     Option        "Disable" "false"
EndSection
------

further edit, I've found the solution, linux only plays games at 0 0, perfect for single monitor setups, but not for dual monitors.
I don't know how to implement the startx script in the arch wiki:

Code: Select all

Full screen games

Many games require their window to appear at (0,0) when running in full-screen. If the screen you have at (0,0) - the left-most one - is not one you wish to game on, it is almost impossible to move a full-screen game onto a different screen.

A workaround for this is to create a separate X11 configuration (a new layout) just for playing games, which may have less (or only one) screen configured. You can then launch games using this separate layout, while normal desktop work uses the original multihead configuration.

To create a new layout, copy /etc/X11/xorg.d/90-serverlayout.conf and call it 91-serverlayout-gaming.conf. It is important to use a number larger than 90, as the one with the lowest number will become the default used when you first load X.

Adjust this new configuration file to your preferred gaming configuration. Here is an example (based on the example Xinerama configuration above) with only one screen defined, noting that the screen specifics (such as resolution) are defined in other files and are unchanged from and shared with the normal configuration:

/etc/X11/xorg.conf.d/91-serverlayout-gaming.conf

# New screen layout only using a single screen called "Primary"
Section "ServerLayout"
    Identifier   "Gaming"
    Screen       0 "Primary" Absolute 0 0
EndSection

Tip: While it's easiest to just reuse the existing screen definitions, you can, of course, define new ones if you wish to have a different set of screen resolutions available.

To use this new layout, launch the game via the startx script:

# Launch Xonotic on a new X11 display using the "Gaming" layout
startx /usr/bin/xonotic-glx -fullscreen -- :1 -layout Gaming

Note that:

    You must specify the full path to the command to run, here /usr/bin/xonotic-glx.
    The :1 must refer to an empty unused display. The first display you are likely using for your desktop is :0, so :1 will be fine for most people. But should you want to launch a second game at the same time, you would have to change this to :2.
    Just as you can switch between text consoles with Alt+Ctrl+F1 and back to X with Alt+Ctrl+F7, the new display will sit on Alt+Ctrl+F8. So you can switch back to your desktop with Alt+Ctrl+F7 and back to the game with Alt+Ctrl+F8. This is because you are running an independent X desktop, so if you switch out of the game with Alt+Tab or equivalent there will be an empty desktop with no window manager running.
 
AbitOnTheMintySide
Level 1
Level 1
Posts: 31
Joined: Wed Nov 18, 2020 10:14 am

Re: Steam plays games on wrong monitor - Nvidia

Post by AbitOnTheMintySide »

Hello,

I have an almost identical rig as you.
Both my monitors are run from my RTX 2070's displayports, is this the case with your PC, or are you using an HDMI splitter?
No Nvidia software here apart form proprietary drivers.
Asking because I haven't had problems like your having.
havenorl
Level 1
Level 1
Posts: 9
Joined: Tue Nov 17, 2020 9:49 am

Re: Steam plays games on wrong monitor - Nvidia

Post by havenorl »

No splitter, no hdmi. Weird as I'm having problems, and you aren't .
I'm new to linux, so I don't mind not playing games at the moment.
However, I would like to play games.
Unsure of how to progress now.
AbitOnTheMintySide
Level 1
Level 1
Posts: 31
Joined: Wed Nov 18, 2020 10:14 am

Re: Steam plays games on wrong monitor - Nvidia

Post by AbitOnTheMintySide »

Linux is fairly new on my desktop, before I had Windows 10.
So, I'm still waiting for something to go wrong, nothing to report in over 5 weeks of use. It all appears to run smooth.
I'll add more games this evening and see if I have any issues.
Will report back later If it all goes pear shaped.
havenorl
Level 1
Level 1
Posts: 9
Joined: Tue Nov 17, 2020 9:49 am

Re: Steam plays games on wrong monitor - Nvidia

Post by havenorl »

I think, I'm going to try and open games in windows border, and change to the other monitor, then change to fullscreen.
The long winded way, but it's okay for me atm, cos I'm new to Linux. I accept it this way.

Installing chris titus tech linux game package at:
https://christitus.com/ultimate-linux-gaming-guide/
video:
https://www.youtube.com/watch?v=xvrft9ULvho

Going to give this a go

I think, I'm going to give up on trying to change the games on the 0 0 monitor.

----
what i installed from that package is:
no custom kernel
aco - faster compiling (amd only)
wine dependancies and lutris
esync check
gamemode
custom proton (crikey this took a while to install, lengthy)

---- another edit, as to not double post.
Path Of Exile - now playing on the proper monitor - out of nowhere :D
tested Skyrim, still playing on other monitor.
Testing stage now :D

installed lutris and wine - already had their dependancies in from the proton install
used the terminal, instead of the software manager (saw wine in there).
trying to be more linux based
AbitOnTheMintySide
Level 1
Level 1
Posts: 31
Joined: Wed Nov 18, 2020 10:14 am

Re: Steam plays games on wrong monitor - Nvidia

Post by AbitOnTheMintySide »

Please report back and let us know if it works, or not.
Good luck!
havenorl
Level 1
Level 1
Posts: 9
Joined: Tue Nov 17, 2020 9:49 am

Re: Steam plays games on wrong monitor - Nvidia

Post by havenorl »

Fully installed wine and lutris now.

Tried using my windows files for Grim Dawn, got to the front page, but stopped.
I probably have to delete those windows files. However for Steam, my windows files for Path Of Exile loaded fine.
Maybe cos of no GOG launcher the problem lies etc.
Linked my GOG account to Lutris, and downloaded through their files.
I have all 2 expansions on my GD game, only downloaded main game only.

Weird with my 2 monitors, fired up Grim Dawn vanilla.
Started on the left screen, then lutris settings kicked in, and it changed to the main screen on the right :D
Fired up correctly, and played a while but no sound. Further investigation needed.

Path Of Exile seems working better, and on the main screen (the one to the right).

Seems, if I run games through Lutris, with the settings I've applied, they play on the correct monitor.

Yet to confirm if it is fixed.
A few more games to test first, before I'm happy.

----

edit

After looking through the Lutris files for Grim Dawn, plenty of window files (or looked like them - spooked me a little).
Anyways, decided to uninstall every steam game, and delete the windows games files i copied over from ntfs to ext4.

Going to manually install the games for Linux (even with the wine / lutris windows files) - fresh start.
So I know the files are truly meant for Linux.
Don't mind this, going to be a long road ahead. I have the backup on my external hdd - ntfs
Post Reply

Return to “Gaming on Linux Mint”