Const-me / Whisper

High-performance GPGPU inference of OpenAI's Whisper automatic speech recognition (ASR) model
Mozilla Public License 2.0
8.43k stars 721 forks source link

Build issues #25

Closed smbika007 closed 1 year ago

smbika007 commented 1 year ago

Tried building the entire solution in VS 2019 and got errors that led me to use VS 2022 (because it needs .NET 6, presumably).

Tried using VS 2022 and got:

Build started... 1>------ Build started: Project: PerfSummary, Configuration: Debug Any CPU ------ 2>------ Build started: Project: compareTraces, Configuration: Debug x64 ------ 3>------ Build started: Project: OldMain, Configuration: Debug x64 ------ 4>------ Build started: Project: ComputeShaders, Configuration: Debug x64 ------ 5>------ Build started: Project: ComLightLib, Configuration: Debug x64 ------ 2>stdafx.cpp 3>ggmlMsvc.c 3>C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.33.31629\include\xmmintrin.h(79,10): fatal error C1083: Cannot open include file: 'malloc.h': No such file or directory 2>C:\Users\smbik\Desktop\Git\Whisper\Tools\compareTraces\stdafx.h(3,10): fatal error C1083: Cannot open include file: 'assert.h': No such file or directory 4>compilation object save succeeded; see C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\x64\Debug\addRows.cso 4>compilation object save succeeded; see C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\x64\Debug\addRepeat64.cso 4>compilation object save succeeded; see C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\x64\Debug\addRepeatEx.cso 4>compilation object save succeeded; see C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\x64\Debug\addRepeat.cso 4>compilation object save succeeded; see C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\x64\Debug\convolutionMain2.cso 4>compilation object save succeeded; see C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\x64\Debug\convolutionPrep1.cso 4>compilation object save succeeded; see C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\x64\Debug\copyTranspose.cso 4>compilation object save succeeded; see C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\x64\Debug\addRepeatGelu64.cso 4>compilation object save succeeded; see C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\x64\Debug\convolutionPrep2.cso 4>compilation object save succeeded; see C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\x64\Debug\addRepeatGelu.cso 4>compilation object save succeeded; see C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\x64\Debug\addRepeatScale.cso 4>compilation object save succeeded; see C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\x64\Debug\addInPlace.cso 4>compilation object save succeeded; see C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\x64\Debug\add.cso 4>compilation object save succeeded; see C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\x64\Debug\copyConvert.cso 4>C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\convolutionMain.hlsl(34,4-29): warning X3557: loop doesn't seem to do anything, forcing loop to unroll 4>C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\convolutionMain.hlsl(34,4-29): warning X3557: loop doesn't seem to do anything, forcing loop to unroll 4> 4>compilation object save succeeded; see C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\x64\Debug\convolutionMain.cso 4>compilation object save succeeded; see C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\x64\Debug\convolutionMain2Fixed.cso 4>compilation object save succeeded; see C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\x64\Debug\flashAttentionCompat2.cso 4>compilation object save succeeded; see C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\x64\Debug\diagMaskInf.cso 4>compilation object save succeeded; see C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\x64\Debug\fmaRepeat1.cso 4>compilation object save succeeded; see C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\x64\Debug\flashAttentionCompat1.cso 4>compilation object save succeeded; see C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\x64\Debug\fmaRepeat164.cso 4>compilation object save succeeded; see C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\x64\Debug\fmaRepeat2.cso 3>Done building project "OldMain.vcxproj" -- FAILED. 2>Done building project "compareTraces.vcxproj" -- FAILED. 4>compilation object save succeeded; see C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\x64\Debug\flashAttention.cso 4>compilation object save succeeded; see C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\x64\Debug\mulMatByScalar.cso 4>C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\mulMatByRow64.hlsl(37,3-70): warning X3557: loop only executes for 1 iteration(s), forcing loop to unroll 4> 4>compilation object save succeeded; see C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\x64\Debug\mulMatByRow64.cso 4>compilation object save succeeded; see C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\x64\Debug\flashAttentionCompat3.cso 4>compilation object save succeeded; see C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\x64\Debug\mulMatDotMain.cso 4>compilation object save succeeded; see C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\x64\Debug\matReshapePanels.cso 4>compilation object save succeeded; see C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\x64\Debug\mulMatByRowTiledEx.cso 4>compilation object save succeeded; see C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\x64\Debug\mulMatByRow.cso 5>freeThreadedMarshaller.cpp 4>compilation object save succeeded; see C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\x64\Debug\mulMatDotReshape.cso 5>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\winnt.h(34,10): fatal error C1083: Cannot open include file: 'ctype.h': No such file or directory 4>compilation object save succeeded; see C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\x64\Debug\normCompat.cso 4>compilation object save succeeded; see C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\x64\Debug\norm.cso 4>compilation object save succeeded; see C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\x64\Debug\scaleInPlace.cso 4>compilation object save succeeded; see C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\x64\Debug\mulMatMadMain.cso 5>Done building project "ComLightLib.vcxproj" -- FAILED. 6>------ Build started: Project: Whisper, Configuration: Debug x64 ------ 4>compilation object save succeeded; see C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\x64\Debug\normFixed.cso 4>compilation object save succeeded; see C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\x64\Debug\softMax64.cso 4>C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\normFixed.hlsl(31,3-70): warning X3557: loop only executes for 1 iteration(s), forcing loop to unroll 4>C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\normFixed.hlsl(31,3-70): warning X3557: loop only executes for 1 iteration(s), forcing loop to unroll 4> 4>compilation object save succeeded; see C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\x64\Debug\normFixed64.cso 4>compilation object save succeeded; see C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\x64\Debug\softMax.cso 4>compilation object save succeeded; see C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\x64\Debug\softMaxLong.cso 4>compilation object save succeeded; see C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\x64\Debug\softMaxCompat.cso 4>compilation object save succeeded; see C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\x64\Debug\zeroMemory.cso 4>compilation object save succeeded; see C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\x64\Debug\softMaxFixed.cso 4>compilation object save succeeded; see C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\x64\Debug\mulMatByRowTiled.cso 4>compilation object save succeeded; see C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\x64\Debug\mulMatTiledEx.cso 6>stdafx.cpp 6>C:\Users\smbik\Desktop\Git\Whisper\Whisper\stdafx.h(4,10): fatal error C1083: Cannot open include file: 'assert.h': No such file or directory 6>Done building project "Whisper.vcxproj" -- FAILED. 7>------ Build started: Project: WhisperDesktop, Configuration: Debug x64 ------ 8>------ Build started: Project: main, Configuration: Debug x64 ------ 9>------ Build started: Project: WhisperNet, Configuration: Debug Any CPU ------ 4>compilation object save succeeded; see C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\x64\Debug\mulMatTiled.cso 1>PerfSummary -> C:\Users\smbik\Desktop\Git\Whisper\Tools\PerfSummary\bin\Debug\PerfSummary.dll 4>ComputeShaders.cpp 9>WhisperNet -> C:\Users\smbik\Desktop\Git\Whisper\WhisperNet\bin\Debug\WhisperNet.dll 10>------ Build started: Project: MicrophoneCS, Configuration: Debug x64 ------ 11>------ Build started: Project: TranscribeCS, Configuration: Debug x64 ------ 4>ComputeShaders.vcxproj -> C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\x64\Debug\ComputeShaders.lib 8>useDiscreteGpu.c 7>stdafx.cpp 4>Done building project "ComputeShaders.vcxproj". 12>------ Build started: Project: CompressShaders, Configuration: Debug Any CPU ------ 7>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\winnt.h(34,10): fatal error C1083: Cannot open include file: 'ctype.h': No such file or directory 7>Done building project "WhisperDesktop.vcxproj" -- FAILED. 8>main.cpp 8>C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.33.31629\include\cstdlib(12,10): fatal error C1083: Cannot open include file: 'math.h': No such file or directory 8>miscUtils.cpp 8>C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.33.31629\include\yvals.h(12,10): fatal error C1083: Cannot open include file: 'crtdbg.h': No such file or directory 8>params.cpp 10>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(5097,5): error MSB3030: Could not copy the file "C:\Users\smbik\Desktop\Git\Whisper\x64\Debug\Whisper.dll" because it was not found. 8>C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.33.31629\include\cstdlib(12,10): fatal error C1083: Cannot open include file: 'math.h': No such file or directory 8>textWriter.cpp 8>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\winnt.h(34,10): fatal error C1083: Cannot open include file: 'ctype.h': No such file or directory 8>Generating Code... 8>Done building project "main.vcxproj" -- FAILED. 10>Done building project "MicrophoneCS.csproj" -- FAILED. 11>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(5097,5): error MSB3030: Could not copy the file "C:\Users\smbik\Desktop\Git\Whisper\x64\Debug\Whisper.dll" because it was not found. 11>Done building project "TranscribeCS.csproj" -- FAILED. 12>CompressShaders -> C:\Users\smbik\Desktop\Git\Whisper\Tools\CompressShaders\bin\Debug\CompressShaders.dll ========== Build: 4 succeeded, 8 failed, 0 up-to-date, 0 skipped ==========

The error list:

Severity Code Description Project File Line Suppression State Error C1083 Cannot open include file: 'malloc.h': No such file or directory OldMain C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.33.31629\include\xmmintrin.h 79
Error C1083 Cannot open include file: 'assert.h': No such file or directory compareTraces C:\Users\smbik\Desktop\Git\Whisper\Tools\compareTraces\stdafx.h 3
Warning X3557 loop doesn't seem to do anything, forcing loop to unroll ComputeShaders C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\convolutionMain.hlsl 34
Warning X3557 loop doesn't seem to do anything, forcing loop to unroll ComputeShaders C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\convolutionMain.hlsl 34
Warning X3557 loop only executes for 1 iteration(s), forcing loop to unroll ComputeShaders C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\mulMatByRow64.hlsl 37
Error C1083 Cannot open include file: 'ctype.h': No such file or directory ComLightLib C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\winnt.h 34
Warning X3557 loop only executes for 1 iteration(s), forcing loop to unroll ComputeShaders C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\normFixed.hlsl 31
Warning X3557 loop only executes for 1 iteration(s), forcing loop to unroll ComputeShaders C:\Users\smbik\Desktop\Git\Whisper\ComputeShaders\normFixed.hlsl 31
Error C1083 Cannot open include file: 'assert.h': No such file or directory Whisper C:\Users\smbik\Desktop\Git\Whisper\Whisper\stdafx.h 4
Error C1083 Cannot open include file: 'ctype.h': No such file or directory WhisperDesktop C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\winnt.h 34
Error C1083 Cannot open include file: 'math.h': No such file or directory main C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.33.31629\include\cstdlib 12
Error C1083 Cannot open include file: 'crtdbg.h': No such file or directory main C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.33.31629\include\yvals.h 12
Error C1083 Cannot open include file: 'math.h': No such file or directory main C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.33.31629\include\cstdlib 12
Error C1083 Cannot open include file: 'ctype.h': No such file or directory main C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\winnt.h 34
Error MSB3030 Could not copy the file "C:\Users\smbik\Desktop\Git\Whisper\x64\Debug\Whisper.dll" because it was not found. MicrophoneCS C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets 5097
Error MSB3030 Could not copy the file "C:\Users\smbik\Desktop\Git\Whisper\x64\Debug\Whisper.dll" because it was not found. TranscribeCS C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets 5097

I'll check the errors one by one but it seems odd it can't build out of the box...thanks!

Const-me commented 1 year ago

@smbika007 VS 2019 not going to work, not only because .NET 6 projects, also because C++/20 language used in the main DLL.

Warnings by fxc.exe HLSL compiler about the loops being unrolled are harmless, I’m getting them too and they’re safe to ignore.

The real issues are C++ compiler errors about missing headers from the standard library: malloc.h, ctype.h, assert.h. I suspect you’re lacking components of visual studio. Can you confirm you have checked “Desktop development with C++” in the installer?

You can add/remove VS components after the install. Run “Visual studio installer” program from the start menu, and press “Modify” button to the right of the 2022 version.

smbika007 commented 1 year ago

Gotcha. I don't recall doing that or not but I'll check. Thanks! And thanks for the quick reply :-)

smbika007 commented 1 year ago

@Const-me Hi, I launched the installer and it showed VS2022 needed upgrades so it did that and I rebooted. I reopened the installer and found the entry for VS 2022 Professional and clicked "modify" which showed a number of categorized item headings:

Workloads, Individual components, Language packs, and Installation locations

Under Workloads was:

Web & cloud, Desktop & mobile, Gaming, and Other toolsets.

Under Desktop & mobile, Desktop development with C++ was checked (as was .NET desktop development) so I believe I must have it/them. Is there something under Individual components I might need?

UPDATE on build - I "seems" I now have only 11 errors (after attempting a build on the entire solution):

Severity Code Description Project File Line Suppression State Error MSB3030 Could not copy the file "C:\Users\smbik\Desktop\Git\Whisper\x64\Debug\Whisper.dll" because it was not found. TranscribeCS C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets 5150
Error C1083 Cannot open include file: 'assert.h': No such file or directory compareTraces C:\Users\smbik\Desktop\Git\Whisper\Tools\compareTraces\stdafx.h 3
Error C1083 Cannot open include file: 'malloc.h': No such file or directory OldMain C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.34.31933\include\xmmintrin.h 79
Error C1083 Cannot open include file: 'ctype.h': No such file or directory ComLightLib C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\winnt.h 34
Error C1083 Cannot open include file: 'assert.h': No such file or directory Whisper C:\Users\smbik\Desktop\Git\Whisper\Whisper\stdafx.h 4
Error C1083 Cannot open include file: 'math.h': No such file or directory main C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.34.31933\include\cstdlib 12
Error C1083 Cannot open include file: 'crtdbg.h': No such file or directory main C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.34.31933\include\yvals.h 17
Error C1083 Cannot open include file: 'math.h': No such file or directory main C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.34.31933\include\cstdlib 12
Error C1083 Cannot open include file: 'ctype.h': No such file or directory main C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\winnt.h 34
Error C1083 Cannot open include file: 'ctype.h': No such file or directory WhisperDesktop C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\winnt.h 34
Error MSB3030 Could not copy the file "C:\Users\smbik\Desktop\Git\Whisper\x64\Debug\Whisper.dll" because it was not found. MicrophoneCS C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets 5150

OR 265 depending on the weather...;-)

Const-me commented 1 year ago

@smbika007 On my computer, these headers are in that folder:
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\

Make sure you have "Windows 10 SDK (10.0.19041.0)" (any later version of Win10 SDK should probably be fine too, the projects are set up to use the latest installed version), and "Windows Universal C Runtime" components installed.

smbika007 commented 1 year ago

@smbika007 On my computer, these headers are in that folder:C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\

Make sure you have "Windows 10 SDK (10.0.19041.0)" (any later version of Win10 SDK should probably be fine too, the projects are set up to use the latest installed version), and "Windows Universal C Runtime" components installed.

Thanks. I do have that installed and found a possible fix on Stackoverflow regarding the Windows Universal C Runtime (whose name, to me, implies that it should be simply included without having to ask)...and it did not work with the same 11 errors. I am now reinstalling VS 2022 with the apropos items checked so I'll see...things used to be a LOT simpler...LOL

smbika007 commented 1 year ago

ok! I reinstalled VS2022 and I believe I've made real progress. I am down to these errors:

Severity Code Description Project File Line Suppression State Error C1083 Cannot open include file: 'shaderData-Debug.inl': No such file or directory Whisper C:\Users\smbik\Desktop\Git\Whisper2\Whisper\Whisper\D3D\shaders.cpp 11
Error MSB6006 "link.exe" exited with code 1104. WhisperDesktop C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets 1096
Error LNK1104 cannot open file 'C:\Users\smbik\Desktop\Git\Whisper2\Whisper\x64\Debug\Whisper.lib' WhisperDesktop C:\Users\smbik\Desktop\Git\Whisper2\Whisper\Examples\WhisperDesktop\LINK 1
Error MSB6006 "link.exe" exited with code 1104. main C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets 1096
Error LNK1104 cannot open file 'C:\Users\smbik\Desktop\Git\Whisper2\Whisper\x64\Debug\Whisper.lib' main C:\Users\smbik\Desktop\Git\Whisper2\Whisper\Examples\main\LINK 1
Error MSB3030 Could not copy the file "C:\Users\smbik\Desktop\Git\Whisper2\Whisper\x64\Debug\Whisper.dll" because it was not found. MicrophoneCS C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets 5150
Error MSB3030 Could not copy the file "C:\Users\smbik\Desktop\Git\Whisper2\Whisper\x64\Debug\Whisper.dll" because it was not found. TranscribeCS C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets 5150

which look like they might be a bit more surmountable. I'll do a search for the file shaderData-Debug.inl

Const-me commented 1 year ago

@smbika007 To generate shaderData-Debug.inl file, run the CompressShaders project, see step 4 of the build instructions

The release configuration of that project generates the corresponding Release build of these compute shaders.

smbika007 commented 1 year ago

Wow. Who knew following directions would do the trick (LOL)!

Thanks - I tend to just hit the gas and see what happens. It certainly pays to pay attention. So, all are built and I'll save running them for tomorrow...thanks for the help!