tiny-cuda-nn icon indicating copy to clipboard operation
tiny-cuda-nn copied to clipboard

Can't install "tiny cuda nn" - host_config.h(231): fatal error C1083: Cannot open include file: 'crtdefs.h': No such file or directory

Open avrum opened this issue 2 years ago • 10 comments

Describe the bug Getting the following error when trying to run

pip install git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch

Produce the following output:

 error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [163 lines of output]

...


FAILED: C:/Users/Asus ws 422/AppData/Local/Temp/pip-req-build-w8vivfm6/bindings/torch/build/dependencies/fmt/src/os.obj
 
fatal error C1083: Cannot open include file: 'cerrno': No such file or directory

C:\Users\Asus422\AppData\Local\Temp\pip-req-build-w8vivfm6/dependencies/fmt/include\fmt/format-inl.h(11): fatal error C1083: Cannot open include file: 'algorithm': No such file or directory

cl : Command line warning D9025 : overriding '/D__CUDA_NO_HALF_OPERATORS__' with '/U__CUDA_NO_HALF_OPERATORS__'
      cl : Command line warning D9025 : overriding '/D__CUDA_NO_HALF_CONVERSIONS__' with '/U__CUDA_NO_HALF_CONVERSIONS__'
      cl : Command line warning D9025 : overriding '/D__CUDA_NO_HALF2_OPERATORS__' with '/U__CUDA_NO_HALF2_OPERATORS__'

      common_device.cu

      E:\Program Files\CUDA\v11.7\include\crt/host_config.h(231): fatal error C1083: Cannot open include file: 'crtdefs.h': No such file or directory




Any thought how to handle it?

My system Info: Windows 10 Visual Studio 2022 CUDA 11.7

avrum avatar Mar 12 '23 19:03 avrum

I meet the same problem. And my sys info is : Win 10 VS 2019 CUDA 11.3

Eric-Ho-Matrix avatar Mar 13 '23 19:03 Eric-Ho-Matrix

I meet the same problem. And my sys info is : Win 10 VS 2019 CUDA 11.3

i have same error,can you help me

zhanghongyong123456 avatar Mar 14 '23 09:03 zhanghongyong123456

Had the same issue, it's mostly related to Visual Studio not setting up environment variable during install. Before installing tiny-cuda-nn, in the same anaconda command prompt windows run vcvars64.bat (usually it's in C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build) which sets VC env vars correctly. Then proceed to install tiny-cuda-nn (with pip install git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch as described in the readme)

Also check of you have ninja installed somewhere, (in the command prompt use "where ninja" to check if you it can be found) it gave me problem with tiny-cuda-nn as it defaults to it if it's found, I removed it from my path and all was fine.

davidebaltieri31 avatar Mar 21 '23 22:03 davidebaltieri31

I tried method above and didn't work. Then I change powershell to cmd and it works :)

emojilearning avatar Apr 17 '23 16:04 emojilearning

Had the same issue, it's mostly related to Visual Studio not setting up environment variable during install. Before installing tiny-cuda-nn, in the same anaconda command prompt windows run vcvars64.bat (usually it's in C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build) which sets VC env vars correctly. Then proceed to install tiny-cuda-nn (with pip install git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch as described in the readme)

Thanks! It works for me !!

juneleung avatar Jun 06 '23 08:06 juneleung

@davidebaltieri31 thx, worked for me too!

murcje avatar Sep 07 '23 10:09 murcje

Thanks, this worked for me! I was getting the same error message about the "algorithm" file not being found.

@davidebaltieri31 Had the same issue, it's mostly related to Visual Studio not setting up environment variable during install. Before installing tiny-cuda-nn, in the same anaconda command prompt windows run vcvars64.bat (usually it's in C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build) which sets VC env vars correctly. Then proceed to install tiny-cuda-nn (with pip install git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch as described in the readme)

Also check of you have ninja installed somewhere, (in the command prompt use "where ninja" to check if you it can be found) it gave me problem with tiny-cuda-nn as it defaults to it if it's found, I removed it from my path and all was fine.

Just to make these steps clearer for others, to fix the issue:

  1. From INSIDE the activated conda environment, run the vcvars64.bat script to set up the environment variables. For example, I have activated my conda environment (nerfstudio) and then I run the .bat file from Visual Studio 2022, (nerfstudio) C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\Build>vcvars64.bat
  2. Now, the install should work! (nerfstudio) pip install git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch

Notes:

  • I'm using Windows. I'm not sure if this guidance applies to Linux.
  • The path to your vcvars64.bat file will depend on which version of Visual Studio you installed (e.g., either 2019 or 2022, either Community or Professional, etc.). So you may need to dig around to find the script. Check this link from Microsoft on where to find these scripts.
  • What does this .bat script even do? An explanation from Microsoft (source) ,

    To work correctly, the tools require several specific environment variables to be set. These variables are used to add the tools to the path, and to set the locations of include files, library files, and SDKs.

jackdaus avatar Dec 15 '23 17:12 jackdaus

Had the same issue, it's mostly related to Visual Studio not setting up environment variable during install. Before installing tiny-cuda-nn, in the same anaconda command prompt windows run vcvars64.bat (usually it's in C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build) which sets VC env vars correctly. Then proceed to install tiny-cuda-nn (with pip install git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch as described in the readme)

Also check of you have ninja installed somewhere, (in the command prompt use "where ninja" to check if you it can be found) it gave me problem with tiny-cuda-nn as it defaults to it if it's found, I removed it from my path and all was fine.

Note there is two program in anaconda, is "Anaconda Prompt " and "Anaconda PowerShell Prompt", powershell can't use bat file or I don't know how to use vcvars64.bat, so when I try no powershell Prompt, it works. PowerShell Prompt is use like ls cd linux commad , and Prompt us "dir" "cd" windows cmd.

caihua avatar Feb 27 '24 11:02 caihua

For anyone getting an error Cannot find corecrt.h after running the vcvars64 batch file, try

yoponchik avatar Apr 17 '24 02:04 yoponchik

if running vcvars64.bat don't work, you can try to run command directly in x64 Native Tools Command Prompt for VS 2019, it will automaticly setup corresponding envoronment :>

satoshiSchubert avatar Jul 11 '24 12:07 satoshiSchubert