DarioSamo / sm64rt

Fork of https://github.com/sm64pc/sm64ex with raytracing support.
284 stars 14 forks source link

Grey windows appears then disappears #2

Closed currall closed 3 years ago

currall commented 3 years ago

Game won't load, when i launch the exe this grey window appears for half a second then vanishes.

In event viewer i get some error with KERNELBASE.dll, idk if thats relevant

explorer_3PYzYNMkal

DarioSamo commented 3 years ago

Can you do the following?

1) Make sure your GPU drivers are up to date. 2) Run the game using the windows terminal (e.g. powershell) and see if anything relevant comes up. 3) Write down your specifications.

currall commented 3 years ago
  1. GPU Drivers are up to date
  2. Launches as expected, no error in powershell or anything
  3. Ryzen 5 3600, RTX 2060, 16GB 3200 RAM
HHasashi commented 3 years ago

Wanted to add that I also have the same problem, nearly the same specs (R7 2700x, 16GB 3200, base RTX 2060). Also checked that my GPU drivers are up to date and the game launches as expected, no error in Windows PowerShell or anything. Thanks in advance !

DarioSamo commented 3 years ago

Alright, let's do some further tests:

  1. Can you check if this sample runs for you? rt64sample.zip
  2. What is your Windows 10 version? (check with winver command)
  3. If you're familiar with running gdb, posting the backtrace would help as well. From MSYS2, you can go to build/<region_pc>/ and run gdb <sm64exefile>, type run and Enter when it starts, and once it crashes, you can print the backtrace with backtrace and Enter.
Nama commented 3 years ago

I was too lazy to upgrade, so I'm on 466.11 and it works. Maybe try downgrading if nothing else works. Ryzen 7 2700 RTX 2070 Win10 20H2 19042.928

currall commented 3 years ago
  1. Sample also crashed, same as the game
  2. Version 1809

I'll try the backtracking thing and downgrading video drivers tomorrow

HHasashi commented 3 years ago

The sample does not work, same problem as with RT64, gray screen then crashes. I did the backtracing and got this :

0 0x00007ffde70b9689 in RaiseException ()

from /c/Windows/System32/KERNELBASE.dll

1 0x00007ffdcc7f6220 in _CxxThrowException ()

from /c/Windows/SYSTEM32/VCRUNTIME140.dll

2 0x00007ffdbc15964c in ?? () from /home/Heuss/sm64ex/build/us_pc/rt64lib.dll

3 0x00007ffdbc15bfa5 in rt64lib!RT64_CreateDevice ()

from /home/Heuss/sm64ex/build/us_pc/rt64lib.dll

4 0x00007ff6ca5fa749 in ?? ()

Backtrace stopped: previous frame inner to this frame (corrupt stack?)

I use Windows 10 LTSC version 1809 (other RTX games such as Quake RTX or BF5 works with my PC btw). I'm on 466.27.

currall commented 3 years ago

The sample does not work, same problem as with RT64, gray screen then crashes. I did the backtracing and got this :

0 0x00007ffde70b9689 in RaiseException ()

from /c/Windows/System32/KERNELBASE.dll

1 0x00007ffdcc7f6220 in _CxxThrowException ()

from /c/Windows/SYSTEM32/VCRUNTIME140.dll

2 0x00007ffdbc15964c in ?? () from /home/Heuss/sm64ex/build/us_pc/rt64lib.dll

sm64pc#3 0x00007ffdbc15bfa5 in rt64lib!RT64_CreateDevice () from /home/Heuss/sm64ex/build/us_pc/rt64lib.dll sm64pc#4 0x00007ff6ca5fa749 in ?? () Backtrace stopped: previous frame inner to this frame (corrupt stack?)

I use Windows 10 LTSC version 1809 (other RTX games such as Quake RTX or BF5 works with my PC btw). I'm on 466.27.

I get a very similar error, definitely the same DLL. I wonder if it's caused by ltsc, I use that too and it doesn't work yet it works on 20h2 apparently?

DarioSamo commented 3 years ago

I do think this might be because of the Windows version actually, as RT64 is compiled with a newer version of the Windows SDK, newer than the versions you're both using.

I don't mean to force you to upgrade, but it sounds like the most likely solution here.

DarioSamo commented 3 years ago

Alternatively, you can try building RT64 yourselves on the older SDK and see if it works, but I don't know if theres any code changes that will break it.

HHasashi commented 3 years ago

You use LTSC too ? Then maybe that's the problem. This, or maybe our Windows version (1809) is too old for the game to run ? But that will be weird as other RTX games runs well and this version supports DXR well enough. If upgrading is really the solution, like you said, then that will be impossible as the latest LTSC Win is 1809. I don't think I have the skill to build it myself tho, thanks for the help anyway !

DarioSamo commented 3 years ago

Well, it's not really a matter of the DXR version, more like a Windows SDK version. Let me check if I can build that simple in a lower version and see if it fixes the problem.

Llennpie commented 3 years ago

I'm on 20H2 (OS Build 19042.928). Same issue here.

DarioSamo commented 3 years ago

I'm on 20H2 (OS Build 19042.928). Same issue here.

Can you confirm whether any of the other steps posted so far help at all in tracking down the issue?

HHasashi commented 3 years ago

Thanks man, I really appreciate the effort !

DarioSamo commented 3 years ago

Well, it's not really a matter of the DXR version, more like a Windows SDK version. Let me check if I can build that simple in a lower version and see if it fixes the problem.

Well, this seems like a no go, as the memory allocation library by AMD requires the latest version to build properly (at least from a quick attempt).

Then again, someone on 20H2 has posted that they have the same issue, so I can't say that's the issue yet.

Llennpie commented 3 years ago

Can you confirm whether any of the other steps posted so far help at all in tracking down the issue?

I have the latest drivers, so I can attempt to compile RT64 myself. Which Windows 10 SDK version should I use? Older or newer?

Llennpie commented 3 years ago

Also, here's my GDB info.

(gdb) run
Starting program: D:\msys\home\user\sm64rt\build\us_pc\sm64.us.f3dex2e.exe
[New Thread 13176.0x1cc8]
[New Thread 13176.0x2144]
[New Thread 13176.0x1b3c]
[New Thread 13176.0x1100]
[New Thread 13176.0x1488]
[New Thread 13176.0x1354]
[New Thread 13176.0x2b28]
[Thread 13176.0x2b28 exited with code 0]
[New Thread 13176.0x1964]
[Thread 13176.0x1964 exited with code 0]
[New Thread 13176.0x2d70]
[New Thread 13176.0x1a78]
gdb: unknown target exception 0xe06d7363 at 0x7ffca56c4b59

Thread 1 received signal ?, Unknown signal.
0x00007ffca56c4b59 in RaiseException ()
   from C:\Windows\System32\KernelBase.dll
(gdb)
DarioSamo commented 3 years ago

Can you confirm whether any of the other steps posted so far help at all in tracking down the issue?

I have the latest drivers, so I can attempt to compile RT64 myself. Which Windows 10 SDK version should I use? Older or newer?

Personally I use version 10.0.19041.0.

If you do try building RT64 yourself, you can launch the sample in debug mode and see what the call stack says on VS2019. That'd certainly help a lot.

DarioSamo commented 3 years ago

I'm on 20H2 (OS Build 19042.928). Same issue here.

By the way, can you confirm what GPU do you have?

So far everyone with problems has an RTX 2060 I believe. Just trying to keep track of what the common problem could be.

DarioSamo commented 3 years ago

@HHasashi @currall @Llennpie Are you all by any chance laptop users? Do you have some sort of option that allows you to choose the preferred GPU for an application?

HHasashi commented 3 years ago

Absolutely not, since the R7 2700x is a desktop CPU, and doesn't have any integrated GPU, thus the same for Mr. Currall too. The only GPU we can use then is our 2060 :/

DarioSamo commented 3 years ago

Absolutely not, since the R7 2700x is a desktop CPU, and doesn't have any integrated GPU, thus the same for Mr. Currall too. The only GPU we can use then is our 2060 :/

Alright, I've gotten confirmation from another user with an RTX 2060 at least that it does run on their desktop system as well. So I think we can rule that out for now.

I'll try to see if I can get some information regarding the Driver and Windows version.

DarioSamo commented 3 years ago

One desktop user using Windows version 2004 and driver 456.71 has confirmed this works on their RTX 2060.

Llennpie commented 3 years ago

I've built the RT64 sample project. Upon launching the .exe, I get the same grey window and crash. Here's the output:

image

Hopefully this helps.

DarioSamo commented 3 years ago

@Llennpie Do you think you could run it from the Visual Studio 2019 debugger instead (open solution and press F5, make sure to set up the sample project as the "Startup" project first) and see if the output Window has anything of interest?

I think the view may have failed to create due to an exception, but it's not printed to the regular console.

Nightcaat commented 3 years ago

Are you all by any chance laptop users? Do you have some sort of option that allows you to choose the preferred GPU for an application?

Am a laptop user and was experiencing the same issue, setting a preference in Settings worked :)

image

HHasashi commented 3 years ago

Do you think that a background process could actually be the cause (such as LivelyWallpaper, TaskbarX, RivaTuner/Afterburner, F.lux, Geforce Experience etc...) ?

Nama commented 3 years ago

Probably not, but try? I have MSI Afterburner without Rivertuner running and also GF Experience (btw, it doesn't recognizes as a game, so the FPS counter etc. dont work D:) and its working.

HHasashi commented 3 years ago

Yeah no luck again :/

HHasashi commented 3 years ago

I'll wait for the Render96 version or for the 20 version Windows 10 LTSC to release. Thanks anyway for the help guys !

DarioSamo commented 3 years ago

I've made a newer version of the sample that should show a more detailed error message in theory.

Can any of you check it out?

HHasashi commented 3 years ago

I get those 2 errors, even tho dxwebsetup says that I have the latest DX version installed. 2060 GPUs supports DX12 too, and my drivers are up-to-date (466.27).

error 1 error 2

DarioSamo commented 3 years ago

@HHasashi Seems like I made a small mistake when formatting the error message, think you can redownload and try it again? Just updated it so it prints the error code instead. Just grab it again from the same link.

erherhh4herh commented 3 years ago

image

This is what I get. I have the grey window bug as well. It should be noted I'm on an older version of windows (1903), and my nvidia driver is 461.40. I'm updating my nvidia drivers to test, I'll upload the result.

DarioSamo commented 3 years ago

MSDN defines that error code as this:

0x80004002 - E_NOINTERFACE No such interface supported

Can't say I understand what exactly would trigger this, but I will investigate it some more. It's starting to sound to me like it's related to the Windows 10 version in that particular case though.

HHasashi commented 3 years ago

I tried it and got the same error code as "erherhh4herh". Thanks for your effort.

erherhh4herh commented 3 years ago

I updated to 466.27, and I get the same error.

DarioSamo commented 3 years ago

I don't think I can do much more other than ask you to try updating Windows 10 I guess.

I'm aware you've said that other RTX software works, but those were probably developed with older versions of the SDK, and I downloaded the SDK around August 2020. I do not have any other alternative than going back and reimplementing it on older SDKs, and the code might not even be compatible.

Given you're likely to have trouble with other software that uses these newer SDKs in the future, my recommendation is to just update. I'm not sure I can manage the effort in sticking to older versions for supporting such a long gap in releases.

erherhh4herh commented 3 years ago

I'll try updating, I would prefer not to because Microsoft is pretty anal about forcing updates, and have broken things many times before. Is it possible to set a specific sdk version when building with the make command? It should also be noted that I do not have an rtx card. But I have run dxr games before on here.

DarioSamo commented 3 years ago

RT64 is built separately from sm64rt by using Visual Studio 2019.

You can set the Windows SDK version in RT64 from Visual Studio on the project configuration, but it causes compilation errors on previous versions. And most of them aren't even on my code, but on AMD's Memory Allocator that this library relies on (which is a really good solution to handling efficient memory creation in D3D12).

Nama commented 3 years ago

I guess DirectX 12.1 is supported on Windows 10 20H1 and later.

HHasashi commented 3 years ago

I can't update my Windows unless I switch editions (latest LTSC is 1809)

erherhh4herh commented 3 years ago

I updated to 20H2 and it works now!

HHasashi commented 3 years ago

Is there anyone using LTSC Win10 who got the game running w/o problems ?

DarioSamo commented 3 years ago

Is there anyone using LTSC Win10 who got the game running w/o problems ?

I don't think there will be. I just double checked the SDK version I'm using and it only supports 2004 and above. So that explains the error easily.

Only way to get this running on 1809 would be to downgrade the SDK and rewrite any code that breaks it.

HHasashi commented 3 years ago

You think it is a tedious process ? Do you think you can do it please ?

DarioSamo commented 3 years ago

It requires rewriting code that isn't mine but rather from AMD, so I don't think I can do it. Sorry.

HHasashi commented 3 years ago

Nah that's ok, I really appreciate the time and effort thank you : )

DarioSamo commented 3 years ago

I guess just to not leave it in such a bad note: it is more likely a Vulkan backend will work on LTSC. I don't know how far away a Vulkan version of RT64 is, but with D3D12 for now I'm afraid it's Microsoft's way or the highway. But Vulkan support is needed for Linux anyway, which I would definitely like to support.