vkd3d-proton icon indicating copy to clipboard operation
vkd3d-proton copied to clipboard

Pioneers of Pagonia Demo (2552960) Freeze when pressing anything in the HUD for placement

Open Somamint opened this issue 2 years ago • 36 comments
trafficstars

Like before but still does not work: https://github.com/HansKristian-Work/vkd3d-proton/issues/1719

The game launches, everything works. But once you try to build something the game stops to work.

Bildschirmfoto vom 2023-10-05 17-42-12

Software information

Pioneers of Pagonia

System information

GPU: RTX 2060 
Driver: 535.113.01
Wine version: proton-bleeding edge

Log files

steam-2552960.log

Somamint avatar Oct 05 '23 16:10 Somamint

Can you please clarify what you mean by "stops to work" and give us the exact steps required to reproduce that? Building stuff seems to work fine here:

Bildschirmfoto-197

doitsujin avatar Oct 05 '23 17:10 doitsujin

Sure i made a quick video. So it just stopped and i need to close it manually.

https://github.com/HansKristian-Work/vkd3d-proton/assets/48291814/11dd1dd7-52b7-4fe0-95ee-2e9072b4cf27

Somamint avatar Oct 05 '23 17:10 Somamint

What are your settings? There's a known GPU hang with upscaling enabled but that might very well be a game bug.

doitsujin avatar Oct 05 '23 17:10 doitsujin

Bildschirmfoto vom 2023-10-05 18-40-00

Somamint avatar Oct 05 '23 17:10 Somamint

The GPU hang issue is definitely an app bug.

In the UI shaders, a bindless index is passed through from VBO into pixel shader where it accesses heap out of bounds with an index of 12 million.

The VBO itself is a sysmem buffer only written by CPU. Not sure what we can do here, it's clearly a broken game. Maybe some race condition in asset management.

HansKristian-Work avatar Oct 06 '23 11:10 HansKristian-Work

The first issue with the upscale video setting that caused GPU hangs on AMD didn't cause hangs on NV for me, but this one does give a Xid 109 on RTX 4070 with 535.43.10.

Here are breadcrumb logs: pagonia_Xid109_logs_breadcrumbs.zip

runar-work avatar Oct 06 '23 12:10 runar-work

Couldn't repro this with RX 7600 and RADV 23.2.1, so seems to be NV specific for me at least.

runar-work avatar Oct 06 '23 13:10 runar-work

Still doesnt work for me after #1719 , same as Somamint reported. Before #1719 Game crashed to Desktop after trying to build. Now with bleeding-edge proton game just freezes.

window mode, no upscale and lowest gfx settings (gfx settings doesnt matter - always same behavior)

pop-gfx-settings

System information

OS: Manjaro (5.15.131-1-MANJARO) GPU: nvida RTX 3070 TI Driver: 535.104.05 Wine version: Proton: 1696596844 experimental-bleeding-edge-8.0-58491-20231006-pdf5240-w57c5732-d4d9746-v792b25

Steam Log: steam-2552960.zip

PS: Just registered to help! Thx for all your work! ♥

dEFTRON1 avatar Oct 06 '23 14:10 dEFTRON1

Try the "Proton Experimental" with the Experimantal setting: "bleeding-edge - latest and untested dxvk, vkd3d-proton and wine changes; backup your prefixes before using". It is a Workaround from @dellas

karzinogen avatar Oct 06 '23 14:10 karzinogen

Try the "Proton Experimental" with the Experimantal setting: "bleeding-edge - latest and untested dxvk, vkd3d-proton and wine changes; backup your prefixes before using". It is a Workaround from @Dellas

Hi thx for replay. That's the version I was using. But proton experimental just received an update for me so I had hope that it'll work now. Unfortunately it still freezes after trying to build something.

I also deleted and reinstalled the game after the proton experimental update.

New Steam Log after proton Update

steam-2552960.zip

Screenshots:

freeze_after_build_click proton_bleeding_backup_prefix proton_experimental_update

dEFTRON1 avatar Oct 06 '23 17:10 dEFTRON1

Try the "Proton Experimental" with the Experimantal setting: "bleeding-edge - latest and untested dxvk, vkd3d-proton and wine changes; backup your prefixes before using". It is a Workaround from @Dellas

Hi thx for replay. That's the version I was using. But proton experimental just received an update for me so I had hope that it'll work now. Unfortunately it still freezes after trying to build something.

I also deleted and reinstalled the game after the proton experimental update.

New Steam Log after proton Update

steam-2552960.zip

Screenshots:

freeze_after_build_click proton_bleeding_backup_prefix proton_experimental_update

Did you tried 525 Driver Version as well? I try to install this. But on POP.OS seems gone to install it.

Somamint avatar Oct 06 '23 18:10 Somamint

I have the same problem with a RTX 4060 and 525 driver version and latest proton experimental steam-2155180.log.gz

davidweisgerber avatar Dec 15 '23 14:12 davidweisgerber

The freeze is caused by this pixel shader. It's only used to render the helper ui during build mode (roads and buildings)

struct SDomainOut
{
    precise float4 Position : SV_POSITION;
    float2 GroundPosition : GROUNDPOS;
    float3 WorldPosition : WORLDPOS;
    float2 UV : UV;
    uint DataIndex : INDEX;
};

float sceneTime;

cbuffer primitiveData
{
    float4 primData[4096];
};

cbuffer linkData
{
    uint4 lData[4096];
};

static const float PI = acos(-1);

Texture2D tAllTextures[];
SamplerState StencilsSampler;

float4 ps_main(SDomainOut input) : SV_TARGET0
{
    while (true)
    {
        uint4 link = lData[input.DataIndex];
        
        uint index = link.x;
        
        switch (link.y)
        {
            case 0: // filled Circle
            {
                    float4 color = primData[index];
                    float4 data = primData[index + 1];
    
                    float distance = length(input.GroundPosition - data.xy);
    
                    if (distance <= data.z)
                    {
                        return color;
                    }
               
                    break;
                }
            
            case 1: // circle
            {
                    float4 color = primData[index];
                    float4 data = primData[index + 1];
    
                    float distance = length(input.GroundPosition - data.xy);
    
                    if (distance >= data.z && distance <= data.w)
                    {
                        return color;
                    }
               
                    break;
                }
            
            case 2: // Line
            {
                    float4 color = primData[index];
                    float4 linePos = primData[index + 1];
                    float4 data2 = primData[index + 2];
                
                    float t = dot(input.GroundPosition - linePos.xy, linePos.zw) * data2.y;
    
                    if (t == saturate(t))
                    {
                        float2 p = linePos.xy + t * linePos.zw;
    
                        float d = distance(input.GroundPosition, p);
    
                        if (d <= data2.x)
                        {
                            return color;
                        }
                    }
                
                    break;
                }
            
            case 3: // Filled Rectangle
            {
                    float4 color = primData[index];
                    float3 pos = float3(input.GroundPosition, 1);
                    float2 uv = float2(dot(pos, primData[index + 1].xyz), dot(pos, primData[index + 2].xyz));
                
                    if (all(uv == saturate(uv)))
                    {
                        return color;
                    }
                
                    break;
                }
            
            case 4: // Rectangle
            {
                    float4 color = primData[index];
                    float3 pos = float3(input.GroundPosition, 1);
                    float2 uv = float2(dot(pos, primData[index + 1].xyz), dot(pos, primData[index + 2].xyz));
                
                    if (all(uv == saturate(uv)))
                    {
                        float2 width = float2(primData[index + 1].w, primData[index + 2].w);
                    
                        if (uv.x <= width.x || uv.x >= (1.0 - width.x) ||
                            uv.y <= width.y || uv.y >= (1.0 - width.y))
                        {
                            return color;
                        }
                    }
                
                    break;
                }
            
            case 5: // Stencil
            {
                    float4 color = primData[index];
                    float3 pos = float3(input.GroundPosition, 1);
                    float2 uv = float2(dot(pos, primData[index + 1].xyz), dot(pos, primData[index + 2].xyz));
                
                    if (all(uv == saturate(uv)))
                    {
                        color *= tAllTextures[link.z].Sample(StencilsSampler, float2(uv.x, 1 - uv.y));
                    
                        if (color.w > 0)
                        {
                            return color;
                        }
                    }
                
                    break;
                }
            
            case 6: // filled Circle segment
            {
                    float4 color = primData[index];
                    float4 data = primData[index + 1];
                    float4 data2 = primData[index + 2];
    
                    float distance = length(input.GroundPosition - data.xy);
    
                    if (distance <= data.z)
                    {
                        float arc = atan2(input.GroundPosition.x - data.x, input.GroundPosition.y - data.y);
                    
                        arc = (arc + 2 * PI) % (2 * PI);
                    
                        if (data2.y > data2.x)
                        {
                            if (arc >= data2.x && arc <= data2.y)
                            {
                                return color;
                            }
                        }
                        else
                        {
                            if (arc <= data2.y || arc >= data2.x)
                            {
                                return color;
                            }
                        }
                    
                    }
               
                    break;
                }
            
            case 7: // filled Circle segment
            {
                    float4 color = primData[index];
                    float4 data = primData[index + 1];
                    float4 data2 = primData[index + 2];
    
                    float distance = length(input.GroundPosition - data.xy);
    
                    if (distance >= data.z && distance <= data.w)
                    {
                        float arc = atan2(input.GroundPosition.x - data.x, input.GroundPosition.y - data.y);
                    
                        arc = (arc + 2 * PI) % (2 * PI);
                    
                        if (data2.y > data2.x)
                        {
                            if (arc >= data2.x && arc <= data2.y)
                            {
                                return color;
                            }
                        }
                        else
                        {
                            if (arc <= data2.y || arc >= data2.x)
                            {
                                return color;
                            }
                        }
                    
                    }
               
                    break;
                }
        }
        
        
        
        if (link.w != 0)
        {
            break;
        }
        
        input.DataIndex++;
    }
    
    discard;
    
    return float4(0, 0, 0, 0);

}

To be exact it is this line that is causing it:

color *= tAllTextures[link.z].Sample(StencilsSampler, float2(uv.x, 1 - uv.y));

link.z is a valid index when this case is used. Beside replacing the sample with a load prevents the freeze:

uint w;
uint h;
uint l;

tAllTextures[link.z].GetDimensions(0, w, h, l);
color *= tAllTextures[link.z].Load(int3(uv.x * w, (1 - uv.y) * h, 0));

But as we lose the texture filter this way it's not an option.

As it works with the exact same hardware with D3D12 on Windows I need to assume that the error is either in vkd3d itself or the Nvidia Vulkan driver. Both are outside of the things I personally can fix.

RalfKornmannEnvision avatar Apr 16 '24 07:04 RalfKornmannEnvision

On the NVIDIA forums a moderator has acknowledged this problem and that they are looking into it. However, nothing new so far, last word is that they are investigating. Several other games with similar(?) problems will be fixed in the next update of the NVIDIA drivers.

RobertZenz avatar Apr 16 '24 09:04 RobertZenz

I chime in because I use a AMD GPU and have the same problem now, after I was able to play the game for some time. I cannot narrow down what change let to this behaviour as I was not playing for a couple of weeks. In the meantime there were of course updates to Steam, Proton and the game itself.

System Info:

Linux interozitor 6.6.13+bpo-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.6.13-1~bpo12+1 (2024-02-15) x86_64 GNU/Linux

OpenGL renderer string: AMD Radeon RX 5500 XT (navi14, LLVM 15.0.6, DRM 3.54, 6.6.13+bpo-amd64)

trekkie3k avatar Apr 16 '24 18:04 trekkie3k

It still works for me with Proton Experimental (GPU: Nvidia GTX 1070). I believe that all old Nvidea 10s work.

karzinogen avatar Apr 16 '24 18:04 karzinogen

The game crashes on AMD (6750 XT) and Nvidia (3070 TI) now, when I click a button in the build menu. Previously it just froze on Nvidia.

I tested it with several Proton versions.

Root-Core avatar Apr 20 '24 20:04 Root-Core

The game crashes on AMD (6750 XT) and Nvidia (3070 TI) now, when I click a button in the build menu. Previously it just froze on Nvidia.

I tested it with several Proton versions.

Same for me now on my second system (1060) it worked before. Now it crashes to desktop if i click on the build menu.

Somamint avatar Apr 21 '24 13:04 Somamint

Same here: crash with Nvidia1060, if you try to select the building, you want to build.

No Xid error in kernel log.

system: https://paste.cachyos.org/p/98eba44

steam-2155180.log.gz

monarc99 avatar Apr 21 '24 16:04 monarc99

In fact, I have to revise my last statement. My last error-free game was on 28.03. Now it is just as unplayable as yours.

karzinogen avatar Apr 21 '24 18:04 karzinogen

Oh dear, oh dear

I needed to change the shader to work around a Intel ARC driver bug (on Windows). It looks like it now hits an assert in the vkd3d dxil to spirv conversion.

header->dominates(merge) && header->dominates(path) ../src-vkd3d-proton/subprojects/dxil-spirv/cfg_structurizer.cpp:4316

I will see if I can find a workaround for this issue

RalfKornmannEnvision avatar Apr 21 '24 18:04 RalfKornmannEnvision

The issue with Pioneers of Pagonia freezing on NVIDIA GPUs is currently fixed in the Vulkan developer beta driver branch. It will also be fixed in the upcoming release branch drivers, but the developer beta is the the only public release that has the fix for now.

esullivan-nvidia avatar Apr 26 '24 05:04 esullivan-nvidia

The issue with Pioneers of Pagonia freezing on NVIDIA GPUs is currently fixed in the Vulkan developer beta driver branch. It will also be fixed in the upcoming release branch drivers, but the developer beta is the the only public release that has the fix for now.

Nice any idea, when it will be available ?

Somamint avatar Apr 26 '24 08:04 Somamint

Nice any idea, when it will be available ?

The beta driver is available now on this page under "Vulkan Beta Driver Downloads": https://developer.nvidia.com/vulkan-driver

esullivan-nvidia avatar Apr 26 '24 16:04 esullivan-nvidia

Nice any idea, when it will be available ?

The beta driver is available now on this page under "Vulkan Beta Driver Downloads": https://developer.nvidia.com/vulkan-driver

thanks what i mean, when will it like easy to install in the branch

Somamint avatar Apr 26 '24 17:04 Somamint

Did someone test with 555.42.02 (released yesterday)? Want to buy the game but only when it's finally fixed :D

daugustin avatar May 22 '24 16:05 daugustin

@daugustin I confirm the game runs fine with the driver released yesterday. :partying_face:

image

danieldebuhr avatar May 22 '24 20:05 danieldebuhr

Hello!

The game still crashes on the initially mentioned condition on my AMD mobile system with several Proton versions.

Linux workframe 6.9.5-arch1-1 #1 SMP PREEMPT_DYNAMIC Sun, 16 Jun 2024 19:06:37 +0000 x86_64 GNU/Linux

OpenGL renderer string: AMD Radeon 780M (radeonsi, gfx1103_r1, LLVM 17.0.6, DRM 3.57, 6.9.5-arch1-1)

depate avatar Jun 22 '24 14:06 depate

The game still crashes on the initially mentioned condition on my AMD mobile system with several Proton versions.

Linux workframe 6.9.5-arch1-1 #1 SMP PREEMPT_DYNAMIC Sun, 16 Jun 2024 19:06:37 +0000 x86_64 GNU/Linux

OpenGL renderer string: AMD Radeon 780M (radeonsi, gfx1103_r1, LLVM 17.0.6, DRM 3.57, 6.9.5-arch1-1)

I can confirm this also for AMD desktop GPUs, recently tested with a Radeon RX 7600.

trekkie3k avatar Jun 22 '24 15:06 trekkie3k

~As the issue seems to be fixed with Nvidia graphics, do we need to inform mesa (radv)/AMD developers?~

Edit: @trekkie3k I can confirm, that with the latest mesa commit from main, the game runs smoothly and does not crash with the mentioned issue. I also used bleeding-edge proton-experimental as previously shown. I only observed two freezes, which did not affect the OS or graphics as before, within 5 minutes in an already won co-op endgame after 3h from the start. However, I couldn't make out any logs or errors on the Linux kernel side of things.

The used AUR packages for Archlinux are 1 & 2.

depate avatar Jun 22 '24 16:06 depate