From 792500bd1b259f0e8013055a5a5462ff3ff0cd76 Mon Sep 17 00:00:00 2001 From: Piero Toffanin Date: Wed, 24 Nov 2021 11:26:03 -0500 Subject: [PATCH] Use dummy CUDA DLL --- SuperBuild/cmake/External-OpenMVS.cmake | 10 ++++++---- opendm/gpu.py | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/SuperBuild/cmake/External-OpenMVS.cmake b/SuperBuild/cmake/External-OpenMVS.cmake index dd42604b..80b4585a 100644 --- a/SuperBuild/cmake/External-OpenMVS.cmake +++ b/SuperBuild/cmake/External-OpenMVS.cmake @@ -36,10 +36,12 @@ if(UNIX) endif() if(WIN32) - SET(NVDRIVER "$ENV{SystemRoot}\\System32\\nvcuda.dll") - if (EXISTS ${NVDRIVER}) - file(COPY ${NVDRIVER} DESTINATION "${SB_INSTALL_DIR}/bin") - endif() + # On Windows systems without NVIDIA GPUs, OpenMVS will not launch + # unless a CUDA DLL is available; we download a dummy DLL + # generated with https://github.com/ykhwong/dummy-dll-generator that is + # loaded UNLESS the real CUDA DLL is available, since it will + # be loaded before our dummy DLL. + file(DOWNLOAD "https://github.com/OpenDroneMap/windows-deps/releases/download/2.5.0/nvcuda_dummy.dll" "${SB_INSTALL_DIR}/bin/nvcuda.dll") endif() ExternalProject_Add(${_proj_name} diff --git a/opendm/gpu.py b/opendm/gpu.py index 81014fcd..53f7d1a9 100644 --- a/opendm/gpu.py +++ b/opendm/gpu.py @@ -1,4 +1,5 @@ import os +import sys from opendm import log from repoze.lru import lru_cache