Skip to content

Conversation

moraaar
Copy link

@moraaar moraaar commented Dec 21, 2022

What's new?

  • Added Mac platform support to PhysX 5.1.
  • New build preset mac64 added. It supports 64-bit x86_64 architecture with SSE2 SIMD instructions.
  • New build preset mac-arm64 added. It supports 64-bit arm architecture with NEON SIMD instructions.
  • Support for generating PhysX as either static or dynamic libraries.
  • New Mac platform readme.

Out of Scope

The following points are considered out of scope, they can be added in the future:

  • Support for PhysX Snippets.
  • Support for Omniverse Visual Debugger (OmniPVD) .
  • Support for other architectures: 32-bit x86

Known Errors/Limitations

	ELSEIF(TARGET_BUILD_PLATFORM STREQUAL "mac")
		IF(${PX_OUTPUT_ARCH} STREQUAL "x86")
			SET(RETVAL "mac.x86_${LIBPATH_SUFFIX}")
		ELSEIF(${PX_OUTPUT_ARCH} STREQUAL "arm")
			SET(RETVAL "mac.arm64")
		ENDIF()
  • Python package used by packman is based on x86_64 architecture and generates the error dyld[number]: missing symbol called when run on an arm-based Mac. To fix this nVidia has to add an ARM python package for mac into the packman scripts (Add to packman the arm-based version of python for Mac NVIDIA-Omniverse/PhysX#60). As a temporary solution, use your system's python adding the environment variable PM_PYTHON_EXT before building (for example by adding export PM_PYTHON_EXT="python3" into your .bash_profile file).
  • PhysX Systems that require a CUDA capable GPU are not supported in Mac, for example particle system or cloth simulation.

Testing

  • Built PhysX 5.1 successfully on mac64 in debug, checked, profile and release using PX_GENERATE_STATIC_LIBRARIES set to both true and false. The right output binaries were generated in bin/mac.x86_64
  • Built PhysX 5.1 successfully on mac-arm64 in debug, checked, profile and release using PX_GENERATE_STATIC_LIBRARIES set to both true and false. The right output binaries were generated in bin/mac.arm64
  • Built cmake install target successfully. It generated the correct output for Mac under install/mac64 and install/mac-arm64 folders, only including necessary headers for Mac.
  • Runtime tested using Open 3D Engine (O3DE) with an early integration branch. The following video shows O3DE running PhysX 5.1 on mac64.
    https://user-images.githubusercontent.com/27999040/204763960-7fe2763e-c3b1-4c73-a6fb-ad3357ef02d3.mov

Signed-off-by: moraaar [email protected]

@moraaar moraaar requested review from a team December 21, 2022 15:16
@moraaar moraaar merged commit 2e098c5 into o3de:release/104.1 Dec 21, 2022
@moraaar moraaar deleted the Mac_Support branch December 21, 2022 18:44
yangfengzzz pushed a commit to SpatialGraphics/PhysX-Mac that referenced this pull request Dec 10, 2024
## What's new?
- Added Mac platform support to PhysX 5.1.
- New build preset `mac64` added. It supports 64-bit x86_64 architecture with SSE2 SIMD instructions.
- New build preset `mac-arm64` added. It supports 64-bit arm architecture with NEON SIMD instructions.
- Support for generating PhysX as either static or dynamic libraries.
- New Mac platform readme.
        
## Out of Scope
The following points are considered out of scope, they can be added in the future:
- Support for PhysX Snippets.
- Support for Omniverse Visual Debugger (OmniPVD) .
- Support for other architectures: 32-bit x86
        
## Known Errors/Limitations
- The name of the bin folder for mac-arm64 will appear as `bin\mac.x86_64`. **To fix this nVidia has to modify the CMakeModules package it's downloaded from packman when building PhysX** (NVIDIA-Omniverse#59). The file that needs to be modified is `GetCompilerAndPlatform.cmake`, modifying the mac lines of the `if` condition inside `GetPlatformBinName` function to this:
````
	ELSEIF(TARGET_BUILD_PLATFORM STREQUAL "mac")
		IF(${PX_OUTPUT_ARCH} STREQUAL "x86")
			SET(RETVAL "mac.x86_${LIBPATH_SUFFIX}")
		ELSEIF(${PX_OUTPUT_ARCH} STREQUAL "arm")
			SET(RETVAL "mac.arm64")
		ENDIF()
````
- Python package used by packman is based on x86_64 architecture and generates the error `dyld[number]: missing symbol called` when run on an arm-based Mac. **To fix this nVidia has to add an ARM python package for mac into the packman scripts** (NVIDIA-Omniverse#60). As a temporary solution, use your system's python adding the environment variable `PM_PYTHON_EXT` before building (for example by adding `export PM_PYTHON_EXT="python3"` into your `.bash_profile` file).
- PhysX Systems that require a CUDA capable GPU are not supported in Mac, for example particle system or cloth simulation.
            
## Testing
- Built PhysX 5.1 successfully on mac64 in debug, checked, profile and release using `PX_GENERATE_STATIC_LIBRARIES` set to both true and false. The right output binaries were generated in `bin/mac.x86_64`
- Built PhysX 5.1 successfully on mac-arm64 in debug, checked, profile and release using `PX_GENERATE_STATIC_LIBRARIES` set to both true and false. The right output binaries were generated in `bin/mac.arm64`
- Built cmake `install` target successfully. It generated the correct output for Mac under `install/mac64` and `install/mac-arm64` folders, only including necessary headers for Mac.
- Runtime tested using `Open 3D Engine (O3DE)` with an early integration [branch](https://github.com/aws-lumberyard-dev/o3de/tree/PhysX5Support). The following video shows O3DE running PhysX 5.1 on mac64. 
https://user-images.githubusercontent.com/27999040/204763960-7fe2763e-c3b1-4c73-a6fb-ad3357ef02d3.mov

Signed-off-by: moraaar <[email protected]>
zacbrannelly pushed a commit to zacbrannelly/PhysX that referenced this pull request Mar 10, 2025
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.

3 participants