macOS: "Could not find suitable device" on Apple Silicon — bundled MoltenVK never exposes minLod, shaderBufferInt64Atomics, shaderCullDistance #1068

Open
opened 2026-11-26 09:41:57 +00:00 by github-bot · 3 comments
Owner

@⁠Djoko-cli on GitHub · 2026-10-05 11:48 UTC · original

Summary

The official macOS release cannot start any game on Apple Silicon. Device selection rejects the only GPU because three features are required unconditionally on macOS, but stock MoltenVK (the v1.4.2 bundled by the release workflow) never reports them as supported, on any Apple GPU.

The emulator exits with code 65 before the game is loaded, so this is not game-specific.

Environment

  • KytyPS5: official build KytyPS5-2026-10-05-72e4989 (macOS x86_64 zip, run under Rosetta 2)
  • Also reproduced with KytyPS5-2026-09-02-16ea36e (fails on shaderCullDistance only)
  • Mac: Apple M2 Max (GPU Family Apple 8 / Mac 2 / Metal 4), macOS 27.0 (26A428)
  • MoltenVK: v1.4.2, as bundled in the release

Log

Vulkan device: Apple M2 Max
	queue family: { Graphics | Compute | Transfer } [count = 1], [present = true]
	selected universal queue family 0
colorWriteEnable is not supported
image view minLod is not supported
depthClipEnable is not supported
shaderBufferInt64Atomics is not supported
shaderCullDistance is not supported
depthBounds is not supported
--- Build ---
Official build KytyPS5-2026-10-05-72e4989
--- Error ---
Could not find suitable device:
  Apple M2 Max: image view minLod is not supported; shaderBufferInt64Atomics is not supported; shaderCullDistance is not supported in .../src/graphics/presentation/window/vulkanWindow.cpp:966

Full log attached.

Cause

In VulkanFindPhysicalDevice (src/graphics/presentation/window/vulkanWindow.cpp), colorWriteEnable, depthClipEnable and depthBounds are already downgraded to log messages under #if defined(__APPLE__), but these three are still hard requirements on every platform:

  • check_feature(image_view_min_lod.minLod, ...), required since the "Honor PS5 texture minimum LOD" change (f38d738)
  • check_feature(features12.shaderBufferInt64Atomics, ...), required via RequiredVulkan12Features() since c78a5a9
  • check_feature(device_features2.features.shaderCullDistance, ...)

MoltenVK hardcodes all three to unsupported. In MoltenVK/GPUObjects/MVKDevice.mm, shaderBufferInt64Atomics = false is set in the Vulkan 1.2 features, maxCullDistances = 0 with a "// unsupported" comment, and the minLod feature is never enabled. So this affects every Mac, not only the M2. The macOS support PR (#394) verified that the GUI launches, but a game boot does not seem to have been tested with the bundled MoltenVK.

Suggested fix

On __APPLE__, treat these three like depthClipEnable/colorWriteEnable. Log them in device selection, and at device creation only request what the device reports:

  • move VK_EXT_IMAGE_VIEW_MIN_LOD_EXTENSION_NAME out of the common required extensions (MoltenVK does not expose the extension at all), drop VkPhysicalDeviceImageViewMinLodFeaturesEXT from the device-creation chain, and skip chaining VkImageViewMinLodCreateInfoEXT in imageView.cpp
  • features12.shaderBufferInt64Atomics = supported_features12.shaderBufferInt64Atomics
  • device_features.shaderCullDistance = supported_features2.features.shaderCullDistance

Shaders that emit CullDistance / Int64Atomics capabilities would then also need a fallback on macOS (drop cull distance outputs, emulate 64-bit buffer atomics).

Result with that patch, and next blocker

I built kyty_emulator from 72e4989 with the changes above (patch attached). Device selection and creation now succeed on the M2 Max. The game then boots: modules load, the Unity runtime starts, and shaders are recompiled. The first vertex pipeline then fails in MoltenVK's SPIR-V → MSL conversion:

Vulkan subgroup: default=32 min=4 max=32 stages=0x00000000 size_control=false wave64=false
...
[mvk-error] SPIR-V to MSL conversion error: Subgroup builtins are not available in this type of function.
[mvk-error] VK_ERROR_INITIALIZATION_FAILED: Vertex shader function could not be compiled into pipeline. See previous logged error.
--- Fatal Error ---
Not implemented (result != vk::Result::eSuccess) in src/graphics/host_gpu/renderer/pipeline/shaders.cpp:553

MoltenVK reports VkPhysicalDeviceSubgroupProperties::supportedStages = 0, but the SPIR-V backend emits GroupNonUniform* / subgroup builtins in vertex shaders unconditionally. supportedStages is never consulted. A macOS path would need a fallback for wave operations in the vertex/geometry stages.

**@⁠Djoko-cli** on GitHub · 2026-10-05 11:48 UTC · [original](https://github.com/KytyPS5/KytyPS5/issues/1068) ## Summary The official macOS release cannot start any game on Apple Silicon. Device selection rejects the only GPU because three features are required unconditionally on macOS, but stock MoltenVK (the v1.4.2 bundled by the release workflow) never reports them as supported, on any Apple GPU. The emulator exits with code 65 before the game is loaded, so this is not game-specific. ## Environment - KytyPS5: official build `KytyPS5-2026-10-05-72e4989` (macOS x86_64 zip, run under Rosetta 2) - Also reproduced with `KytyPS5-2026-09-02-16ea36e` (fails on `shaderCullDistance` only) - Mac: Apple M2 Max (GPU Family Apple 8 / Mac 2 / Metal 4), macOS 27.0 (26A428) - MoltenVK: v1.4.2, as bundled in the release ## Log ``` Vulkan device: Apple M2 Max queue family: { Graphics | Compute | Transfer } [count = 1], [present = true] selected universal queue family 0 colorWriteEnable is not supported image view minLod is not supported depthClipEnable is not supported shaderBufferInt64Atomics is not supported shaderCullDistance is not supported depthBounds is not supported --- Build --- Official build KytyPS5-2026-10-05-72e4989 --- Error --- Could not find suitable device: Apple M2 Max: image view minLod is not supported; shaderBufferInt64Atomics is not supported; shaderCullDistance is not supported in .../src/graphics/presentation/window/vulkanWindow.cpp:966 ``` Full log attached. ## Cause In `VulkanFindPhysicalDevice` (`src/graphics/presentation/window/vulkanWindow.cpp`), `colorWriteEnable`, `depthClipEnable` and `depthBounds` are already downgraded to log messages under `#if defined(__APPLE__)`, but these three are still hard requirements on every platform: - `check_feature(image_view_min_lod.minLod, ...)`, required since the "Honor PS5 texture minimum LOD" change (f38d738) - `check_feature(features12.shaderBufferInt64Atomics, ...)`, required via `RequiredVulkan12Features()` since c78a5a9 - `check_feature(device_features2.features.shaderCullDistance, ...)` MoltenVK hardcodes all three to unsupported. In `MoltenVK/GPUObjects/MVKDevice.mm`, `shaderBufferInt64Atomics = false` is set in the Vulkan 1.2 features, `maxCullDistances = 0` with a "// unsupported" comment, and the `minLod` feature is never enabled. So this affects every Mac, not only the M2. The macOS support PR (#394) verified that the GUI launches, but a game boot does not seem to have been tested with the bundled MoltenVK. ## Suggested fix On `__APPLE__`, treat these three like `depthClipEnable`/`colorWriteEnable`. Log them in device selection, and at device creation only request what the device reports: - move `VK_EXT_IMAGE_VIEW_MIN_LOD_EXTENSION_NAME` out of the common required extensions (MoltenVK does not expose the extension at all), drop `VkPhysicalDeviceImageViewMinLodFeaturesEXT` from the device-creation chain, and skip chaining `VkImageViewMinLodCreateInfoEXT` in `imageView.cpp` - `features12.shaderBufferInt64Atomics = supported_features12.shaderBufferInt64Atomics` - `device_features.shaderCullDistance = supported_features2.features.shaderCullDistance` Shaders that emit `CullDistance` / `Int64Atomics` capabilities would then also need a fallback on macOS (drop cull distance outputs, emulate 64-bit buffer atomics). ## Result with that patch, and next blocker I built `kyty_emulator` from 72e4989 with the changes above (patch attached). Device selection and creation now succeed on the M2 Max. The game then boots: modules load, the Unity runtime starts, and shaders are recompiled. The first vertex pipeline then fails in MoltenVK's SPIR-V → MSL conversion: ``` Vulkan subgroup: default=32 min=4 max=32 stages=0x00000000 size_control=false wave64=false ... [mvk-error] SPIR-V to MSL conversion error: Subgroup builtins are not available in this type of function. [mvk-error] VK_ERROR_INITIALIZATION_FAILED: Vertex shader function could not be compiled into pipeline. See previous logged error. --- Fatal Error --- Not implemented (result != vk::Result::eSuccess) in src/graphics/host_gpu/renderer/pipeline/shaders.cpp:553 ``` MoltenVK reports `VkPhysicalDeviceSubgroupProperties::supportedStages = 0`, but the SPIR-V backend emits `GroupNonUniform*` / subgroup builtins in vertex shaders unconditionally. `supportedStages` is never consulted. A macOS path would need a fallback for wave operations in the vertex/geometry stages. <!-- Uploading "gris-2026-10-05-72e4989.log"... -→ [gris-patched.log](https://github.com/user-attachments/files/33056606/gris-patched.log) [macos-relax-feature-checks.patch](https://github.com/user-attachments/files/33056647/macos-relax-feature-checks.patch)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:41:57 +00:00
Author
Owner

@⁠maxawad on GitHub · 2026-10-08 14:11 UTC · original

The cull distance part isn't a dead end.

I swapped the bundled MoltenVK for KosmicKrisp (the Mesa Vulkan-on-Metal driver that ships with shadPS4 0.19.0, Mesa 26.3.0-devel) and shaderCullDistance comes back supported. No rebuild needed: Kyty loads the driver by name, so it's just dropping the Vulkan loader in place of libMoltenVK.dylib and pointing VK_ICD_FILENAMES at the KosmicKrisp ICD.

M1 Pro, official build KytyPS5-2026-10-08-5a88080.

Before, on MoltenVK 1.4.2:

image view minLod is not supported; shaderBufferInt64Atomics is not supported; shaderCullDistance is not supported

After, on KosmicKrisp:

image view minLod is not supported; shaderBufferInt64Atomics is not supported; fillModeNonSolid is not supported

Still three, and fillModeNonSolid is a new gap on their side, so this doesn't get a game booting on its own. But it does mean cull distance is a MoltenVK limitation rather than a Metal one, which might be worth knowing for the macOS path.

**@⁠maxawad** on GitHub · 2026-10-08 14:11 UTC · [original](https://github.com/KytyPS5/KytyPS5/issues/1068#issuecomment-6061751810) The cull distance part isn't a dead end. I swapped the bundled MoltenVK for KosmicKrisp (the Mesa Vulkan-on-Metal driver that ships with shadPS4 0.19.0, Mesa 26.3.0-devel) and `shaderCullDistance` comes back supported. No rebuild needed: Kyty loads the driver by name, so it's just dropping the Vulkan loader in place of `libMoltenVK.dylib` and pointing `VK_ICD_FILENAMES` at the KosmicKrisp ICD. M1 Pro, official build `KytyPS5-2026-10-08-5a88080`. Before, on MoltenVK 1.4.2: ``` image view minLod is not supported; shaderBufferInt64Atomics is not supported; shaderCullDistance is not supported ``` After, on KosmicKrisp: ``` image view minLod is not supported; shaderBufferInt64Atomics is not supported; fillModeNonSolid is not supported ``` Still three, and `fillModeNonSolid` is a new gap on their side, so this doesn't get a game booting on its own. But it does mean cull distance is a MoltenVK limitation rather than a Metal one, which might be worth knowing for the macOS path.
Author
Owner

@⁠ThisisYoYoDev on GitHub · 2026-10-14 11:37 UTC · original

Follow-up from testing #1083 on top of the current release. #1083 gets device selection working, but then I ran into two macOS address-space issues. The second one looks like a hard platform limit.

Environment

  • Apple M5 Pro, 48 GB, macOS 26.7 (25G229)
  • MoltenVK 1.4.2 (the one bundled with the release)
  • Source build: release commit df5b9b9, plus the two commits from #1083 cherry-picked (no conflicts), x86_64, -DKYTY_BUILD_LAUNCHER=OFF
  • Game: GTA V, PPSA04264 v01.011.001

1. Gen5Driver::Initialize aborts on macOS (affects every game once #1083 is applied on top of main)

Since 165cd884 (agc: initialize function table in tracked driver memory), the driver block is mapped at a fixed DriverDmemBase = 0x0fe0000000. On macOS x86_64 the guest system-reserved range ends at HOST_SYSTEM_RESERVED_MAX = 0x0fbfffffff (memoryAddressSpace.inc), so the mapping lands somewhere else and this check fires:

--- Fatal Error ---
Error: condition (reinterpret_cast<uint64_t>(address) != DriverDmemBase) is true in src/libs/agc.cpp:4176

Keeping the 2 MiB block at the top of the macOS reserved range fixes it locally. The game then gets past graphics init:

+#if defined(__APPLE__) && (defined(__x86_64__) || defined(_M_X64))
+// The macOS guest system-reserved range ends at 0x0fbfffffff; keep the driver block inside it.
+static constexpr uint64_t DriverDmemBase = 0x0fbfe00000ull;
+#else
 static constexpr uint64_t DriverDmemBase = 0x0fe0000000ull;
+#endif

Nothing else references the address, since base/function_table/code_address are all derived from it. #1083 never hit this because its base predates 165cd884.

2. Games with fixed user mappings below 0x7000000000 cannot work on Apple Silicon

With the fix above, GTA V loads sce_module/libc.prx, prints Title ID: PPSA04264 and starts [RAGE] Main Thread. It then issues a batch map with MAP_FIXED into the PS5 user range:

 entries         = 0x903f74ea0
 num_entries     = 1
 flags           = 0x00000010
 [0] start = 0x15b1400000, offset = 0x0000000102200000, length = 0x0000000000010000, prot = 0xf3, type = 0x00, op = 0
--- Guest fault context ---
thread: [RAGE] Main Thread
rax=000000008002000c ... r12=00000015b1400000
--- Error ---
Unhandled host exception: type=1 code=1 pc=0x0000000902bd1ef7 access=2 address=0x0000000000000000

0x8002000c is ENOMEM. The game then writes through a null pointer. No earlier reserve call mentions that address, so the game picks it itself, assuming the PS5 user range starts at 0x1000000000. On macOS the guest USER_AREA starts at 0x7000000000.

I checked whether the macOS layout could simply move down to the PS5 one, and it can't:

  • mmap(MAP_FIXED) at 0x15b1400000 fails in a plain test program, both as native arm64 and as x86_64 under Rosetta. The non-fixed hint lands at 0x7000000000 in both cases. So this comes from the macOS VM on Apple Silicon, not from Rosetta.
  • Zerofill segment probes, using the same linker flags as kyty_emulator (-no_pie -pagezero_size 0x40000 -segaddr ... -image_base 0x700000000000):
    • The current layout (SYSTEM_RESERVED up to 0xFC0000000, USER_AREA at 0x7000000000) starts fine.
    • Extending SYSTEM_RESERVED to 0x1000000000 gets SIGKILL at exec.
    • Any 4 GiB segment at 0x0f00000000, 0x0fc0000000, 0x1000000000, 0x1800000000, 0x2000000000 … 0x6f00000000 gets SIGKILL at exec.
    • A 4 GiB segment at 0x0c00000000 starts fine.

So [0xFC0000000, 0x7000000000) is off-limits to user processes on Apple Silicon. That matches the current HOST_SYSTEM_RESERVED_MAX/HOST_USER_MIN choice. KytyPS5 runs guest code natively with identity-mapped guest addresses, so any title that maps MAP_FIXED between 0x1000000000 and 0x7000000000 (GTA V does at boot) can't run on macOS without guest address translation.

It would probably help to fail with an explicit message in BatchMap/MapDirectMemory when a fixed request falls in that hole on macOS, instead of returning ENOMEM, and to mention the limitation in the README's macOS section.

Investigated with the help of Claude Code.

**@⁠ThisisYoYoDev** on GitHub · 2026-10-14 11:37 UTC · [original](https://github.com/KytyPS5/KytyPS5/issues/1068#issuecomment-6167442258) Follow-up from testing #1083 on top of the current release. #1083 gets device selection working, but then I ran into two macOS address-space issues. The second one looks like a hard platform limit. ## Environment - Apple M5 Pro, 48 GB, macOS 26.7 (25G229) - MoltenVK 1.4.2 (the one bundled with the release) - Source build: release commit `df5b9b9`, plus the two commits from #1083 cherry-picked (no conflicts), x86_64, `-DKYTY_BUILD_LAUNCHER=OFF` - Game: GTA V, `PPSA04264` v01.011.001 ## 1. `Gen5Driver::Initialize` aborts on macOS (affects every game once #1083 is applied on top of `main`) Since 165cd884 (`agc: initialize function table in tracked driver memory`), the driver block is mapped at a fixed `DriverDmemBase = 0x0fe0000000`. On macOS x86_64 the guest system-reserved range ends at `HOST_SYSTEM_RESERVED_MAX = 0x0fbfffffff` (`memoryAddressSpace.inc`), so the mapping lands somewhere else and this check fires: ``` --- Fatal Error --- Error: condition (reinterpret_cast<uint64_t>(address) != DriverDmemBase) is true in src/libs/agc.cpp:4176 ``` Keeping the 2 MiB block at the top of the macOS reserved range fixes it locally. The game then gets past graphics init: ```diff +#if defined(__APPLE__) && (defined(__x86_64__) || defined(_M_X64)) +// The macOS guest system-reserved range ends at 0x0fbfffffff; keep the driver block inside it. +static constexpr uint64_t DriverDmemBase = 0x0fbfe00000ull; +#else static constexpr uint64_t DriverDmemBase = 0x0fe0000000ull; +#endif ``` Nothing else references the address, since `base`/`function_table`/`code_address` are all derived from it. #1083 never hit this because its base predates 165cd884. ## 2. Games with fixed user mappings below `0x7000000000` cannot work on Apple Silicon With the fix above, GTA V loads `sce_module/libc.prx`, prints `Title ID: PPSA04264` and starts `[RAGE] Main Thread`. It then issues a batch map with `MAP_FIXED` into the PS5 user range: ``` entries = 0x903f74ea0 num_entries = 1 flags = 0x00000010 [0] start = 0x15b1400000, offset = 0x0000000102200000, length = 0x0000000000010000, prot = 0xf3, type = 0x00, op = 0 --- Guest fault context --- thread: [RAGE] Main Thread rax=000000008002000c ... r12=00000015b1400000 --- Error --- Unhandled host exception: type=1 code=1 pc=0x0000000902bd1ef7 access=2 address=0x0000000000000000 ``` `0x8002000c` is ENOMEM. The game then writes through a null pointer. No earlier reserve call mentions that address, so the game picks it itself, assuming the PS5 user range starts at `0x1000000000`. On macOS the guest `USER_AREA` starts at `0x7000000000`. I checked whether the macOS layout could simply move down to the PS5 one, and it can't: - **`mmap(MAP_FIXED)` at `0x15b1400000` fails in a plain test program**, both as native arm64 and as x86_64 under Rosetta. The non-fixed hint lands at `0x7000000000` in both cases. So this comes from the macOS VM on Apple Silicon, not from Rosetta. - **Zerofill segment probes**, using the same linker flags as `kyty_emulator` (`-no_pie -pagezero_size 0x40000 -segaddr ... -image_base 0x700000000000`): - The current layout (`SYSTEM_RESERVED` up to `0xFC0000000`, `USER_AREA` at `0x7000000000`) starts fine. - Extending `SYSTEM_RESERVED` to `0x1000000000` gets SIGKILL at exec. - Any 4 GiB segment at `0x0f00000000`, `0x0fc0000000`, `0x1000000000`, `0x1800000000`, `0x2000000000` … `0x6f00000000` gets SIGKILL at exec. - A 4 GiB segment at `0x0c00000000` starts fine. So `[0xFC0000000, 0x7000000000)` is off-limits to user processes on Apple Silicon. That matches the current `HOST_SYSTEM_RESERVED_MAX`/`HOST_USER_MIN` choice. KytyPS5 runs guest code natively with identity-mapped guest addresses, so any title that maps `MAP_FIXED` between `0x1000000000` and `0x7000000000` (GTA V does at boot) can't run on macOS without guest address translation. It would probably help to fail with an explicit message in `BatchMap`/`MapDirectMemory` when a fixed request falls in that hole on macOS, instead of returning ENOMEM, and to mention the limitation in the README's macOS section. _Investigated with the help of Claude Code._
Author
Owner

@⁠maxawad on GitHub · 2026-11-22 22:55 UTC · original

anyone working on this?
it's a blocker for the latest gta game.

**@⁠maxawad** on GitHub · 2026-11-22 22:55 UTC · [original](https://github.com/KytyPS5/KytyPS5/issues/1068#issuecomment-7087174424) anyone working on this? it's a blocker for the latest gta game.
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/KytyPS5--KytyPS5#1068
No description provided.