DisplayPort-"X" Outputs keep on Changing under XRandR after each Reboot

So my issue is that, after each system reboot the NUMBER assinged to each Video Output on my GPU changes.

For example:
I start my computer up for the first time today, I have 5× Monitors attached to it, 4× Monitors are attached to the primary GPU which is a AMD Radeon VII 16GB, the 5th Monitor is connected to the computer via a Secondary GPU which is a AMD Radeon HD 7770GHz Edition 2GB

When the computer loads up the SDDM Login screen after turning on only 4 of the Monitors render any visuals, they are the 4 Monitors that are connected to the PC via the AMD Radeon VII 16GB GPU, during the login screen I can seamlessly navigate across all 4× Montiors in the correct order without any issues.

So, I login to my KDE Desktop session, and as it loads up the order in which my monitors are displayed changes, at the same time because I am now loading into the desktop session the 5th and final monitor which is connected to my secondary GPU comes into life and displays the relevant visuals.

Here is also where things go wrong, the monitors start displaying in an incorrect order, where the monitor to the left on centre identified hence forth as Monitor No.001 (Connected to the 1st DisplayPort Output on my Radeon VII) starts showing what should be on the central monitor which is Monitor No.002 (Connected to the 2nd DisplayPort Output on my Radeon VII), and on occasion, Monitor No.002 will display what is also being displayed on Monitor No.003 which is the monitor right of the centre (Connected to the 3rd DisplayPort Output on my Radeon VII).

Now each time I reboot my system this order changes around, on rare occasions it will display correctly but this is completely by chance, &, not by intention, which is what it should be doing.

The only behaviour that is consistently the same regardless of how many times I reboot are;

  1. The 4th Monitor (Monitor No.004) which is connected to the Radeon VII’s one & only HDMI output port, and the 5th Monitor (Monitor No.005) which is connected to the AMD Radeon HD 7770GHz Edition’s DVI Port, DO NOT RESET or CHANGE OUTPUT, the ALWAYS WORK AS INTENDED!

  2. Even though nothing gets changed physically at all, the DisplayPort-0/DisplayPort-1/DisplayPort-2/DisplayPort-3/DisplayPort-4 numbers that get assigned to the Monitors No.001/No.002/No.003, ALWAYS change. So although right now Monitor No.001 is assigned DisplayPort-0, on the next reboot it could be assigned as DisplayPort-2, the same issue also occurs with the other two Monitors that are connected via DisplayPort to the Radeon VII (Monitor No.002 & Monitor No.003).

So, right now I am lost as to what I can do to stop the DisplayPort outputs from changing their assinged numbers on every reboot.
Because that is what causes the displays to appear incorrectly.

I have already tried buying a DisplayPort MST Hub but that didn’t resolve any of the issues because the DisplayPort Numbers are still reassigned differently on every reboot.

If anybody has any advice that they can give me then please do let me know!

Create a script with the settings and run it at login.

You use arandr to generate the script for you. Save it and run it at login (default folder is ~/.screenlayout)

$ ~/.screenlayout/yourprofile.sh

I’ll try a script in the ~/.screenlayout location.

I was using a script that ran on-login in the past which was using xrandr to see the screen positions and locations but it just didn’t seem to help once I went past having 3× Monitors connected.

I’ll try out arandr and see how I get on.
If I get stuck then I’ll report back here with questions that I may have.

Okay, so I have encountered an error when using Arandr to set my screenlayout.

The error states that;

XRandR returned error code 1:b'xrandr: cannot find mode 1366x768\n' ```

The 5th Montior (Monitor No.005) in my setup which is connected to my secondary GPU uses the resolution of 1366x768@60Hz.
I added this as a custom resolution myself because it was otherwise not listed by XRandR when checking for available resolutions.

The monitor is VGA but the GPU only supports DVI, so an adapter is used to convert the DVI Output on the GPU to a VGA outout that the VGA cable then connects to. This is why a custom resolution is used.

So, a further update.

As I expected would be the case, the “ScreenLayout” fix, doesn’t make a single bit of difference.

This is because, as I highlighted to in my original post, the actual DisplayPort-0/-1/-2/-3/4 numbers change which physical port they get assigned to on EVERY REBOOT.

What I need to do is to stop the ports from being assigned different “DisplayPort-X” numbers, and instead lockdown the range of numbers that can be used.
This is so that, regardless of what else happens, only DisplayPort-0/DisplayPort-1/DisplayPort-2 are available outputs no matter how many times I reboot or power-off.
That they are always assigned to the same physical Video Output Port on my GPU.

This is what I need help with sorting out.

I am by no means an authority on the matter - I only use a dual-head setup and I have never - ever - seen the ports change on reboot.

If the assigned ports change - as you say - on reboot - that would point to a driver issue or it may be the simple answer that they are detected by udev in a random order - which is normal for systemd - but gives quite some pain if you rely on specific devices being available on specific addresses.

Maybe it KDE specific - I am at loss why the port names change - maybe you should look at setting up your monitors using xorg.conf instead of relying on KDE doing it for you - a task that obviously confuses the system.

Have you tried setting it up - one-by-one - noting when it breaks - or should I say the port begin to change - I am fairly certain it caused by the mixed setup onboard vs. dedicated - and the converter in-between?

The converter will usually confuse the system because the system cannot get a clear answer from the device connected.

I suspect the onboard output to be the cause of your headaches.

What I gather from your issue is that it the display ports which switch around - is that correct?

The onboard gpu and the hdmi out on the external gpu is always where they are supposed to be?

Firstly I wanted to.comment on your highlighting of the “udev” load order, as, personally, I think this is likely the culprit in this situation, due to the fact I have 3× AMD GPU’s in my system, of which only 2 are actually being used to display anything, and, it was only once I had added these two addtional GPU’s that I started to get this strange behvaiour.
The problem is I now rely on having a 5× Monitor setup for my workflow so I would struggle to go back to having less than that.

As the order changes on reboot I wonder if what is happening is that because of the GPU’s aren’t always loaded in the same order niether are the "DisplayPort-‘X’ " outputs loaded in the same order.

I have already tried a xorg.conf file on startup, still doesn’t make a difference simply because the DisplayPort-“X” outputs are always changing so it doesn’t matter what I set it as because the firmware or GPU driver or udev load order, overrides it all.

In regards to the VGA adapter, it throws errors at the moment, but other than that it actually works flawlessly. So for now I’d rather leave it unchanged because it doesn’t seem to be the cause of my primary issue.

Whatever is causing my issue it seems to effect all “DisplayPort-X” outputs on ALL GPU’s connected to the system, the numbers change on ALL of the GPU’s & not just the Radeon VII.

As you can tell I have one hell of a bonkers setup, and with it comes all sorts of strange behaviour haha…

You say it is “Normal” for systemd to load udev in a random order, is it possible to force the order in which it loads particular pieces of hardware?

I’m thinking that if I can force it to always load the GPU’s in the same order every time then I may be able to get the “DisplayPort-X” numbers/assignments to stay consistent…

You have added an information indicating you have more than 3 display ports and those display ports are distributed over two gpu cards?

I think this is a driver issue - because the numbering card wise would be identical - pci-0-0, 1, 2 and then pci-1-0, 1, 2 - without having any knowledge worth speaking off - I am guessing you could try removing the card not in use - and verify if the issue persist.

At least it is so for disk devices - which is why setting up disks on systemd requires the use of persistent device names - e.g. unique labels or UUIDs.

I don’t know for gpus - and your setup appears fairly unique :grin:

You mentioned you had tried with xorg.conf - but if I recall correct you can setup the xorg.conf based on monitors - not necessarily the port it is attached to.

A quick search brought up this - I know it is not directly applicable but it may give you some ideas or maybe not - take a look

Also several articles can be found on multi head setup on Arch wiki - you have probably read it all …