[GH-ISSUE #278] [Windows/MSVC] Build fails with C3861: '__cpuidex' identifier not found — missing intrin.h #104

Closed
opened 2026-10-29 21:20:53 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @suprekt on GitHub (Oct 19, 2026).
Original GitHub issue: https://github.com/mw00/project-maya/issues/278

The latest Project Maya engine failed to compile on Windows 11 using Visual Studio 2022 Build Tools.

The build stopped while compiling src/kernels/cpu/iq_avx512_one.cpp because MSVC could not find the declaration of __cpuidex.

I was able to resolve the issue by adding the missing <intrin.h> header. After this change, the engine compiled successfully.

System Information

OS: Windows 11 Pro

CPU: Intel Core i7-13700K

GPU: NVIDIA GeForce RTX 4080 16 GB

RAM: 192 GB DDR5

CUDA Toolkit: 13.0

Compiler: Visual Studio 2022 Build Tools (MSVC 14.44.35207)

Build configuration: Release, CUDA enabled

Error Log

[1/5] Building CXX object CMakeFiles\strata_kernels_cpu.dir\src\kernels\cpu\iq_avx512_one.cpp.obj

C:\Maya-GLM\src\kernels\cpu\iq_avx512_one.cpp(99):
error C3861: '__cpuidex': identifier not found

C:\Maya-GLM\src\kernels\cpu\iq_avx512_one.cpp(101):
error C3861: '__cpuidex': identifier not found

ninja: build stopped: subcommand failed.

Retrying the build produced the same errors.

Solution

In src/kernels/cpu/iq_avx512_one.cpp, add:

#ifdef _MSC_VER
#include <intrin.h>
#endif

This ensures that the __cpuidex intrinsic is properly declared when compiling with Microsoft Visual C++.

Result

After adding the header:

The previous C3861 errors disappeared.

The engine compiled successfully.

No changes to CUDA, Visual Studio, BIOS, or other build settings were required.

I had also successfully built an earlier version of Project Maya on the same machine, suggesting this may be a regression introduced by a recent source code change.

Suggested Fix

Consider adding the conditional <intrin.h> include upstream to ensure compatibility with MSVC on Windows.

Thanks for the work on Project Maya!

Originally created by @suprekt on GitHub (Oct 19, 2026). Original GitHub issue: https://github.com/mw00/project-maya/issues/278 The latest Project Maya engine failed to compile on Windows 11 using Visual Studio 2022 Build Tools. The build stopped while compiling src/kernels/cpu/iq_avx512_one.cpp because MSVC could not find the declaration of __cpuidex. I was able to resolve the issue by adding the missing <intrin.h> header. After this change, the engine compiled successfully. System Information OS: Windows 11 Pro CPU: Intel Core i7-13700K GPU: NVIDIA GeForce RTX 4080 16 GB RAM: 192 GB DDR5 CUDA Toolkit: 13.0 Compiler: Visual Studio 2022 Build Tools (MSVC 14.44.35207) Build configuration: Release, CUDA enabled Error Log [1/5] Building CXX object CMakeFiles\strata_kernels_cpu.dir\src\kernels\cpu\iq_avx512_one.cpp.obj C:\Maya-GLM\src\kernels\cpu\iq_avx512_one.cpp(99): error C3861: '__cpuidex': identifier not found C:\Maya-GLM\src\kernels\cpu\iq_avx512_one.cpp(101): error C3861: '__cpuidex': identifier not found ninja: build stopped: subcommand failed. Retrying the build produced the same errors. Solution In src/kernels/cpu/iq_avx512_one.cpp, add: #ifdef _MSC_VER #include <intrin.h> #endif This ensures that the __cpuidex intrinsic is properly declared when compiling with Microsoft Visual C++. Result After adding the header: The previous C3861 errors disappeared. The engine compiled successfully. No changes to CUDA, Visual Studio, BIOS, or other build settings were required. I had also successfully built an earlier version of Project Maya on the same machine, suggesting this may be a regression introduced by a recent source code change. Suggested Fix Consider adding the conditional <intrin.h> include upstream to ensure compatibility with MSVC on Windows. Thanks for the work on Project Maya!
Author
Owner

@mw00 commented on GitHub (Oct 20, 2026):

Fixed in v1.1.18 (<intrin.h> for MSVC in iq_avx512_one.cpp). Thanks for the report and the fix!

<!-- gh-comment-id:6295068959 --> @mw00 commented on GitHub (Oct 20, 2026): Fixed in [v1.1.18](https://github.com/mw00/project-maya/releases/tag/v1.1.18) (`<intrin.h>` for MSVC in iq_avx512_one.cpp). Thanks for the report and the fix!
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
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
mw00/project-maya#104
No description provided.