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())