From 6c7ee29f3d3f123b5fef16da122da681a9053457 Mon Sep 17 00:00:00 2001 From: lltcggie Date: Sat, 7 May 2016 17:25:24 +0900 Subject: [PATCH] =?UTF-8?q?GUI=E3=81=A7Compute=20Capability=202.0=E4=BB=A5?= =?UTF-8?q?=E4=B8=8A=E3=81=8B=E3=81=AE=E3=83=81=E3=82=A7=E3=83=83=E3=82=AF?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/waifu2x.cpp | 9 ++++++++- common/waifu2x.h | 1 + waifu2x-caffe-gui/MainDialog.cpp | 3 +++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/common/waifu2x.cpp b/common/waifu2x.cpp index 6580f58..9b8966a 100644 --- a/common/waifu2x.cpp +++ b/common/waifu2x.cpp @@ -406,7 +406,14 @@ Waifu2x::eWaifu2xCudaError Waifu2x::can_use_CUDA() if (cudaRuntimeGetVersion(&runtimeVersion) == cudaSuccess) { if (runtimeVersion >= MinCudaDriverVersion && driverVersion >= runtimeVersion) - CudaFlag = eWaifu2xCudaError_OK; + { + cudaDeviceProp prop; + cudaGetDeviceProperties(&prop, 0); + if (prop.major >= 2) + CudaFlag = eWaifu2xCudaError_OK; + else + CudaFlag = eWaifu2xCudaError_OldDevice; + } else CudaFlag = eWaifu2xCudaError_OldVersion; } diff --git a/common/waifu2x.h b/common/waifu2x.h index aaff306..d45ecdf 100644 --- a/common/waifu2x.h +++ b/common/waifu2x.h @@ -46,6 +46,7 @@ public: eWaifu2xCudaError_OK = 0, eWaifu2xCudaError_NotFind, eWaifu2xCudaError_OldVersion, + eWaifu2xCudaError_OldDevice, }; enum eWaifu2xcuDNNError diff --git a/waifu2x-caffe-gui/MainDialog.cpp b/waifu2x-caffe-gui/MainDialog.cpp index ab14c3d..960fba0 100644 --- a/waifu2x-caffe-gui/MainDialog.cpp +++ b/waifu2x-caffe-gui/MainDialog.cpp @@ -2325,6 +2325,9 @@ void DialogEvent::CheckCUDNN(HWND hWnd, WPARAM wParam, LPARAM lParam, LPVOID lpD case Waifu2x::eWaifu2xCudaError_OldVersion: MessageBox(dh, langStringList.GetString(L"MessageCudaOldVersionError").c_str(), langStringList.GetString(L"MessageTitleResult").c_str(), MB_OK | MB_ICONERROR); return; + case Waifu2x::eWaifu2xCudaError_OldDevice: + MessageBox(dh, langStringList.GetString(L"MessageCudaOldDeviceError").c_str(), langStringList.GetString(L"MessageTitleResult").c_str(), MB_OK | MB_ICONERROR); + return; } switch (Waifu2x::can_use_cuDNN())