From 5bfe504de1d4561a40eda3aa7ecbd2fa5024caf3 Mon Sep 17 00:00:00 2001 From: nagadomi Date: Fri, 6 May 2016 02:20:54 +0900 Subject: [PATCH] Add error message when the CUDA module loading fails --- lib/w2nn.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/w2nn.lua b/lib/w2nn.lua index aa3d4cb..d6ea141 100644 --- a/lib/w2nn.lua +++ b/lib/w2nn.lua @@ -13,7 +13,10 @@ end if w2nn then return w2nn else - pcall(load_cunn) + local state, ret = pcall(load_cunn) + if not state then + error("Failed to load CUDA modules. Please check the CUDA Settings.") + end pcall(load_cudnn) w2nn = {} require 'LeakyReLU'