NVlabs / instant-ngp

Instant neural graphics primitives: lightning fast NeRF and more
https://nvlabs.github.io/instant-ngp
Other
15.78k stars 1.9k forks source link

`cmake --build build --config RelWithDebInfo -j 16` throws 100s of errors on Windows #48

Closed ifilipis closed 2 years ago

ifilipis commented 2 years ago

C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include\xmemory(961): error : operand of "" must be a pointer but has type "char" [D:\NeRF\instant-ngp\build\dependencies\tiny-cuda-nn\src\tiny-cuda -nn.vcxproj] detected during: instantiation of "void std::_Destroy_range(_NoThrowFwdIt, _NoThrowSentinel) [with _NoThrowFwdIt=char, _No ThrowSentinel=unsigned long long]" (309): here instantiation of "void std::_Destroy_in_place(_Ty &) [with _Ty=char]" (961): here instantiation of "void std::_Destroy_range(_NoThrowFwdIt, _NoThrowSentinel) [with _NoThrowFwdIt=char , _ NoThrowSentinel=char ]" (309): here instantiation of "void std::_Destroy_in_place(_Ty &) [with _Ty=char ]" C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include\xstring(4621): here instantiation of "void std::basic_string<_Elem, _Traits, _Alloc>::_Tidy_deallocate() [with _Elem=char, _T raits=std::char_traits, _Alloc=std::allocator]" C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include\xstring(3003): here instantiation of "std::basic_string<_Elem, _Traits, _Alloc>::~basic_string() [with _Elem=char, _Traits=st d::char_traits, _Alloc=std::allocator]" C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include\system_error(447): h ere

All errors are of this kind. Seems like something is not linked properly, but I don't know what

I tried to use both x86 and x64 Native Tools Command Prompt

Also, I'm using Build Tools only. Tried to install Visual Studio Community, that didn't help either

MikePelton commented 2 years ago

Not sure it will solve your problem but I'm just walking this same path. First up, forget x86 - everything needs to be x64.

Also have just installed CUDA Toolkit v 11.6 - I was working with 11.3 earlier and using that threw hundreds of compiler errors - now at least tiny-cuda-nn builds under VS 2019 Community Edition. FYI avoid VS 2022 for CUDA in general incidentally.

ifilipis commented 2 years ago

Not sure it will solve your problem but I'm just walking this same path. First up, forget x86 - everything needs to be x64.

Also have just installed CUDA Toolkit v 11.6 - I was working with 11.3 earlier and using that threw hundreds of compiler errors - now at least tiny-cuda-nn builds under VS 2019 Community Edition. FYI avoid VS 2022 for CUDA in general incidentally.

Have you managed to build it eventually? I'll give it a try

MikePelton commented 2 years ago

Well it's built which is pretty exciting (also including Optix 7.4) - will let you know how it goes from here!

ifilipis commented 2 years ago

Can confirm it's working with CUDA 11.5 as well

@Tom94 there likely are some compatibility issues with 11.3 on Windows

Tom94 commented 2 years ago

Unfortunately, I don't think the problem is directly related to CUDA 11.3, but rather to compatibility with whatever minor Visual Studio version is installed. In the past, I've had working CUDA installs break due to running the VS updater, and vice versa.

I wish there was an easier way to troubleshoot these other than telling people to "update everything".

MikePelton commented 2 years ago

Thanks Thomas - to that end, I'm all good with CUDA 11.6, OptiX 7.4 and Microsoft Visual Studio Community 2019 Version 16.11.9.