[Bug]Xenoblade 3 on Vulkan with linux constantly crashes with AMD gpu #66

Open
opened 2024-10-26 03:19:33 +00:00 by Vbuck-gang · 3 comments
Vbuck-gang commented 2024-10-26 03:19:33 +00:00 (Migrated from github.com)

Description of the issue

linux mesa drivers seem to have fixed the constant flashing that used to usually happen when looking around in the dlc with AMD gpus but now it looks like the fix they used made the game extremely prone to crashing.

Reproduction steps

1.get the game and it's dlc

  1. boot the game

3.go to the dlc section and select your save

4.when your in the game try moving the camera a lot and move your character around

5.it will crash after you do step 4 enough

Log file

none

OS

Linux (holo iso)

Ryujinx version

1.245

Game version

2.0.0

CPU

5800X3D

GPU

7900XTX

RAM

32GB

List of applied mods

60FPS Mod

Additional context?

No response

### Description of the issue linux mesa drivers seem to have fixed the constant flashing that used to usually happen when looking around in the dlc with AMD gpus but now it looks like the fix they used made the game extremely prone to crashing. ### Reproduction steps 1.get the game and it's dlc 2. boot the game 3.go to the dlc section and select your save 4.when your in the game try moving the camera a lot and move your character around 5.it will crash after you do step 4 enough ### Log file none ### OS Linux (holo iso) ### Ryujinx version 1.245 ### Game version 2.0.0 ### CPU 5800X3D ### GPU 7900XTX ### RAM 32GB ### List of applied mods 60FPS Mod ### Additional context? _No response_
lordmyron commented 2024-10-27 00:05:40 +00:00 (Migrated from github.com)

This was a somewhat previously documented problem in regards to Xenoblade 2 as well. I was able to fix it temporarily by running "sudo hdparm -s 0 /dev/sdb1" if i remember correctly sdb1 must have been the disc with the game.

I have my last notification from the last thread that i can pull up. The thread there had also some other comments i can post here about IStorage or sth, maybe it can be useful

User A: So theoretically, if we wanted to be totally console-accurate about this, the ideal behavior would be to emulate tiny delays in IStorage reads based on the actual observed speed / latencies of game carts. I'm kind of reminded how Dolphin did the same thing to emulate read speeds from a spinning optical disc by using file offset to calculate where the laser would physically need to move to read that sector, because instant loads were causing problems for Metroid Prime. I guess there's some precedent for this.

User B: so I am experiencing this very same issue even in version 1.1.1385, sometimes I can go hours without it happening, other times It happening before I even get to the start screen lol.

User C: With v1.1.1385/Apple Silicon, I was getting a softlock going to the save menu virtually every time (there's a softlock opportunity at loading screens, when opening the save menu, when going into game options, etc, so even with a 10% rate I eventually always hit one).

Adding a sleep to IStorage reads helped a lot, and actually made loading screens a lot faster. Code patch based on User D's comment:

--- a/src/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IStorage.cs
+++ b/src/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IStorage.cs
@@ -1,6 +1,7 @@
using LibHac;
using LibHac.Common;
using LibHac.Sf;
+using System.Threading;

namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy
{
@@ -34,6 +35,10 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy
using var region = context.Memory.GetWritableRegion(bufferAddress, (int)bufferLen, true);
Result result = _baseStorage.Get.Read((long)offset, new OutBuffer(region.Memory.Span), (long)size);

  •            // https://github.com/Ryujinx/Ryujinx/issues/2357
    
  •            // Add a load-bearing sleep to avoid XC2 softlock
    
  •            Thread.Sleep(2);
    
  •            return (ResultCode)result.Value;
           }
    
This was a somewhat previously documented problem in regards to Xenoblade 2 as well. **I was able to fix it temporarily by running "sudo hdparm -s 0 /dev/sdb1"** if i remember correctly sdb1 must have been the disc with the game. I have my last notification from the last thread that i can pull up. The thread there had also some other comments i can post here about IStorage or sth, maybe it can be useful User A: So theoretically, if we wanted to be totally console-accurate about this, the ideal behavior would be to emulate tiny delays in IStorage reads based on the actual observed speed / latencies of game carts. I'm kind of reminded how Dolphin did the same thing to emulate read speeds from a spinning optical disc by using file offset to calculate where the laser would physically need to move to read that sector, because instant loads were causing problems for Metroid Prime. I guess there's some precedent for this. User B: so I am experiencing this very same issue even in version 1.1.1385, sometimes I can go hours without it happening, other times It happening before I even get to the start screen lol. User C: With v1.1.1385/Apple Silicon, I was getting a softlock going to the save menu virtually every time (there's a softlock opportunity at loading screens, when opening the save menu, when going into game options, etc, so even with a 10% rate I eventually always hit one). Adding a sleep to IStorage reads helped a lot, and actually made loading screens a lot faster. Code patch based on User D's comment: --- a/src/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IStorage.cs +++ b/src/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IStorage.cs @@ -1,6 +1,7 @@ using LibHac; using LibHac.Common; using LibHac.Sf; +using System.Threading; namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy { @@ -34,6 +35,10 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy using var region = context.Memory.GetWritableRegion(bufferAddress, (int)bufferLen, true); Result result = _baseStorage.Get.Read((long)offset, new OutBuffer(region.Memory.Span), (long)size); + // https://github.com/Ryujinx/Ryujinx/issues/2357 + // Add a load-bearing sleep to avoid XC2 softlock + Thread.Sleep(2); + return (ResultCode)result.Value; }
sokennethwasall commented 2024-10-27 02:46:35 +00:00 (Migrated from github.com)

This was a somewhat previously documented problem in regards to Xenoblade 2 as well. I was able to fix it temporarily by running "sudo hdparm -s 0 /dev/sdb1" if i remember correctly sdb1 must have been the disc with the game.

I have my last notification from the last thread that i can pull up. The thread there had also some other comments i can post here about IStorage or sth, maybe it can be useful

User A: So theoretically, if we wanted to be totally console-accurate about this, the ideal behavior would be to emulate tiny delays in IStorage reads based on the actual observed speed / latencies of game carts. I'm kind of reminded how Dolphin did the same thing to emulate read speeds from a spinning optical disc by using file offset to calculate where the laser would physically need to move to read that sector, because instant loads were causing problems for Metroid Prime. I guess there's some precedent for this.

User B: so I am experiencing this very same issue even in version 1.1.1385, sometimes I can go hours without it happening, other times It happening before I even get to the start screen lol.

User C: With v1.1.1385/Apple Silicon, I was getting a softlock going to the save menu virtually every time (there's a softlock opportunity at loading screens, when opening the save menu, when going into game options, etc, so even with a 10% rate I eventually always hit one).

Adding a sleep to IStorage reads helped a lot, and actually made loading screens a lot faster. Code patch based on User D's comment:

--- a/src/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IStorage.cs +++ b/src/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IStorage.cs @@ -1,6 +1,7 @@ using LibHac; using LibHac.Common; using LibHac.Sf; +using System.Threading;

namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy { @@ -34,6 +35,10 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy using var region = context.Memory.GetWritableRegion(bufferAddress, (int)bufferLen, true); Result result = _baseStorage.Get.Read((long)offset, new OutBuffer(region.Memory.Span), (long)size);

  •            // https://github.com/Ryujinx/Ryujinx/issues/2357
    
  •            // Add a load-bearing sleep to avoid XC2 softlock
    
  •            Thread.Sleep(2);
    
  •            return (ResultCode)result.Value;
           }
    

This sounds so similar to the soft lock I’m getting in Pokémon Violet on an M2 Max MacBook Pro. Sometimes I can go hours without it happening, other times just minutes into the game… mostly around menu’s or loading screens.

Btw @GreemDev, thank you for the work here 🙏🏼

> This was a somewhat previously documented problem in regards to Xenoblade 2 as well. **I was able to fix it temporarily by running "sudo hdparm -s 0 /dev/sdb1"** if i remember correctly sdb1 must have been the disc with the game. > > I have my last notification from the last thread that i can pull up. The thread there had also some other comments i can post here about IStorage or sth, maybe it can be useful > > User A: So theoretically, if we wanted to be totally console-accurate about this, the ideal behavior would be to emulate tiny delays in IStorage reads based on the actual observed speed / latencies of game carts. I'm kind of reminded how Dolphin did the same thing to emulate read speeds from a spinning optical disc by using file offset to calculate where the laser would physically need to move to read that sector, because instant loads were causing problems for Metroid Prime. I guess there's some precedent for this. > > User B: so I am experiencing this very same issue even in version 1.1.1385, sometimes I can go hours without it happening, other times It happening before I even get to the start screen lol. > > User C: With v1.1.1385/Apple Silicon, I was getting a softlock going to the save menu virtually every time (there's a softlock opportunity at loading screens, when opening the save menu, when going into game options, etc, so even with a 10% rate I eventually always hit one). > > Adding a sleep to IStorage reads helped a lot, and actually made loading screens a lot faster. Code patch based on User D's comment: > > --- a/src/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IStorage.cs +++ b/src/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IStorage.cs @@ -1,6 +1,7 @@ using LibHac; using LibHac.Common; using LibHac.Sf; +using System.Threading; > > namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy { @@ -34,6 +35,10 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy using var region = context.Memory.GetWritableRegion(bufferAddress, (int)bufferLen, true); Result result = _baseStorage.Get.Read((long)offset, new OutBuffer(region.Memory.Span), (long)size); > > * ``` > // https://github.com/Ryujinx/Ryujinx/issues/2357 > ``` > * ``` > // Add a load-bearing sleep to avoid XC2 softlock > ``` > * ``` > Thread.Sleep(2); > ``` > * ``` > return (ResultCode)result.Value; > } > ``` This sounds so similar to the soft lock I’m getting in Pokémon Violet on an M2 Max MacBook Pro. Sometimes I can go hours without it happening, other times just minutes into the game… mostly around menu’s or loading screens. Btw @GreemDev, thank you for the work here 🙏🏼
useranon350 commented 2024-12-15 14:57:54 +00:00 (Migrated from github.com)

Is there any resource online with IOPS information on Switch eMCC flash? Probably a simple IOPS cap based on the QD64 performance would avoid triggering most game bugs. (It isn't impossible that some games are so latency-sensitive that the difference between queue depths matters, but realistically those games would have random bugs on real hardware as well.)

Is there any resource online with IOPS information on Switch eMCC flash? Probably a simple IOPS cap based on the QD64 performance would avoid triggering most game bugs. (It isn't impossible that some games are so latency-sensitive that the difference between queue depths matters, but realistically those games would have random bugs on real hardware as well.)
Sign in to join this conversation.
No Milestone
No project
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MeloNX/Ryujinx-ryubing#66
No description provided.