microsoft / onnxruntime

ONNX Runtime: cross-platform, high performance ML inferencing and training accelerator
https://onnxruntime.ai
MIT License
14.05k stars 2.83k forks source link

[Build] Build rel-1.8.1 version with CUDA fails #17575

Closed kylekam closed 11 months ago

kylekam commented 11 months ago

Describe the issue

I'm trying to build onnx with CUDA from souce (branch rel-1.8.1) but it fails with an error. However, I was able to build without CUDA support, but that isn't of much use to me.

System Information

Urgency

ASAP

Target platform

Windows 10 x64

Build script

./build.bat \ --config Release \ --build_nuget \ --parallel \ --use_openmp \ --skip_tests \ --cmake_generator "Visual Studio 16 2019" \ --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=80 \ --use_cuda \ --cuda_version 11.2 \ --cudnn_home C:/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/v11.2 \ --cuda_home C:/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/v11.2

Error / output

C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Microsoft\VC\v160\BuildCustomizations\masm.targets(70,5): error MSB3721: The command "ml64.exe /c /nologo /WX /Fo"onnxruntime_mlas.dir\Release\QgemmU8S8KernelAvx2.obj" /D"WIN32" /D"_WINDOWS" /D"EIGEN_HAS_C99_MATH" /D"NDEBUG" /D"GSL_UNENFORCED_ON_CONTRACT_VIOLATION" /D"USE_CUDA=1" /D"ENABLE_ORT_FORMAT_LOAD" /D"EIGEN_MPL2_ONLY" /D"EIGEN_HAS_CONSTEXPR" /D"EIGEN_HAS_VARIADIC_TEMPLATES" /D"EIGEN_HAS_CXX11_MATH" /D"EIGEN_HAS_CXX11_ATOMIC" /D"EIGEN_STRONG_INLINE=inline" /D"PLATFORM_WINDOWS" /D"NOGDI" /D"NOMINMAX" /D"_USE_MATH_DEFINES" /D"WINVER=0x0601" /D"CMAKE_INTDIR="Release"" /I "C:\Users\kkam\repos\buildonnx\include\onnxruntime" /I "C:\Users\kkam\repos\buildonnx\include\onnxruntime\core\session" /I "C:\Users\kkam\repos\buildonnx\build\Windows\Release" /I "C:\Users\kkam\repos\buildonnx\onnxruntime" /I "C:\Users\kkam\repos\buildonnx\onnxruntime\core\mlas\inc" /I "C:\Users\kkam\repos\buildonnx\onnxruntime\core\mlas\lib" /W3 /errorReport:prompt /utf-8 /sdl /wd4127 /wd4251 /wd4201 /wd6326 /wd6993 /wd6385 /TaC:\Users\kkam\repos\buildonnx\onnxruntime\core\mlas\lib\amd64\QgemmU8S8KernelAvx2.asm" exited with code 1. [C:\Users\kkam\repos\buildonnx\build\Windows\Release\onnxruntime_mlas.vcxproj]

Visual Studio Version

2019

GCC / Compiler Version

No response

kylekam commented 11 months ago

Downgraded cmake to 3.24.3 and downgrading Windows ML NuGet Package to 1.12.1 fixed my issue. #15101 helped me figure it out.