Fix "nvcc fatal : Could not set up the environment for Microsoft Visual Studio"

asked 2020-05-31 22:11:16 -0500

Hi! I'm trying to buil OpenCV from source with CUDA v10.2. I'm following the steps from this website:

https://jamesbowley.co.uk/accelerate-...

When I reach the part of building the solution I get the following error:

Building NVCC (Device) object modules/world/CMakeFiles/cuda_compile_1.dir/__/core/src/cuda/Release/cuda_compile_1_gen erated_gpu_mat.cu.obj

nvcc fatal : Could not set up the environment for Microsoft Visual Studio using C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/../../../../../../../VC/Auxiliary/Build/vcvars64.bat

CMake Error at cuda_compile_1_generated_gpu_mat.cu.obj.Release.cmake:220 (message): Error generating D:/OpenCV/opencv-4.3.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__/core/src/cuda/Release/cuda_compile_1_ge nerated_gpu_mat.cu.obj

I really don't know how to fix this...

I'm using:

  1. CUDA v10.2
  2. OpenCV => 4.3.0
  3. Operating System => Windows 64
  4. Bit Compiler => Visual Studio 2019
edit retag flag offensive close merge delete