nerfacc icon indicating copy to clipboard operation
nerfacc copied to clipboard

error LNK2001: unresolved external symbol __guard_eh_cont_table

Open antithing opened this issue 1 year ago • 5 comments

I am building nerfacc as part of a third party app, and I get the following error from nerfacc:


C:/Users/B/AppData/Local/Programs/Python/Python39/lib/site-packages/torch/include\ATen/core/dispatch/OperatorEntry.h(270): note: see reference to class template instantiation 'ska::flat_hash_map<c10::DispatchKey,std::list<c10::impl::AnnotatedKernel,std::allocator<c10::impl::AnnotatedKernel>>,std::hash<c10::DispatchKey>,std::equal_to<K>,std::allocator<std::pair<K,V>>>' being compiled
        with
        [
            K=c10::DispatchKey,
            V=std::list<c10::impl::AnnotatedKernel,std::allocator<c10::impl::AnnotatedKernel>>
        ]
[10/10] "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64/link.exe" cdf.cuda.o contraction.cuda.o intersection.cuda.o pack.cuda.o pybind.cuda.o ray_marching.cuda.o render_transmittance.cuda.o render_transmittance_cub.cuda.o render_weight.cuda.o /nologo /DLL c10.lib c10_cuda.lib torch_cpu.lib torch_cuda.lib -INCLUDE:?warp_size@cuda@at@@YAHXZ torch.lib /LIBPATH:C:\Users\B\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\lib torch_python.lib /LIBPATH:C:\Users\B\AppData\Local\Programs\Python\Python39\libs "/LIBPATH:C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\lib\x64" cudart.lib /out:nerfacc_cuda.pyd
FAILED: nerfacc_cuda.pyd
"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64/link.exe" cdf.cuda.o contraction.cuda.o intersection.cuda.o pack.cuda.o pybind.cuda.o ray_marching.cuda.o render_transmittance.cuda.o render_transmittance_cub.cuda.o render_weight.cuda.o /nologo /DLL c10.lib c10_cuda.lib torch_cpu.lib torch_cuda.lib -INCLUDE:?warp_size@cuda@at@@YAHXZ torch.lib /LIBPATH:C:\Users\B\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\lib torch_python.lib /LIBPATH:C:\Users\B\AppData\Local\Programs\Python\Python39\libs "/LIBPATH:C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\lib\x64" cudart.lib /out:nerfacc_cuda.pyd
   Creating library nerfacc_cuda.lib and object nerfacc_cuda.exp
MSVCRT.lib(loadcfg.obj) : error LNK2001: unresolved external symbol __guard_eh_cont_table
MSVCRT.lib(loadcfg.obj) : error LNK2001: unresolved external symbol __guard_eh_cont_count
nerfacc_cuda.pyd : fatal error LNK1120: 2 unresolved externals
ninja: build stopped: subcommand failed.

Epoch 0: : 0it [01:33, ?it/s]
[W C:\actions-runner\_work\pytorch\pytorch\builder\windows\pytorch\torch\csrc\CudaIPCTypes.cpp:15] Producer process has been terminated before all shared CUDA tensors released. See Note [Sharing CUDA tensors]

What might be causing this?

antithing avatar Jun 12 '23 17:06 antithing

Hi i'm not quite familiar with windows build and it is a bit hard to tell from this error info.

I would recommend you to install the pre-built wheels following the instruction here.

liruilong940607 avatar Jun 12 '23 20:06 liruilong940607

Thank you for getting back to me. The project I am compiling expects version 0.3.3, https://github.com/bennyguo/instant-nsr-pl

when I use the wheel I get ;

from nerfacc import ContractionType, OccupancyGrid, ray_marching, render_weight_from_density, accumulate_along_rays
ImportError: cannot import name 'ContractionType'  

antithing avatar Jun 12 '23 20:06 antithing

We had a major update from 0.3.5 to 0.4.0 and had API changes in-between. So you might want to install nerfacc<=0.3.5 from here. Make sure to find the correct version of pytorch and cuda that corresponds to it.

liruilong940607 avatar Jun 12 '23 20:06 liruilong940607

Thank you! I will try that.

I also found that I saw this..

subprocess.CalledProcessError: Command '['where', 'cl']' returned non-zero exit status 1.
Epoch 0: : 0it [00:15, ?it/s]
[W C:\actions-runner\_work\pytorch\pytorch\builder\windows\pytorch\torch\csrc\CudaIPCTypes.cpp:15] Producer process has been terminated before all shared CUDA tensors released. See Note [Sharing CUDA tensors

Until I added the path to cl.exe to my environment variables. Is that normal?

antithing avatar Jun 12 '23 20:06 antithing

Honestly I don't have too much of knowledge of compiling on windows.

liruilong940607 avatar Jun 12 '23 21:06 liruilong940607