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

Add support for Windows ARM64 #2089

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

anthony-linaro
Copy link

@anthony-linaro anthony-linaro commented Nov 7, 2024

This adds proper support for building for Windows ARM64 devices. using MSVC.

It does actually work right now, but only by complete accident, and with no SIMD enabled - this enables everything properly.

As part of this, I updated the version of sse2neon used to one compatible with MSVC - the particular hash I used is the exact one that Blender uses, which is known working (there were some issues with the base 1.7.0 release).

Commands used:

mkdir build
cd build
cmake -G"Ninja" ..
cmake --build .
ctest

All tests pass. This is using VS2022, I wouldn't really use VS2019 for ARM64 platforms if I'm honest.

I didn't test any of the GPU things, although GLUT may work, as I added ARM64 support to FreeGLUT a few years ago.

Addresses #1859 (so probably of interest to @num3ric also)

Signed-off-by: Anthony Roberts <[email protected]>
Copy link

linux-foundation-easycla bot commented Nov 7, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@num3ric
Copy link
Contributor

num3ric commented Nov 7, 2024

Love it, thanks for the work! Hopefully the CLA & failing tests can be resolved.

@@ -16,7 +16,7 @@ include(FetchContent)
set(FETCHCONTENT_BASE_DIR "${CMAKE_BINARY_DIR}/ext/build/sse2neon")
FetchContent_Declare(sse2neon
GIT_REPOSITORY https://github.com/DLTcollab/sse2neon.git
GIT_TAG v1.6.0
GIT_TAG 227cc413fb2d50b2a10073087be96b59d5364aea
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason you couldn't pick an official version number here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Long story short, we uncovered some issues with 1.7.0 in Blender on various platforms, and needed to update to a non-versioned commit, as they only version sse2neon once a year - the issues may or may not affect OCIO, but this is at least a known working and tested version that Blender uses.

@anthony-linaro
Copy link
Author

I'll have a dig into those tests and try and figure it out - I don't have those platforms to hand, so will be some guesswork involved.

For the CLA, I'm trying to find out who our internal person is that is responsible for EasyCLA so thay can approve it under our corporate account - I'll find out at some point soon I'm sure

Signed-off-by: Anthony Roberts <[email protected]>
@anthony-linaro
Copy link
Author

Have fixed a small buildfile issue - I am hoping this may resolve the mac issues (sse2neon accidentally got disabled in some configurations).

I have also fixed some additional issues I encountered while debugging (namely it wasn't actually using sse2neon properly outside of the cmake test, oops).

I have been building with python off, there seems to be some sort of Access Violation Exception, but I'm not sure what it is caused by - for now, the rest of the test suite passes so it should be fine.

@anthony-linaro
Copy link
Author

CLA now done!

@num3ric
Copy link
Contributor

num3ric commented Nov 15, 2024

Have you tried (cross-)compiling -A ARM64 from an x64-based PC? Unfortunately #1859 isn't fully addressed here, since compiling this PR still fails for me unless I add:

    if(MSVC)
        set(CMAKE_SYSTEM_PROCESSOR ${MSVC_CXX_ARCHITECTURE_ID})
    endif()

If not, I get OCIO_ARCH_X86 1 and CpuInfo.cpp fails per issue.

PR looks good otherwise though!

@anthony-linaro
Copy link
Author

I had not, mainly on the account of me not having a suitable x64 machine to hand 😄

I'll get one set up for development and give it a go

@anthony-linaro
Copy link
Author

anthony-linaro commented Nov 20, 2024

Commit pushed, should allow cross-compilation. Tested with the command line:

cmake -A arm64 .. -DOCIO_BUILD_PYTHON=OFF

On a Windows x64 machine - the binaries produced appear to run correctly on my ARM64 machine

@anthony-linaro
Copy link
Author

Thanks for the approval, @num3ric - is there someone else who needs to review this for it to go in?

@doug-walker
Copy link
Collaborator

@anthony-linaro , thanks for the contribution. Regarding reviews, the project requires a minimum of two reviewers.

This PR makes significant changes to the build system which are not fully tested by our CI, so we definitely need more people to test. This includes validating that the various Mac builds were not affected.

Are you looking for this to go in OCIO 2.4.x or could it wait until 2.5 next fall?

@anthony-linaro
Copy link
Author

anthony-linaro commented Nov 25, 2024

Thanks for the reply @doug-walker - ideally sooner rather than later, so 2.4.x - this would mean Windows ARM64 would be properly compatible with the VFX Reference Platform 2025, rather than having to wait another year (well, once my USD PR is merged, too).

VFX reference platform compatibility is something that has been requested by a few external partners, and it would probably be a disappointing answer for me to give them, if I told them they need to wait another year, or maintain an out-of-tree patch

@num3ric
Copy link
Contributor

num3ric commented Nov 26, 2024

+1 on prioritization, to get rid of patches on our next engine release.

Also confirming on my end that this PR successfully resolves #1859.

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