فهرست منبع

Add error message when the CUDA module loading fails

nagadomi 9 سال پیش
والد
کامیت
5bfe504de1
1فایلهای تغییر یافته به همراه4 افزوده شده و 1 حذف شده
  1. 4 1
      lib/w2nn.lua

+ 4 - 1
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'