Apple Mac mini M1 Quick Test (OpenGL)


Apple Mac mini M1

 
Here are some feedbacks about the Mac mini M1 I purchased few weeks ago, in order to compile and test GeeXLab with the new Apple Silicon M1.

The M1 Chip

The M1 chip is a SoC (System on a Chip) and includes a 8-core CPU, a 8-core GPU as well as other components like a neural engine, memory or input/output interfaces.

The M1 GPU has a FP32 performance of 2.6 TFLOPS (source). This is more or less the same performance than the Radeon RX 560 or the GeForce GTX 1650:
– GeForce GTX 1650: 2.9 TFLOPS
– Radeon RX 560: 2.6 TFLOPS
See THIS PAGE for a more complete TFLOP table.

 

Xcode, command line tools

The source code of GeeXLab is based on makefiles and I had no problem to compile all core libraries from the command line. I installed the latest Xcode 12.3 as well as the command line tools (because gcc/g++ are needed). By default, the compilation in command line (like gcc file.c) produces a binary for the arm64 architecture. I was surprised to see that all GeeXLab OpenGL code has been successfully compiled. OpenGL is still there in the latest macOS Big Sur!

Using Xcode 12.3, you can generate a kind of hybrid executable (Apple calls it an universal macOS binary) that packs the x86_64 and arm64 code. But in command line with gcc/g++, you have to specify the target architecture. By default on Apple M1 + Big Sur, gcc will generate an amr64 code. If you want to generate a x86_64 code you have to use the following gcc option:
-target x86_64-apple-macos10.15

Example:
gcc main.c -o x86_test -target x86_64-apple-macos10.15

To compile for arm64 architecture:
gcc main.c -o arm_test -target arm64-apple-macos11

The arm64-apple-macos11 target is handy if you are on an Intel-based Mac mini and want to compile for ARM architecture.

Once I finished to build GeeXLab, I was impressed by its launch speed: very fast. On Linux, the launch of GeeXLab is fast but on macOS Big Sur + Apple M1, the startup is a bit faster.

This is GeeXLab compiled for arm64 architecture:
GeeXLab on Apple Mac mini M1 - arm64

 

Rosetta

I compiled GeeXLab in two separate versions: GeeXLab for arm64 and GeeXLab for Intel x86_64. On the Apple M1, you can’t launch an x86_64 executable directly. You have to install Rosetta before. Fortunately, it’s easy, you are guided by macOS:

Apple Mac mini M1 - macOS Big Sur - Rosetta

 
Rosetta is a translation layer that allows the Apple M1 CPU (arm64 architecture) to execute a x86_64 code developed for Intel-based Macs. The first version of Rosetta was developed for the switch from PowerPC to Intel CPUs. Rosetta 2 is the new version for the switch from Intel to Apple silicon M1 CPUs.

Rosetta works fine: here, we have GeeXLab compiled for x86_64 architecture running on Apple M1:

GeeXLab on Apple Mac mini M1 - x86_64

 
Here is the same GeeXLab on an Intel-based Mac mini:

GeeXLab on Apple Mac mini Intel - x86_64

 
Look at the framerate: 1951 FPS (M1 CPU, arm64 native code), 1282 FPS (M1 CPU, x86_64 emulated code via rosetta) and 471 FPS (Intel CPU, x86_64 native code). This statement found on the Apple M1 homepage is true:

And thanks to Metal and M1, some of the most graphically demanding apps perform better under Rosetta 2 than they did running natively on previous Mac systems with integrated graphics.

 

M1 GPU OpenGL Test

 
Let’s do another test: a shadertoy demo with a heavy pixel shader. I chose a recent demo that gives some good results: Neural Stanford Bunny 5kb.

This demo has been ported to GeeXLab and is available in the shadertoy demopack in the following folder:
geexlab-demopack-shadertoy/gl-32-shadertoy-02/neural-stanford-bunny-5-kb/

GeeXLab on Apple Mac mini M1 - arm64 - Shadertoy demo

Resolution of the demo: 800×480

Some framerates:
GeForce RTX 2070 on Windows 10: 720 FPS
Apple M1 Mac mini (arm64 native code): 245 FPS
– Apple M1 Mac mini (x86_64 via rosetta): 220 FPS
GeForce GTX 750 on Windows 10: 176 FPS

Let’s look at the theoretical FP32 performance of these GPUs:
– GeForce RTX 2070: 7.4 TFLOPS
– Apple M1: 2.6 TFLOPS
– GeForce GTX 750: 1.1 FLOPS

Results sound coherent. This shadertoy test shows us that the M1 GPU is not a toy.

GeeXLab for arm64 can be downloaded from this link.
GeeXLab for x86_64 can be downloaded from this link.

 

Activity Monitor

macOS Big Sur has a way to know for what architecture a program has been compiled. Launch the Activity Monitor and look at the Architecture column:

– GeeXLab for Apple Silicon M1:
macOS Activity Monitor - GeeXLab for Apple silicon

– GeeXLab for Intel x86_64:
macOS Activity Monitor - GeeXLab for Apple silicon

 

OpenGL info

To end this article, here is the OpenGL 4.1 and OpenGL 2.1 data from GeeXLab (M1 arm64) log file. The modern way to do graphics programming on macOS is to use the Metal API (or Vulkan via MoltenVK). But a lot of OpenGL applications exist for macOS and it’s nice to know that they still work. According to the GL_VERSION, OpenGL in macOS is based on the Metal API.

OpenGL 4.1

GL_RENDERER: Apple M1
GL_VENDOR: Apple
GL_VERSION: 4.1 Metal - 71.0.7
GL_SHADING_LANGUAGE_VERSION: 4.10
OpenGL version detected: 4.1

OpenGL extensions: 43
GL_ARB_blend_func_extended
GL_ARB_draw_buffers_blend
GL_ARB_draw_indirect
GL_ARB_ES2_compatibility
GL_ARB_explicit_attrib_location
GL_ARB_gpu_shader_fp64
GL_ARB_gpu_shader5
GL_ARB_instanced_arrays
GL_ARB_internalformat_query
GL_ARB_occlusion_query2
GL_ARB_sample_shading
GL_ARB_sampler_objects
GL_ARB_separate_shader_objects
GL_ARB_shader_bit_encoding
GL_ARB_shader_subroutine
GL_ARB_shading_language_include
GL_ARB_tessellation_shader
GL_ARB_texture_buffer_object_rgb32
GL_ARB_texture_cube_map_array
GL_ARB_texture_gather
GL_ARB_texture_query_lod
GL_ARB_texture_rgb10_a2ui
GL_ARB_texture_storage
GL_ARB_texture_swizzle
GL_ARB_timer_query
GL_ARB_transform_feedback2
GL_ARB_transform_feedback3
GL_ARB_vertex_attrib_64bit
GL_ARB_vertex_type_2_10_10_10_rev
GL_ARB_viewport_array
GL_EXT_debug_label
GL_EXT_debug_marker
GL_EXT_framebuffer_multisample_blit_scaled
GL_EXT_texture_compression_s3tc
GL_EXT_texture_filter_anisotropic
GL_EXT_texture_sRGB_decode
GL_APPLE_client_storage
GL_APPLE_container_object_shareable
GL_APPLE_flush_render
GL_APPLE_rgb_422
GL_APPLE_row_bytes
GL_APPLE_texture_range
GL_NV_texture_barrier

OpenGL 2.1

GL_RENDERER: Apple M1
GL_VENDOR: Apple
GL_VERSION: 2.1 Metal - 71.0.7
GL_SHADING_LANGUAGE_VERSION: 1.20
OpenGL version detected: 2.1

OpenGL extensions: 133
GL_ARB_color_buffer_float
GL_ARB_depth_buffer_float
GL_ARB_depth_clamp
GL_ARB_depth_texture
GL_ARB_draw_buffers
GL_ARB_draw_elements_base_vertex
GL_ARB_draw_instanced
GL_ARB_fragment_program
GL_ARB_fragment_program_shadow
GL_ARB_fragment_shader
GL_ARB_framebuffer_object
GL_ARB_framebuffer_sRGB
GL_ARB_half_float_pixel
GL_ARB_half_float_vertex
GL_ARB_imaging
GL_ARB_instanced_arrays
GL_ARB_multisample
GL_ARB_multitexture
GL_ARB_occlusion_query
GL_ARB_pixel_buffer_object
GL_ARB_point_parameters
GL_ARB_point_sprite
GL_ARB_provoking_vertex
GL_ARB_seamless_cube_map
GL_ARB_shader_objects
GL_ARB_shader_texture_lod
GL_ARB_shading_language_100
GL_ARB_shadow
GL_ARB_shadow_ambient
GL_ARB_sync
GL_ARB_texture_border_clamp
GL_ARB_texture_compression
GL_ARB_texture_compression_rgtc
GL_ARB_texture_cube_map
GL_ARB_texture_env_add
GL_ARB_texture_env_combine
GL_ARB_texture_env_crossbar
GL_ARB_texture_env_dot3
GL_ARB_texture_float
GL_ARB_texture_mirrored_repeat
GL_ARB_texture_non_power_of_two
GL_ARB_texture_rectangle
GL_ARB_texture_rg
GL_ARB_transpose_matrix
GL_ARB_vertex_array_bgra
GL_ARB_vertex_blend
GL_ARB_vertex_buffer_object
GL_ARB_vertex_program
GL_ARB_vertex_shader
GL_ARB_window_pos
GL_EXT_abgr
GL_EXT_bgra
GL_EXT_bindable_uniform
GL_EXT_blend_color
GL_EXT_blend_equation_separate
GL_EXT_blend_func_separate
GL_EXT_blend_minmax
GL_EXT_blend_subtract
GL_EXT_clip_volume_hint
GL_EXT_debug_label
GL_EXT_debug_marker
GL_EXT_draw_buffers2
GL_EXT_draw_range_elements
GL_EXT_fog_coord
GL_EXT_framebuffer_blit
GL_EXT_framebuffer_multisample
GL_EXT_framebuffer_multisample_blit_scaled
GL_EXT_framebuffer_object
GL_EXT_framebuffer_sRGB
GL_EXT_geometry_shader4
GL_EXT_gpu_program_parameters
GL_EXT_gpu_shader4
GL_EXT_multi_draw_arrays
GL_EXT_packed_depth_stencil
GL_EXT_packed_float
GL_EXT_provoking_vertex
GL_EXT_rescale_normal
GL_EXT_secondary_color
GL_EXT_separate_specular_color
GL_EXT_shadow_funcs
GL_EXT_stencil_two_side
GL_EXT_stencil_wrap
GL_EXT_texture_array
GL_EXT_texture_compression_dxt1
GL_EXT_texture_compression_s3tc
GL_EXT_texture_env_add
GL_EXT_texture_filter_anisotropic
GL_EXT_texture_integer
GL_EXT_texture_lod_bias
GL_EXT_texture_rectangle
GL_EXT_texture_shared_exponent
GL_EXT_texture_sRGB
GL_EXT_texture_sRGB_decode
GL_EXT_timer_query
GL_EXT_transform_feedback
GL_EXT_vertex_array_bgra
GL_APPLE_aux_depth_stencil
GL_APPLE_client_storage
GL_APPLE_element_array
GL_APPLE_fence
GL_APPLE_float_pixels
GL_APPLE_flush_buffer_range
GL_APPLE_flush_render
GL_APPLE_packed_pixels
GL_APPLE_pixel_buffer
GL_APPLE_rgb_422
GL_APPLE_row_bytes
GL_APPLE_specular_vector
GL_APPLE_texture_range
GL_APPLE_transform_hint
GL_APPLE_vertex_array_object
GL_APPLE_vertex_point_size
GL_APPLE_vertex_program_evaluators
GL_APPLE_ycbcr_422
GL_ATI_separate_stencil
GL_ATI_texture_env_combine3
GL_ATI_texture_float
GL_IBM_rasterpos_clip
GL_NV_blend_square
GL_NV_conditional_render
GL_NV_depth_clamp
GL_NV_fog_distance
GL_NV_fragment_program_option
GL_NV_fragment_program2
GL_NV_light_max_exponent
GL_NV_texgen_reflection
GL_NV_texture_barrier
GL_NV_vertex_program2_option
GL_NV_vertex_program3
GL_SGI_color_matrix
GL_SGIS_generate_mipmap
GL_SGIS_texture_edge_clamp
GL_SGIS_texture_lod

7 thoughts on “Apple Mac mini M1 Quick Test (OpenGL)”

  1. t

    downloading GeeXLab from here: https://www.geeks3d.com/dl/show/665 just results in the message

    “GeeXLab” is damaged and can’t be opened. You should move it to the Trash.

    … when I try to run the GeeXLab app folder.

    I’ve tried enabling/disabling GateKeeper and right-click Open on the app… is there some trick I’m missing? I’m new to OSX so any help is appreciated.

    1. JeGX Post Author

      This version of GeeXLab is for the Apple M1 processor and can not be executed on a Intel-based mac. Do you have a mac M1?

            1. JeGX Post Author

              Nope, it’s not you, I finally took the time to test it and you’re right, something is broken in GeeXLab. I’m working on this…

Comments are closed.