#1103352 dxvk: FTBFS on armhf and other non-x86 non-aarch64 architectures: #error "Unknown CPU Architecture"

Package:
src:dxvk
Source:
src:dxvk
Submitter:
Simon McVittie
Date:
2025-08-13 14:29:01 UTC
Severity:
normal
Tags:
#1103352#5
Date:
2025-04-16 16:45:32 UTC
From:
To:
dxvk 2.6.1 with DXVK Native enabled doesn't build successfully on armhf:
— https://buildd.debian.org/status/fetch.php?pkg=dxvk&arch=armhf&ver=2.6.1-1&stamp=1744304328&raw=0

A crude way to mitigate this issue would be to limit compilation of
DXVK Native to amd64, i386 and arm64 only, after which this bug could
be downgraded to wishlist until a porter steps in to help; please let me
know if you would like a MR for this. But of course ideally DXVK Native
would be portable (I don't think there's any fundamental reason why it
can't be compilable on every architecture).

There seem to be two places in the dxvk codebase that #error out if the
CPU architecture is not recognised.

1. src/util/util_bit.h

There is some conditional-compilation of this form (pseudocode):

#if (architecture is x86_64 or i386)
    #define DXVK_ARCH_X86
    #if (architecture is x86_64)
        #define DXVK_ARCH_X86_64
    #endif
#elif (architecture is aarch64)
    #define DXVK_ARCH_ARM64
#else
    #error
#endif

But all the conditional compilation further down the file seems to have a
portable "#else" fallback available, so probably it would be OK to replace
the "#error" with just not defining any of the helper macros on unrecognised
architectures?

2. src/util/sync/sync_spinlock.h

The implementation of dxvk::sync::spin calls _mm_pause() on x86, uses inline
assembly to call "yield" on aarch64, and emits a #error "Pause/Yield not
implemented for this architecture." otherwise. For this to be portable, it
would need a fallback for other architectures.

Looking at https://codesearch.debian.net/search?q=_mm_pause&literal=1
it seems that a reasonable implementation for other architectures would
be to do nothing at all (and porters can contribute an implementation
for their architecture if they want to).

    smcv

#1103352#10
Date:
2025-04-16 18:50:46 UTC
From:
To:
Control: forwarded -1 https://github.com/doitsujin/dxvk/pull/4853

https://github.com/doitsujin/dxvk/pull/4853 is an untested implementation
of the "generic CPU" code path that I suggested in the bug report.

After DXVK compiles successfully, it would also become useful to apply
https://salsa.debian.org/aviau/dxvk/-/merge_requests/11, but there's little
point in applying that MR until the build would be expected to succeed.

    smcv

#1103352#19
Date:
2025-05-12 11:44:54 UTC
From:
To:
Control: tags -1 + pending

This was applied in the packaging git repo as part of an updated
https://salsa.debian.org/aviau/dxvk/-/merge_requests/11.

     smcv

#1103352#26
Date:
2025-08-13 14:19:29 UTC
From:
To:
Version: 2.6.2-1

Fixed in experimental.

2.6.2 still FTFBS on armel for unrelated reasons, but the release team have
announced that forky is not going to be available on armel[1] so it is probably
not worth putting any effort into addressing that.

Thanks,
    smcv

[1] https://www.debian.org/releases/trixie/release-notes/issues.en.html#armel-last-release