title: nvcc fatal : Could not open output file
body: <p>I use pytorch to object detection algorithms on windows:</p>
  
  <p>When I run <code>ext/build.py build_ext develop</code> script
  from <a href="https://github.com/lufficc/SSD" rel="nofollow noreferrer">https://github.com/lufficc/SSD</a> repository
  or when I run <code>python support/setup.py develop</code>
  from <a href="https://github.com/potterhsu/easy-faster-rcnn.pytorch" rel="nofollow noreferrer">https://github.com/potterhsu/easy-faster-rcnn.pytorch</a> repository</p>
  
  <pre><code>import glob
  import os
  
  import torch
  from setuptools import setup
  from torch.utils.cpp_extension import CUDA_HOME
  from torch.utils.cpp_extension import CppExtension
  from torch.utils.cpp_extension import CUDAExtension
  
  requirements = ["torch", "torchvision"]
  
  
  def get_extensions():
      this_dir = os.path.dirname(os.path.abspath(__file__))
      extensions_dir = os.path.join(this_dir, "src")
  
      main_file = glob.glob(os.path.join(extensions_dir, "*.cpp"))
      source_cpu = glob.glob(os.path.join(extensions_dir, "cpu", "*.cpp"))
      source_cuda = glob.glob(os.path.join(extensions_dir, "cuda", "*.cu"))
  
      sources = main_file + source_cpu
      extension = CppExtension
  
      extra_compile_args = {"cxx": []}
      define_macros = []
  
      if torch.cuda.is_available() and CUDA_HOME is not None:
          extension = CUDAExtension
          sources += source_cuda
          define_macros += [("WITH_CUDA", None)]
          extra_compile_args["nvcc"] = [
              "-DCUDA_HAS_FP16=1",
              "-D__CUDA_NO_HALF_OPERATORS__",
              "-D__CUDA_NO_HALF_CONVERSIONS__",
              "-D__CUDA_NO_HALF2_OPERATORS__",
          ]
  
      sources = [os.path.join(extensions_dir, s) for s in sources]
  
      include_dirs = [extensions_dir]
  
      ext_modules = [
          extension(
              "support._C",
              sources,
              include_dirs=include_dirs,
              define_macros=define_macros,
              extra_compile_args=extra_compile_args,
          )
      ]
  
      return ext_modules
  
  
  setup(
      name="support",
      version="0.1",
      ext_modules=get_extensions(),
      cmdclass={"build_ext": torch.utils.cpp_extension.BuildExtension},
  )
  </code></pre>
  
  <p>I get the same error:</p>
  
  <blockquote>
    <p>C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin\nvcc.exe
    -c C:\Users\along\PycharmProjects\SSD\ext\cuda\nms.cu -o build\temp.win-amd64-3.7\Release\Users\along\PycharmProjects\SSD\ext\cuda\nms.obj
    -IC:\Users\along\PycharmProjects\SSD\ext -IC:\Users\along\Anaconda3\lib\site-packages\torch\include -IC:\Users\along\Anaconda3\lib\site-packages\torch\include\torch\csrc\api\include
    -IC:\Users\along\Anaconda3\lib\site-packages\torch\include\TH -IC:\Users\along\Anaconda3\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\include"
    -IC:\Users\along\Anaconda3\include -IC:\Users\along\Anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual
    Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\include"
    "-IC:\Program Files (x86)\Microsoft Visual
    Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include" "-IC:\Program
    Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program
    Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" "-IC:\Program
    Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program
    Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" "-IC:\Program
    Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt" -Xcompiler
    /EHsc -Xcompiler /wd4819 -Xcompiler /MD -D__CUDA_NO_HALF_OPERATORS__
    -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -DCUDA_HAS_FP16=1 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=torch_extension -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_75,code=sm_75 nvcc fatal   : Could not open output file 'along\AppData\Local\Temp/tmpxft_00005b70_00000000' error:
    command 'C:\Program Files\NVIDIA GPU Computing
    Toolkit\CUDA\v10.2\bin\nvcc.exe' failed with exit status 1</p>
  </blockquote>
  
  <p>I don't know what is the error, I have a GPU device on the computer</p>
  
  <p>I think that the problem is on CMakeLists.txt file on Anaconda3\pkgs\pytorch-1.3.1-py3.7_cuda92_cudnn7_0\info\test\test\custom_operator directory:</p>
  
  <pre><code># Basic CMake setup
  cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
  project(custom_ops)
  
  find_package(Torch REQUIRED)
  
  add_library(custom_ops SHARED op.cpp)
  
  add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../third_party/pybind11/ ./pybind11)
  pybind11_add_module(custom_class SHARED classes.cpp)
  target_link_libraries(custom_class PRIVATE "${TORCH_LIBRARIES}")
  
  target_compile_features(custom_ops PUBLIC cxx_range_for)
  target_link_libraries(custom_ops "${TORCH_LIBRARIES}")
  target_compile_definitions(custom_ops PRIVATE custom_ops_EXPORTS)
  
  add_executable(test_custom_ops test_custom_ops.cpp)
  target_link_libraries(test_custom_ops custom_ops)
  </code></pre>