terrymacdonald / DisplayMagician

DisplayMagician is an open source tool for automatically configuring your displays and sound for a game or application from a single Windows Shortcut.
https://displaymagician.littlebitbig.com
GNU General Public License v3.0
451 stars 19 forks source link

Multi GPU Support #187

Closed mattmazgaj closed 9 months ago

mattmazgaj commented 1 year ago

Hello

I am currently running 3 GPUs in my system (AMD IGPU, AMD DGPU and NVIDIA DGPU). By default, when I start the application it uses NVIDIA video library and does not 'see' the screens connected to AMD IGPU or AMD DGPU. When I force the use of AMD library by "--force-video-library" IF I connect anything to AMD IGPU it stops detecting my screens on AMD DGPU in the application. It does however set my AMD DGPU profiles when I close the application and use context menu.

Would it be possible to add support for such scenario?

I am running single system for my desktop and simrig duties with multiple screens on both sides.

Best regads Matt

terrymacdonald commented 1 year ago

Hi Matt,

This is very tricky to do. I tried once in the past to sort it out, but I failed to get the code to work.

Part of the issue is that a user may have NVIDIA surround turned on, as well as AMD Eyefinity, and each will impact each other. It is very difficult to build something that will be reliable for both.

That being said, I've never had anyone with a setup such as yours willing to do any testing.

It will be a lot of work to develop this, and it will require quite a bit of work for you to test the code in your system. I would have to rewrite quite a lot of the application logic, and I would have to create a new testing application just to test the video logic. I'm not sure I have the appetite for doing so much work on the DisplayMagician 2.x codebase.

I'm currently in the beginning stages of developing DisplayMagician v3.0.0. This is a complete rewrite of DisplayMagician v2.5.0 into .net7 and WinUI 3, which will give a completely different look and feel to the application. This may be a good time to also rewrite the video detection/application logic to support people with multiple videos cards from multiple different vendors.

Are you willing to put in the time to test for me over the next 3 months or so? It will involve you performing very specific tests and saving lots of output log files and uploading them to GitHub. They will have to be performed in exactly the right order and exactly as provided to you. Is that something you'd be willing to do?

Thanks Terry

On Thu, 26 Jan 2023, 22:28 mattfbk, @.***> wrote:

Hello

I am currently running 3 GPUs in my system (AMD IGPU, AMD DGPU and NVIDIA DGPU). By default, when I start the application it uses NVIDIA video library and does not 'see' the screens connected to AMD IGPU or AMD DGPU. When I force the use of AMD library by "--force-video-library" IF I connect anything to AMD IGPU it stops detecting my screens on AMD DGPU in the application. It does however set my AMD DGPU profiles when I close the application and use context menu.

Would it be possible to add support for such scenario?

I am running single system for my desktop and simrig duties with multiple screens on both sides.

Best regads Matt

— Reply to this email directly, view it on GitHub https://github.com/terrymacdonald/DisplayMagician/issues/187, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLU5LH6GDICYX2T7Q3YV5DWUI7VVANCNFSM6AAAAAAUHI3FHQ . You are receiving this because you were assigned.Message ID: @.***>

mattmazgaj commented 1 year ago

Hi

Sure thing. It defenetly has more chances of success then me trying to do it myself :)

Matt

terrymacdonald commented 1 year ago

True enough 😂. It really is going to be a major change internally, so I'm a bit worried about knock on effects for those users who don't have lots of video cards. We're going to have to go slow through development and test a lot with a lot of different people.

Thanks Terry

On Fri, 27 Jan 2023, 09:42 mattfbk, @.***> wrote:

Hi

Sure thing. It defenetly has more chances of success then me trying to do it myself :)

Matt

— Reply to this email directly, view it on GitHub https://github.com/terrymacdonald/DisplayMagician/issues/187#issuecomment-1405625447, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLU5LGGPEKCROFQVNQ2RWDWULOVDANCNFSM6AAAAAAUHI3FHQ . You are receiving this because you were assigned.Message ID: @.***>

terrymacdonald commented 1 year ago

OK @mattfbk, firstly thanks for the sponsorship! I really appreciate it.

Secondly, as you know, DisplayMagician currently runs into AMD mode, NVIDIA mode or Windows only mode, and so it can't do all three modes together. This was a conscious decision to avoid problems where the AMDLibrary code might cause issues with the NVIDIALibrary code. and vice versa. (note - all three modes use the WinLibrary to get windows settings too).

Today I got a couple of hours to try and come up with a new test commandline program that attempts to squish all the three videolibraries together to allow them to be used together at the same time. This attempts to take a different approach, and tries to get as much data as it can from any cards it recognises. I'm hopeful that this may help fix your issue temporarily until I finish DisplayMagician v3.0.0 in 6 months or so.

The new application is called VideoInfo, and I've uploaded a test version to this issue. VideoInfo-v1.8.4.zip

Please download it, and extract it to a folder. Then:

At this point we will have two config files, each representing the settings for NVIDIA/AMD/Windows. The next test is to attempt to load the config files to swap between your display layouts.

Zip up the cfg files, and the log files, and upload them to this issue through your web browser, also typing in what happened at each step of the testing I've listed above where I ask you to record it (it can be easier to just copy the text in the powershell window)

Thanks! Terry

terrymacdonald commented 1 year ago

If t above works, you will then be able to create a couple of windows shortcuts on your Desktop, and have them use the full path to where VideoInfo.exe is, and then add the load test1.cfg or load test2.cfg parameters to the end of the Target field in the Shortcut e.g.

image

Hope that helps!

Thanks Terry

mattmazgaj commented 1 year ago

Hello

I ran some tests. Apparently following instructions is not my strong point... test.zip

I'd say it runs about the same as Display Magician but now with multiple GPUs support. I experianced same problems as I sometimes did with DM, like: not initializing Eyefinity corrently(only one monitor working), setting incorrect refresh rate on Eyefinity, setting incorrect scaling on my 4k monitor or taking a few tries for it to apply the configuration properly.

As for this being a solution to my problem I'm more then happy. Love it being just a console app ;) Would just need to turn off logging for day to day use, guess I can just grab source from repo and 'fix' it myself.

Tell me if I messed up the tests, will redo everything once there will be no one to bother me every 3 minutes...

Matt

Edit:

More testing and I found the app crashing when i try to change to 'any' configuration from a single screen on my nvidia dgpu. change-from-nvidia-single-screen.zip

terrymacdonald commented 1 year ago

Thanks Matt,

I'll take a look sometime over this weekend. Those other issues are things if like to fix up if we can. I don't have a working AMD video cards to do I can't tell if there are any issues until someone comes along willing to spend time working with me to fix things.

If you're willing to spend some time over the next few weeks going through these issues one by one then it will benefit all AMD users. What do you think?

The log file is overwritten each time that the code runs, so it's fine to leave it set to trace IMO. This code is primarily for testing purposes, and it's MUCH harder to get people to change it to Trace level each time than it is to just have VideoInfo write a slightly larger file.

Thanks Terry

On Sun, 29 Jan 2023, 10:17 mattfbk, @.***> wrote:

Hello

I ran some tests. Apparently following instructions is not my strong point... test.zip https://github.com/terrymacdonald/DisplayMagician/files/10528253/test.zip

I'd say it runs about the same as Display Magician but now with multiple GPUs support. I experianced same problems as I sometimes did with DM, like: not initializing Eyefinity corrently(only one monitor working), setting incorrect refresh rate on Eyefinity, setting incorrect scaling on my 4k monitor or taking a few tries for it to apply the configuration properly.

As for this being a solution to my problem I'm more then happy. Love it being just a console app ;) Would just need to turn off logging for day to day use, guess I can just grab source from repo and 'fix' it myself.

Tell me if I messed up the tests, will redo everything once there will be no one to bother me every 3 minutes...

Matt

— Reply to this email directly, view it on GitHub https://github.com/terrymacdonald/DisplayMagician/issues/187#issuecomment-1407490127, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLU5LFRVYTP7P7OA3WG5H3WUWEFHANCNFSM6AAAAAAUHI3FHQ . You are receiving this because you were assigned.Message ID: @.***>

mattmazgaj commented 1 year ago

Hello

So I got my hands on a NVIDIA DGPU to maybe replace my AMD DGPU. Unfortunately got this error when I tried to save a setup with surround enabled. Two NVIDIA DGPU and AMD IGPU are in the system, used DDU.

test.zip

When I save a setup without surround enabled it works ok.

Matt

terrymacdonald commented 1 year ago

Hi Matt

Yeah, I found out the same issue in my install (I'm NVIDIA) and I've been trying to troubleshoot it. Thanks for the logs, I should be able to compare what you're seeing with what I'm seeing.

Thanks Terry

UppGRayeDD1337PMP commented 1 year ago

I just opened a new ticket before reading this. I have similar issue and could help testing too.

legoadk commented 10 months ago

Hey there.

I have a somewhat similar setup (NVIDIA RTX3070 + Intel Arc onboard i9).

The NVIDIA card has 3 monitors configured in surround, or as separate desktops, this is what I primarily use DisplayFusion for. The Intel onboard has a side monitor connected to it, that I like to turn off while gaming.

Mostly, saving profiles works fine, it does respect the "enabled/disabled" state of my Intel-connected side monitor, and does effectively control it when switching profiles. However, none of the UI in the app reflect its existence. Additionally, any desktop shortcuts created for those profiles also don't show the side monitor in their representation of the display setup in the icon.

An older version of DisplayMagician did handle this correctly and show that extra monitor in the UI, at least to my recollection; it may have been prior to the release of 2.5.0.

I am not sure if this is a separate issue to this one, or if it belongs here. Please advise.

Additionally, I am a .NET software developer, and I can help in debugging this issue if required :)

terrymacdonald commented 10 months ago

Hi Andrew,

Yeah I've finally been able to spend some time debugging this issue and I've found some incorrect logic in the WIndows Screen creation logic. That's used for creating the Display Profile layout picture, as well as the Icon. I'm currently trying to work through a solution to this.

The issue is that with modern iGPUs and dGPUs and even people running two different dGPUs I have to build a solution that will work with multiple different physical and logical GPU layouts. This will definitely require some testing from people with unusual PCs. I'm lucky that I how have an AMD gaming laptop with a NVIDIA dGPU so that should aid in testing that, and hopefully some others like yourself can do some testing when I have a new version ready for you to all try out.

I will drop a new version in here to test hopefully within the next couple of weeks when I can get time to finish it. I'me also going to try and work through some of the other bugs that people have dropped in here over the last year (if I can) but will fix this issue first and drop a test version in here at the very least.

Thanks

Terry

Message ID: @.*** com>

terrymacdonald commented 10 months ago

Linking this to #251 as that could be related.

terrymacdonald commented 10 months ago

@mattmazgaj I think this issue was related to a bug I recently found in the screen processing logic. I have completely rewritten the logic in this area, and I will be shortly releasing v2.6.0. This should hopefully fix your issue. I will post a link in this issue for you to download a test version of the software. Once you can confirm this fixes things then I'll be hopefully able to release this to the general public.

I think I have also managed to make DIsplayMagician support multi-GPUs more effectively. I don't have enough dGPUs to test, but hopefully I can drop a test version here later in the week for you to test for me. I'd love to know if I've finally found a permanent solution here!

Expect something in the next 2 weeks.

Thanks Terry

terrymacdonald commented 9 months ago

@mattmazgaj @legoadk The latest test version of DM should be working properly, and hopefully fixes your issue. Could you please test it for me so I know that it fixes your issue? If it does then I'll be able to close this issue as the fix will be part of the next full release.

DisplayMagicianSetup-V2.6.0.515-No-NvApi_SetDisplayConfig.zip

Thanks!

terrymacdonald commented 9 months ago

Oops I broke the setup with my previous version. This version has a corrected setup that should install everything properly.

DisplayMagicianSetup-v2.6.0.522-corrected-setup.zip

Thanks Terry

mattmazgaj commented 9 months ago

Hello

Sorry, but I no longer have the setup to test those scenarios nor do I expect to have it this year.

I might be able to test if AMD DGPU+AMD IGPU works but very hard to tell when I get the chance to do that.

Again, sorry.

Matt

terrymacdonald commented 9 months ago

Hey no problems. I'm pretty confident it's working as I have an NVIDIA dGPU and AMD iGPU combined system and it works on that. Others have tested and it seems to work for their solutions too (except no Intel Arc Merged screen support), so I'm confident enough to close this issue for now as it should be fixed in code.

If you do get a chance to test in the future and it doesn't work then please feel free to reopen this issue.

Thanks for getting back to me. It helps me greatly to understand what things I still need to work on. I really appreciate it.

Terry

legoadk commented 9 months ago

Upon installing, that latest package gave the error:

Warning 1946.Property
'System,AppUserModel.ToastActivatorCLSID' for shortcut 'DisplayMagician.lnk' could not be set.

Otherwise, the actual issue at hand seems to be fixed! The icons were out-of-date for each profile & shortcut, but clicking Update on each profile after applying it seemed to fix that up, too. Thanks for looking into this.

image

terrymacdonald commented 9 months ago

Ohhhhh, that's a new error! It's related to registering windows alerts.

Are you able to create a Support ZIP File for me, and upload it here? You can attach the zip file through the web interface. To generate it please go into the Settings button on the main window.

I'll need the Support ZIP File in order to troubleshoot that error. It will definitely help me understanding what bit I need to fix.

Thanks Terry

On Tue, 13 Feb 2024, 18:51 Andrew Keyser, @.***> wrote:

Upon installing, that latest package gave the error:

Warning 1946.Property 'System,AppUserModel.ToastActivatorCLSID' for shortcut 'DisplayMagician.lnk' could not be set.

Otherwise, the actual issue at hand seems to be fixed! The icons were out-of-date for each profile & shortcut, but clicking Update on each profile after applying it seemed to fix that up, too. Thanks for looking into this.

image.png (view on web) https://github.com/terrymacdonald/DisplayMagician/assets/7536168/25aa3a78-b8ab-4925-a006-ff9e649ad40b

— Reply to this email directly, view it on GitHub https://github.com/terrymacdonald/DisplayMagician/issues/187#issuecomment-1940468299, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLU5LF4GBKLYPQZR4NZGRDYTL5PRAVCNFSM6AAAAAAUHI3FHSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBQGQ3DQMRZHE . You are receiving this because you modified the open/close state.Message ID: @.***>

terrymacdonald commented 9 months ago

@legoadk Are you on Windows 10 or Windows 11?

I've looked up more information about that error, It seems to be a transient error related to registering DisplayMagician with windows so that it can do Windows Notifications (Toasts) in the bottom right corner of the taskbar when DM is minimised. It shouldn't be anything to worry about as long as it happens just that once.

If it keeps happening please log a new issue for it so that I know I need to start doing deeper investigation into it.

Thanks for all your help testing! Terry

legoadk commented 9 months ago

@legoadk Are you on Windows 10 or Windows 11?

Windows 11 Version 23H2 (OS Build 22631.3085)

If it keeps happening please log a new issue for it so that I know I need to start doing deeper investigation into it.

Yessir, will do.