Hi,
I am trying to debug some graphics on the .net core based nintendo switch emulator, Ryujinx, however when launching I always get the error:
Connection error detected communicating with target application.
Shutting down connection.
Ryujinx starts with a cmd window, sets the title and then does some initialization stuff that prints to the cmd window. After a few seconds it opens the opengl window. However when launching through NSight it opens the cmd window, sets the title then gives the above error before writing anything to the console. Basically the graphics window hasn’t even started.
Some info:
- The application is using opengl 3.3 (with some extension methods from later opengl versions).
- I have made sure the GraphicsContext is created with the debug flag.
- I’m using a GTX 780 with the latest GPU drivers and the latest NSight Graphics (2019.1.0.0)
- Launched NSight as admin
- I’m able to launch The Witcher 3 without issues (I have no idea what graphics framework it’s using, maybe directx)
- Another developer is able to launch Ryujinx within NSight Graphics
- In the connect dialog I have
- Application executable set to dotnet.exe
- Working directory set to the Ryujinx debug folder
- Command line arguments set to Ryujinx.dll inside the Ryujinx debug folder then the path to a switch game I am trying to test
I haven’t changed any further settings. You have to go through .net as there is no .exe created by default in .netcore. You have to pass your dll into the .net application to boot.
I have tested running the command from cmd and Ryujinx launches just fine.
I think that’s all the info I have. Any help would be appreciated as it’s driving me up the wall.
I have never used NSight before so if there is any more info you need just let me know.
Thank you
Hi Andy,
Thanks for all the info and sorry that you are running into this issue.
A couple things that would help:
- Can you paste a picture of your connection dialog?
- Have you tried turning “Automatically Connect” to No?
Incase that doesn’t work there are a few more connection workarounds here: [url]https://docs.nvidia.com/nsight-graphics/UserGuide/index.html#troubleshooting_problem___the_application_fails_to_launch[/url]
Let me know if anything of these worked! If not, we will probably have to get a hold of Ryujinx and test on our side.
Thanks,
Seth
Thanks for getting back to me Seth,
I have tried the things you suggested with no luck. I do however have more information.
First the picture you requested: https://puu.sh/CHOy2/51688d0bd3.png
With auto connect off the cmd window opens then closes pretty much immediately. There is no connection error but that’s presumably because it never tries to connect.
On the web page you linked I discovered how to attach the debugger, with that I found that the crash happens in .net and it never gets to main. The error is pretty cryptic:
Exception thrown at 0x00007FFDB7ADF218 (KernelBase.dll) in dotnet.exe: 0x04242420 (parameters: 0x0000000031415927, 0x00007FFD62F20000, 0x000000FC6C7EDAC0). occurred
This is clearly different to running without the debugger attached as then the console title is set, the first line of main.
If you want to get Ryujinx to test you can download the latest build here: https://ryujinx.org/#/Build
As it’s open source you can also get the code on the GitHub: https://github.com/Ryujinx/Ryujinx
It doesn’t do much without a game to play, so you can use this test game I have made: https://github.com/BaronKiko/Ryujinx-OGL-Demos/releases/tag/cont_attrib
Give Ryujinx the path to that file as the first command line parameter and it should display a triangle that oscillates.
You can also find the source for that game on its GitHub but after emulation the code that’s actually running is pretty far from the source.
Finally as a bonus, once working, I would also like to attach NSight to the sub window created by my profiling PR (https://github.com/Ryujinx/Ryujinx/pull/567). It’s a totally independent OpenGL window so I don’t know how you would separate the 2 or if NSight even supports that.
Thank you for your help,
Andy
Only just thought to check. The other dev that got it to work is using NSight 2018.7. I just tried it and it works, I still get the .net error but it continues fine. So I can use that for now, hopefully you can find the issue in NSight 2019.
Hi Andy,
Glad you are unblocked! And thank you very for the additional information.
It is concerning that 2019.1 isn’t working in this case. I’ll file an issue and report back when fixed.
Cheers,
Seth
Awesome, thank you for the help and good luck.