Skip to content

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

@mat46ias

Description

@mat46ias
  • OpenCV => 4.3.0
  • Operating System / Platform => Windows 64 Bit
  • Compiler => Visual Studio 2019
Detailed description

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

https://jamesbowley.co.uk/accelerate-opencv-4-3-0-build-with-cuda-and-python-bindings/?unapproved=22839&moderation-hash=3a2ab3aba913aa8519aaf53a0a431bf0#comment-22839

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...

Metadata

Metadata

Assignees

No one assigned

    Labels

    category: gpu/cuda (contrib)OpenCV 4.0+: moved to opencv_contribquestion (invalid tracker)ask questions and other "no action" items here: https://forum.opencv.org

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions