Skip to content

v3d: [drm:v3d_reset [v3d]] *ERROR* V3D_ERR_STAT: 0x00001000 when running app that uses vulkan #7790

Open

Description

@agorgl

Describe the bug

On a Raspberry Pi 4B (4GB version), running a game that uses Vulkan for rendering results in GPU hang and reset.

The same exact game with the same exact setup, works without problems when using OpenGL. The game is an old Windows (2005) game, run through Wine (11.0-amd64-wow64 version) + DXVK-Sarek (1.14.1 version). The amd64 Wine runs through Box64 arm64 version (v0.4.4 version with dynarec) in order for everything to work. When using WineD3D (OpenGL) by removing the DXVK (Vulkan) acceleration/translation layer from the chain everything works as expected (albeit slowly).

Steps to reproduce the behaviour

  1. Make a working directory, and download the relevant Wine and DXVK builds in the builds subdirectory
  2. Add a d3d9 game to the games subdirectory alongside the builds subdirectory
  3. Add the game-run script from bellow alongside the builds and games directory
  4. Launch game-run script

Builds used:
wine-11.0-amd64-wow64
dxvk-sarek-1.14.1
batocera-bcm2711-44-20261116

game-run script
# cat game-run
#!/bin/bash

export WORKDIR="$(realpath $(dirname $0))"

export WINE_BUILD="$WORKDIR/builds/wine-11.0-amd64-wow64"
export DXVK_BUILD="$WORKDIR/builds/dxvk-sarek-1.14.1/build"
export GAME_BUILD="$WORKDIR/games/sample-game"
export GAME_EXECUTABLE="game.exe"

echo "using wine: $WINE_BUILD"
echo "using dxvk: $DXVK_BUILD"
echo "using game: $GAME_BUILD"

export PATH="$PATH:$WINE_BUILD/bin"
export WINEPREFIX="$WORKDIR/prefixes/.wine"
export WINEDLLOVERRIDES="mscoree,mshtml="
[ ! -e "$WINEPREFIX" ] && wineboot --init

cp $DXVK_BUILD/x64/*.dll "$WINEPREFIX/drive_c/windows/system32"
cp $DXVK_BUILD/x32/*.dll "$WINEPREFIX/drive_c/windows/syswow64"
export WINEDLLOVERRIDES="$WINEDLLOVERRIDES;d3d8,d3d9,d3d10core,d3d11,dxgi=n,b"
export DXVK_HUD=1
export DISPLAY=

export LOG_PATH="$WORKDIR/logs"
rm -rf "$LOG_PATH"
mkdir -p "$LOG_PATH"

export MESA_VK_ABORT_ON_DEVICE_LOSS=1
export WINEDEBUG=+vulkan,+timestamp
export DXVK_LOG_LEVEL=debug
export DXVK_LOG_PATH="$LOG_PATH"

dmesg -C

export WINEDLLOVERRIDES="$WINEDLLOVERRIDES;dinput8=n,b"
cd "$GAME_BUILD"
wine "$GAME_EXECUTABLE" 2>&1 | tee "$LOG_PATH/wine.log"

dmesg > "$LOG_PATH/dmesg.log"

Device (s)

Raspberry Pi 4 Mod. B

System

System info:

Model: Raspberry_Pi_4_Model_B_Rev_1_2
System: Linux 6.18.54-v8
Architecture: aarch64
Board: bcm2711
CPU Cores: 4
CPU Max Frequency: 1500 MHz
CPU Features: asimd
Available Memory: 3190/3723 MB
Display Server: wayland
Display Compositor: labwc
Display Output: HDMI-A-1
Display Resolution: 1920x1080
Display Refresh Rate: 60.000Hz
OS version: 44Ou1 2026/11/16 01:23

Specific versions:

# uname -a
Linux batocera 6.18.54-v8 #1 SMP PREEMPT Mon Nov 16 01:34:28 CET 2026 aarch64 GNU/Linux

# box64 --version
Box64 arm64 v0.4.4 nogit with Dynarec built on Nov 16 2026 01:19:56

# wine --version
wine-11.0

Logs

dmesg logs:

# cat logs/dmesg.log
[ 1067.326137] v3d fec00000.v3d: [drm:v3d_reset [v3d]] *ERROR* Resetting GPU for hang.
[ 1067.326254] v3d fec00000.v3d: [drm:v3d_reset [v3d]] *ERROR* V3D_ERR_STAT: 0x00001000
[ 1068.350122] v3d fec00000.v3d: [drm:v3d_reset [v3d]] *ERROR* Resetting GPU for hang.
[ 1068.350205] v3d fec00000.v3d: [drm:v3d_reset [v3d]] *ERROR* V3D_ERR_STAT: 0x00001000
[ 1069.406127] v3d fec00000.v3d: [drm:v3d_reset [v3d]] *ERROR* Resetting GPU for hang.
[ 1069.406196] v3d fec00000.v3d: [drm:v3d_reset [v3d]] *ERROR* V3D_ERR_STAT: 0x00001000
[ 1070.430122] v3d fec00000.v3d: [drm:v3d_reset [v3d]] *ERROR* Resetting GPU for hang.
[ 1070.430178] v3d fec00000.v3d: [drm:v3d_reset [v3d]] *ERROR* V3D_ERR_STAT: 0x00001000

(nothing relevant is written before or after these)

Additional context

No response

Log files

dmesg.log
game_d3d9.log
wine.log

Activity

  1. mairacanal commented on Nov 23, 2026

    @mairacanal
    Contributor

    @popcornmix I'm taking a look at this issue and I'll get back with a diagnostic soon.

  2. popcornmix commented on Nov 23, 2026

    @popcornmix
    Collaborator

    Thanks - was just about to ping you. I can reproduce and confirm issue occurs on pi5 too.

  3. agorgl commented on Nov 23, 2026

    @agorgl
    Author

    Is there a simpler way to reproduce this than my setup? I'm wondering what steps did you take to find the root of this problem (as I was trying to do this myself too)

  4. popcornmix commented on Nov 23, 2026

    @popcornmix
    Collaborator

    Is there a simpler way to reproduce this than my setup? I'm wondering what steps did you take to find the root of this problem (as I was trying to do this myself too)

    I followed your instructions. I used a free 2005-era 32-bit D3D9 demo (Irrlicht 1.8.5, the Quake3Map example).

  5. mairacanal commented on Nov 23, 2026

    @mairacanal
    Contributor

    I believe this is a Box64 bug, not a kernel or Mesa bug. I reproduced the issue with Box64 v0.4.4, but when I tested Box64 main branch (commit ptitSeb/box64@5e5eb2a), I wasn't able to reproduce the issue.

    Notice that due to a Box64 v0.4.4 bug, we are unable to run Box64 with 16K pages. This issue is also addressed in the main branch.

    Therefore, I'd recommend you to update your Box64 version.

  6. agorgl commented on Nov 23, 2026

    @agorgl
    Author

    Are you sure this is a Box64 bug? Because with Box64 -> wine -> wined3d -> game it works, but with Box64 -> wine -> dxvk -> game it hangs the GPU, and from the wine / dxvk logs it seems like that some vulkan submission causes the v3d/v3dv driver to crash.

    Also, if you are talking about virtual memory page size, in my system is:

    # getconf PAGESIZE
    4096
    

    so I suppose the 16K pages bug is irrelevant?

  7. popcornmix commented on Nov 23, 2026

    @popcornmix
    Collaborator

    so I suppose the 16K pages bug is irrelevant?

    Pi 4 doesn't do 16k pagesize, so that's not your problem.

    I've tried building latest box64 and it fixed it for me too.

  8. mairacanal commented on Nov 23, 2026

    @mairacanal
    Contributor

    I understand your point, but I wasn't able to reproduce your issue on the main branch, even though I reproduced it on v0.4.4. This is what made me conclude that it's a Box64 issue.

    I used the same compilation configuration on both branches, with the same kernel and Mesa version, the same Wine and DXVK, and the same game. Therefore, the only thing that changed was Box64.

    Could you please test it on your end and confirm if it fixes the issue? If you still can reproduce the issue with ptitSeb/box64@5e5eb2a, please share the name of the game you are playing, so that I can test the exact same game.

    The 16K pages bug is just a "fun fact", as it's something that caught my attention when running Box64 on RPi 5.

  9. agorgl commented on Nov 23, 2026

    @agorgl
    Author

    I'm cross compiling box64 for arm64 right now from master, give me some time and I'll report my results back

  10. agorgl commented on Nov 23, 2026

    @agorgl
    Author

    Well, I can still reproduce the issue with box64 master

    # ./box64 --version
    Box64 arm64 v0.4.5 5e5eb2adb with Dynarec built on Nov 23 2026 19:19:12
    

    Cross compiled using:

    $ podman run --name debian --rm -it debian:stable
    mkdir workdir; cd workdir/
    apt update
    apt upgrade
    apt install python3 git gcc-aarch64-linux-gnu make cmake
    export OPTIONS="-DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DCMAKE_BUILD_TYPE=Release -DARM_DYNAREC=ON -DSAVE_MEM=ON -DBOX32=ON -DBOX32_BINFMT=ON -DRPI4ARM64=1"
    git clone https://github.com/ptitSeb/box64
    cd box64
    mkdir build; cd build; cmake .. ${OPTIONS}
    make -j4
    

    The game is Need for Speed Most Wanted (2005) (speed.exe) with ThirteenAG's Widescreen Fix applied.

  11. popcornmix commented on Nov 23, 2026

    @popcornmix
    Collaborator

    Can you confirm if you see the issue with Irrlicht 1.8.5? I had issue with v0.4.4 but not with v0.4.5.

  12. agorgl commented on Nov 24, 2026

    @agorgl
    Author

    I can confirm that for games/irrlicht-1.8.5/bin/Win32-VisualStudio/02.Quake3Map.exe with the (b) Direct3D 9.0c renderer on both Box64 arm64 v0.4.4 and Box64 arm64 v0.4.5 5e5eb2adb I get the exact same gpu hang/reset.

  13. popcornmix commented on Nov 24, 2026

    @popcornmix
    Collaborator

    Not what I get. Are you 100% sure you are running the box you've built (including any dependent libraries)?

    Going further I can identify the exact Box commit that causes the failure.

    Bisecting Box64 between v0.4.4 (hangs) and 5e5eb2a (no hang) on a Pi 5 (4K page kernel, Mesa 26.2.2, Wine 11.0 + DXVK-Sarek 1.14.1, Irrlicht Quake3Map D3D9 demo, 90s per run) gives:

    ptitSeb/box64@f9d5835
    [CUSTOMMEM] Fixed race between concurrent mmaps silently overwriting guest mappings (#4394)

    Every build before it gave V3D_ERR_STAT: 0x00001000 GPU resets; every build from it onwards ran without any.

  14. agorgl commented on Nov 24, 2026

    @agorgl
    Author

    Yes, I performed the test several times for each box64 version, each one from a clean boot with all its accompanying libraries. I followed very cautious steps and carefully checked the logs at the start of every wine process that showed the box64 version. My tests are on a pi4b 4gb so it might have to do a bit with the gpu too?

  15. mairacanal commented on Nov 24, 2026

    @mairacanal
    Contributor

    @agorgl, I reproduced your issue with Need for Speed Most Wanted and after investigation, I concluded that it's not a v3dv issue, it's a DXVK-Sarek violation of the Vulkan spec.

    Using the Vulkan Validation Layers, I got the following error:

    Validation Error: [ VUID-VkSubpassDescription-colorAttachmentCount-00845 ]
    vkCreateRenderPass(): pCreateInfo->pSubpasses[0] cannot be used to create a render pass. maxColorAttachments is 4.
    

    Taking a look at DXVK-Sarek, I noticed that they always creates its Vulkan render passes with 8 color attachment slots, even when the game only draws to one of them. The unused slots are marked "unused", but the count is still 8. This is problematic, because the RPi 4 GPU (V3D 4.2) only supports at most 4 color attachments, and v3dv tells applications so (maxColorAttachments = 4). Asking for 8 is invalid Vulkan usage.

    I tested a hack in the v3dv driver to ignore color attachments bigger than 4 and it fixed the issue. This was only a hack for local testing, the bugfix must happen in DXVK-Sarek.

    This issue doesn't happen in RPi 5 because, for V3D 7.1, maxColorAttachments = 8.

    I suggest you try other DXVK flavour or open an issue on DXVK-Sarek.

  16. agorgl commented on Nov 24, 2026

    @agorgl
    Author

    This is fantastic news, thanks for the explanation! I will open an issue to DXVK-Sarek for this, you may close this one.
    As a final note, its kinda weird that this violation triggers a GPU hang/reset, I would expect some kind of userland error instead.

    Thanks again for taking a look into this!

  17. mairacanal commented on Nov 24, 2026

    @mairacanal
    Contributor

    As a final note, its kinda weird that this violation triggers a GPU hang/reset, I would expect some kind of userland error instead.

    I'm working at the moment to add some assertion or something in v3dv. Thank you for your report!

  18. agorgl commented on Nov 24, 2026

    @agorgl
    Author

    For future readers:

    Changing this limit from 8 to 4 in DXVK-Sarek and using the latest box64 version (commit 5e5eb2adb at the time) makes both of the above games playable!

  19. mairacanal commented on Nov 27, 2026

    @mairacanal
    Contributor

    Based on this bug report, I opened a Mesa MR [1] with an optimization to stop counting trailing unused attachments as render targets. I also added an assert to make sure that the number of color attachments equal or smaller than 4.

    As DXVK-Sarek only uses one attachment and the rest of the attachments are unused, this MR will discard the unused attachments and it will allow running D3D9 games on RPi 4.

    Thank you again for the detailed report!

    [1] https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/46857

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions