Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Add macOS build #274

Merged
merged 11 commits into from
Sep 23, 2022
Merged

CI: Add macOS build #274

merged 11 commits into from
Sep 23, 2022

Conversation

jcrm1
Copy link
Contributor

@jcrm1 jcrm1 commented Sep 19, 2022

Requested in #254
Based on build instructions found here
I assume this may need to wait to be merged until a few of the macOS fixes (#139?) are merged, but this might serve as a draft until then. In addition, since I haven't found a commit that completely compiles on macOS yet, I do not know what the macOS binary name is, so if it's different from that of Linux, this PR will require some changes.
Edit: macOS build now works and the artifacts from Actions run. Marking as ready for review.

@Tillsunset
Copy link
Contributor

yo just a heads up, I tried the artifact from the workflow and there's a small issue. It works fine except Cemu doesn't have executable permission. I had to manually add it with "chmod +x ./cemu", after that it worked as intended.

Update build.yml to set execute file permissions on build artifact
@jcrm1
Copy link
Contributor Author

jcrm1 commented Sep 23, 2022

yo just a heads up, I tried the artifact from the workflow and there's a small issue. It works fine except Cemu doesn't have executable permission. I had to manually add it with "chmod +x ./cemu", after that it worked as intended.

Thanks, fixed

@jcrm1 jcrm1 changed the title CI: Add macOS build (draft) CI: Add macOS build Sep 23, 2022
@jcrm1 jcrm1 marked this pull request as ready for review September 23, 2022 02:02
@Exzap Exzap linked an issue Sep 23, 2022 that may be closed by this pull request
@Exzap
Copy link
Member

Exzap commented Sep 23, 2022

What are the current issues with the MacOS build? Do any games run?

Depending on how far along it is, I think it would be better to only add it to the build check CI and leave it out of the experimental/stable releases for now.

@Tillsunset
Copy link
Contributor

Besides just needing molten-Vk to be installed, due to OpenGL being broken on macOS in general, and some color issues in menus with dark mode, it’s basically good to go. I’m currently doing a shovel knight play through, so I know it’ll run that. I don’t have many other games so I’m not sure on overall compatibility, but IMO there shouldn’t be a lot of new issues.

@Exzap
Copy link
Member

Exzap commented Sep 23, 2022

Alright, seems good enough for releases. I'll merge this as-is.

@Exzap Exzap merged commit b720d17 into cemu-project:main Sep 23, 2022
@UltraHDR
Copy link
Contributor

UltraHDR commented Sep 23, 2022

Thanks, this is awesome. It very briefly shows the Twilight Princess HD world before crashing. I'm using a M1 Pro

image

No bundle id found
[mvk-info] MoltenVK version 1.1.11, supporting Vulkan version 1.1.224.
	The following 81 Vulkan extensions are supported:
		VK_KHR_16bit_storage v1
		VK_KHR_8bit_storage v1
		VK_KHR_bind_memory2 v1
		VK_KHR_buffer_device_address v1
		VK_KHR_create_renderpass2 v1
		VK_KHR_dedicated_allocation v3
		VK_KHR_depth_stencil_resolve v1
		VK_KHR_descriptor_update_template v1
		VK_KHR_device_group v4
		VK_KHR_device_group_creation v1
		VK_KHR_driver_properties v1
		VK_KHR_dynamic_rendering v1
		VK_KHR_external_fence v1
		VK_KHR_external_fence_capabilities v1
		VK_KHR_external_memory v1
		VK_KHR_external_memory_capabilities v1
		VK_KHR_external_semaphore v1
		VK_KHR_external_semaphore_capabilities v1
		VK_KHR_fragment_shader_barycentric v1
		VK_KHR_get_memory_requirements2 v1
		VK_KHR_get_physical_device_properties2 v2
		VK_KHR_get_surface_capabilities2 v1
		VK_KHR_imageless_framebuffer v1
		VK_KHR_image_format_list v1
		VK_KHR_maintenance1 v2
		VK_KHR_maintenance2 v1
		VK_KHR_maintenance3 v1
		VK_KHR_multiview v1
		VK_KHR_portability_subset v1
		VK_KHR_push_descriptor v2
		VK_KHR_relaxed_block_layout v1
		VK_KHR_sampler_mirror_clamp_to_edge v3
		VK_KHR_sampler_ycbcr_conversion v14
		VK_KHR_separate_depth_stencil_layouts v1
		VK_KHR_shader_draw_parameters v1
		VK_KHR_shader_float16_int8 v1
		VK_KHR_shader_subgroup_extended_types v1
		VK_KHR_storage_buffer_storage_class v1
		VK_KHR_surface v25
		VK_KHR_swapchain v70
		VK_KHR_swapchain_mutable_format v1
		VK_KHR_timeline_semaphore v2
		VK_KHR_uniform_buffer_standard_layout v1
		VK_KHR_variable_pointers v1
		VK_EXT_buffer_device_address v2
		VK_EXT_debug_marker v4
		VK_EXT_debug_report v10
		VK_EXT_debug_utils v2
		VK_EXT_descriptor_indexing v2
		VK_EXT_fragment_shader_interlock v1
		VK_EXT_hdr_metadata v2
		VK_EXT_host_query_reset v1
		VK_EXT_image_robustness v1
		VK_EXT_inline_uniform_block v1
		VK_EXT_memory_budget v1
		VK_EXT_metal_objects v1
		VK_EXT_metal_surface v1
		VK_EXT_post_depth_coverage v1
		VK_EXT_private_data v1
		VK_EXT_robustness2 v1
		VK_EXT_sample_locations v1
		VK_EXT_scalar_block_layout v1
		VK_EXT_separate_stencil_usage v1
		VK_EXT_shader_stencil_export v1
		VK_EXT_shader_viewport_index_layer v1
		VK_EXT_subgroup_size_control v2
		VK_EXT_swapchain_colorspace v4
		VK_EXT_texel_buffer_alignment v1
		VK_EXT_texture_compression_astc_hdr v1
		VK_EXT_vertex_attribute_divisor v3
		VK_AMD_gpu_shader_half_float v2
		VK_AMD_negative_viewport_height v1
		VK_AMD_shader_image_load_store_lod v1
		VK_AMD_shader_trinary_minmax v1
		VK_IMG_format_pvrtc v1
		VK_INTEL_shader_integer_functions2 v1
		VK_GOOGLE_display_timing v1
		VK_MVK_macos_surface v3
		VK_MVK_moltenvk v35
		VK_NV_fragment_shader_barycentric v1
		VK_NV_glsl_shader v1
[mvk-info] GPU device:
		model: Apple M1 Pro
		type: Integrated
		vendorID: 0x106b
		deviceID: 0xc0603ef
		pipelineCacheUUID: DELETED_AS_IT_MIGHT_BE_UNIQUE
	supports the following Metal Versions, GPU's and Feature Sets:
		Metal Shading Language 2.4
		GPU Family Apple 7
		GPU Family Apple 6
		GPU Family Apple 5
		GPU Family Apple 4
		GPU Family Apple 3
		GPU Family Apple 2
		GPU Family Apple 1
		GPU Family Mac 2
		GPU Family Mac 1
		GPU Family Common 3
		GPU Family Common 2
		GPU Family Common 1
		macOS GPU Family 2 v1
		macOS GPU Family 1 v4
		macOS GPU Family 1 v3
		macOS GPU Family 1 v2
		macOS GPU Family 1 v1
[mvk-info] Created VkInstance for Vulkan version 1.1.224, as requested by app, with the following 3 Vulkan extensions enabled:
		VK_KHR_surface v25
		VK_EXT_debug_utils v2
		VK_EXT_metal_surface v1
[mvk-info] Using emulation for Vulkan semaphores.
[mvk-info] Created VkDevice to run on GPU Apple M1 Pro with the following 3 Vulkan extensions enabled:
		VK_KHR_driver_properties v1
		VK_KHR_sampler_mirror_clamp_to_edge v3
		VK_KHR_swapchain v70
[mvk-info] Created 3 swapchain images with initial size (1280, 720) and contents scale 1.0 for screen Built-in Retina Display.
[mvk-error] VK_ERROR_FORMAT_NOT_SUPPORTED: VkFormat VK_FORMAT_R4G4B4A4_UNORM_PACK16 is not supported on this device.
[mvk-error] VK_ERROR_FORMAT_NOT_SUPPORTED: VkFormat VK_FORMAT_R4G4B4A4_UNORM_PACK16 is not supported on this device.
[mvk-error] VK_ERROR_FORMAT_NOT_SUPPORTED: VkFormat VK_FORMAT_R4G4B4A4_UNORM_PACK16 is not supported on this device.
[mvk-error] VK_ERROR_FORMAT_NOT_SUPPORTED: VkFormat VK_FORMAT_R4G4B4A4_UNORM_PACK16 is not supported on this device.
[mvk-error] VK_ERROR_FORMAT_NOT_SUPPORTED: VkFormat VK_FORMAT_R4G4B4A4_UNORM_PACK16 is not supported on this device.
[mvk-error] VK_ERROR_FORMAT_NOT_SUPPORTED: VkFormat VK_FORMAT_R4G4B4A4_UNORM_PACK16 is not supported on this device.
[mvk-error] VK_ERROR_FORMAT_NOT_SUPPORTED: vkCmdCopyBufferToImage(): The image is using Metal format MTLPixelFormatInvalid as a substitute for Vulkan format VK_FORMAT_R4G4B4A4_UNORM_PACK16. Since the pixel size is different, content for the image cannot be copied to or from a buffer.
[mvk-error] VK_ERROR_FORMAT_NOT_SUPPORTED: VkFormat VK_FORMAT_R4G4B4A4_UNORM_PACK16 is not supported on this device.
libc++abi: terminating with uncaught exception of type std::runtime_error: failed to submit command buffer. Error -11

@bunrots
Copy link

bunrots commented Sep 23, 2022

Hi, how can I get it to use MoltenVK? Ive installed it with homebrew but I dont see the option in graphics settings

@Pedro-Beirao
Copy link

Games I tested:

  • Shovel Knight: Works great, but the game is running at 2x the normal speed (framerate is also locked on 120 fps, this might be the reason
  • Super Mario 3D World: Crash after loading screen image
  • Super Mario Bros U: Crash after Pressing play (the 4 player running screen shows fine)
  • Super Mario Maker: Crash after loading screen animation
  • Splatoon: Crash after loading screen image

@jcrm1
Copy link
Contributor Author

jcrm1 commented Sep 23, 2022

Hi, how can I get it to use MoltenVK? Ive installed it with homebrew but I dont see the option in graphics settings

If you're on M1, you need to get the x86_64 version. I did this by building MoltenVK from source and copying the dylib into /usr/local/lib.

@UltraHDR
Copy link
Contributor

On M1 Mac you can try

# run an x64 shell
arch -x86_64 zsh
# install x64 brew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# set x64 brew env
eval "$(/usr/local/Homebrew/bin/brew shellenv)"
# install dependencies
brew install molten-vk

@bunrots
Copy link

bunrots commented Sep 23, 2022

Thanks to both of you

@vesper8
Copy link

vesper8 commented Sep 24, 2022

I was able to install molten-vk like this:

# install x64 brew
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
# create an alias ibrew
alias ibrew='arch -x86_64 /usr/local/bin/brew'
# install x64 dependencies using your new x64 brew with the alias
ibrew install molten-vk

Then I was able to select Vulkan from the graphic settings, and was able to run Shovel Knight!

Promising stuff!

Since I have dark mode enabled, I couldn't see the values inside the text fields when setting up the input settings.

If anyone knows how to play Shovel Knight at normal speed please let us know : ) Audio is not affected and plays perfectly

@tmolter
Copy link

tmolter commented Sep 24, 2022

Wanted to give this a test drive, got Mario U running: https://youtu.be/C2shAnhM9n8

@Pedro-Beirao
Copy link

Wanted to give this a test drive, got Mario U running: youtu.be/C2shAnhM9n8

For me it crashes after the main menu. Did you change any settings?

@tmolter
Copy link

tmolter commented Sep 24, 2022

The menu crashes because of missing mii files. If you'd like a fix, go here: https://zenith.nsmbu.net/wiki/CEMU#Crash_Fixes

@zadowcloud
Copy link

BOTW always crashes for me with this error:

[mvk-info] MoltenVK version 1.1.11, supporting Vulkan version 1.1.224.
The following 79 Vulkan extensions are supported:
VK_KHR_16bit_storage v1
VK_KHR_8bit_storage v1
VK_KHR_bind_memory2 v1
VK_KHR_create_renderpass2 v1
VK_KHR_dedicated_allocation v3
VK_KHR_depth_stencil_resolve v1
VK_KHR_descriptor_update_template v1
VK_KHR_device_group v4
VK_KHR_device_group_creation v1
VK_KHR_driver_properties v1
VK_KHR_dynamic_rendering v1
VK_KHR_external_fence v1
VK_KHR_external_fence_capabilities v1
VK_KHR_external_memory v1
VK_KHR_external_memory_capabilities v1
VK_KHR_external_semaphore v1
VK_KHR_external_semaphore_capabilities v1
VK_KHR_fragment_shader_barycentric v1
VK_KHR_get_memory_requirements2 v1
VK_KHR_get_physical_device_properties2 v2
VK_KHR_get_surface_capabilities2 v1
VK_KHR_imageless_framebuffer v1
VK_KHR_image_format_list v1
VK_KHR_maintenance1 v2
VK_KHR_maintenance2 v1
VK_KHR_maintenance3 v1
VK_KHR_multiview v1
VK_KHR_portability_subset v1
VK_KHR_push_descriptor v2
VK_KHR_relaxed_block_layout v1
VK_KHR_sampler_mirror_clamp_to_edge v3
VK_KHR_sampler_ycbcr_conversion v14
VK_KHR_separate_depth_stencil_layouts v1
VK_KHR_shader_draw_parameters v1
VK_KHR_shader_float16_int8 v1
VK_KHR_shader_subgroup_extended_types v1
VK_KHR_storage_buffer_storage_class v1
VK_KHR_surface v25
VK_KHR_swapchain v70
VK_KHR_swapchain_mutable_format v1
VK_KHR_timeline_semaphore v2
VK_KHR_uniform_buffer_standard_layout v1
VK_KHR_variable_pointers v1
VK_EXT_debug_marker v4
VK_EXT_debug_report v10
VK_EXT_debug_utils v2
VK_EXT_descriptor_indexing v2
VK_EXT_fragment_shader_interlock v1
VK_EXT_hdr_metadata v2
VK_EXT_host_query_reset v1
VK_EXT_image_robustness v1
VK_EXT_inline_uniform_block v1
VK_EXT_memory_budget v1
VK_EXT_metal_objects v1
VK_EXT_metal_surface v1
VK_EXT_post_depth_coverage v1
VK_EXT_private_data v1
VK_EXT_robustness2 v1
VK_EXT_sample_locations v1
VK_EXT_scalar_block_layout v1
VK_EXT_separate_stencil_usage v1
VK_EXT_shader_stencil_export v1
VK_EXT_shader_viewport_index_layer v1
VK_EXT_subgroup_size_control v2
VK_EXT_swapchain_colorspace v4
VK_EXT_texel_buffer_alignment v1
VK_EXT_texture_compression_astc_hdr v1
VK_EXT_vertex_attribute_divisor v3
VK_AMD_gpu_shader_half_float v2
VK_AMD_negative_viewport_height v1
VK_AMD_shader_image_load_store_lod v1
VK_AMD_shader_trinary_minmax v1
VK_IMG_format_pvrtc v1
VK_INTEL_shader_integer_functions2 v1
VK_GOOGLE_display_timing v1
VK_MVK_macos_surface v3
VK_MVK_moltenvk v35
VK_NV_fragment_shader_barycentric v1
VK_NV_glsl_shader v1
[mvk-info] GPU device:
model: Apple M1 Max
type: Integrated
vendorID: 0x106b
deviceID: 0xc0203ef
pipelineCacheUUID: 0000277F-0C02-03EF-0000-000000000000
supports the following Metal Versions, GPU's and Feature Sets:
Metal Shading Language 2.4
GPU Family Apple 7
GPU Family Apple 6
GPU Family Apple 5
GPU Family Apple 4
GPU Family Apple 3
GPU Family Apple 2
GPU Family Apple 1
GPU Family Mac 2
GPU Family Mac 1
GPU Family Common 3
GPU Family Common 2
GPU Family Common 1
macOS GPU Family 2 v1
macOS GPU Family 1 v4
macOS GPU Family 1 v3
macOS GPU Family 1 v2
macOS GPU Family 1 v1
[mvk-info] Created VkInstance for Vulkan version 1.1.224, as requested by app, with the following 3 Vulkan extensions enabled:
VK_KHR_surface v25
VK_EXT_debug_utils v2
VK_EXT_metal_surface v1
[mvk-info] Using emulation for Vulkan semaphores.
[mvk-info] Created VkDevice to run on GPU Apple M1 Max with the following 3 Vulkan extensions enabled:
VK_KHR_driver_properties v1
VK_KHR_sampler_mirror_clamp_to_edge v3
VK_KHR_swapchain v70
[mvk-info] Created 3 swapchain images with initial size (1280, 720) and contents scale 1,0 for screen Built-in Retina Display.
[mvk-info] Created 3 swapchain images with initial size (1728, 1117) and contents scale 1,0 for screen Built-in Retina Display.
[mvk-info] Created 3 swapchain images with initial size (1728, 1117) and contents scale 1,0 for screen Built-in Retina Display.
Segmentation fault: 11!
Error: signal 11:

Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Prozess beendet]

Is there any known fix?

@Jojojoma4
Copy link

Hi, I recently followed this tutorial : https://www.youtube.com/watch?v=4YoHFRIHrTw&list=LL&index=6&t=278s
But when I try to open Wind Waker HD, the app crashes, giving me these infos on the Terminal :
Myname@MacBook-XXX ~ % /Users/XXX/Documents/cemu\ emulateur/Cemu ; exit;
No bundle id found
zsh: illegal hardware instruction /Users/XXX/Documents/cemu\ emulateur/Cemu
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

Does anyone have an idea of what's going on ?

@Tillsunset
Copy link
Contributor

Please follow the installation guide at the top of https://cemu.emiyl.com/, it is the most up to date guide. If you’re still having problems, please open an new issue as this pull request has been closed.

@zadowcloud
Copy link

Please follow the installation guide at the top of https://cemu.emiyl.com/, it is the most up to date guide. If you’re still having problems, please open an new issue as this pull request has been closed.

Thank you so much :)

@marcelo4768
Copy link

yoshi woolly world crash in 3-3 (world 3 stage 3) just when i try to open the stage 3

@iMonZ
Copy link

iMonZ commented Sep 26, 2023

Contributor

Whats the problem of providing an native arm64 version?

@jcrm1
Copy link
Contributor Author

jcrm1 commented Sep 26, 2023

Whats the problem of providing an native arm64 version?

This is an old PR for macOS CI. It is not related to adding aarch64 as a target architecture. There is a draft PPC recompiler PR that says it will make adding a new target architecture easier (#641).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support MacOS build on GitHub Actions (+artifacts)