2020-12-03 Matlab --CUDNN_STATUS_EXECUTION_FAILED

Matlab -- Unexpected error calling cuDNN: CUDNN_STATUS_EXECUTION_FAILED.

转载自博主@她笑暖了冬天 的解决方案 MATLAB CUDNN_STATUS_EXECUTION_FAILED

环境:

  • Windows 10
  • Matlab2018b
  • gpuDevice: GeForce RTX 2080 Ti   (本人的为'GeForce RTX 2070'--'7.5'--ToolkitVersion: 9.1000)
  • nvcc --version: Cuda compilation tools, release 10.2, V10.2.89

用MATLAB  运行Deep Learning Toolbox Model报错,如下:

|========================================================================================|
|  Epoch  |  Iteration  |  Time Elapsed  |  Mini-batch  |  Mini-batch  |  Base Learning  |
|         |             |   (hh:mm:ss)   |   Accuracy   |     Loss     |      Rate       |
|========================================================================================|
Error using trainNetwork (line 150)
Unexpected error calling cuDNN: CUDNN_STATUS_EXECUTION_FAILED.

在控制台窗口console 输入 gpuDevice 查看主机GPU及CUD性能。

>> gpuDevice

ans = 

  CUDADevice with properties:

                      Name: 'GeForce RTX 2070'
                     Index: 1
         ComputeCapability: '7.5'
            SupportsDouble: 1
             DriverVersion: 11
            ToolkitVersion: 9.1000
        MaxThreadsPerBlock: 1024
          MaxShmemPerBlock: 49152
        MaxThreadBlockSize: [1024 1024 64]
               MaxGridSize: [2.1475e+09 65535 65535]
                 SIMDWidth: 32
               TotalMemory: 8.5899e+09
           AvailableMemory: 6.6741e+09
       MultiprocessorCount: 36
              ClockRateKHz: 1710000
               ComputeMode: 'Default'
      GPUOverlapsTransfers: 1
    KernelExecutionTimeout: 1
          CanMapHostMemory: 1
           DeviceSupported: 1
            DeviceSelected: 1

在主机CMD命令提示符窗口或Anaconda Prompt窗口输入>> nvcc --version

示例结果

C:\Users\pc>nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Sun_Jul_28_19:12:52_Pacific_Daylight_Time_2019
Cuda compilation tools, release 10.1, V10.1.243

解码办法一  在matlab中配置CUDA环境变量

操作:
点击:主页 -设置路径添加文件夹,选择下面两个路径Home--Set Path--Add Folder:
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\libnvvp
添加完成后点击保存。

解决办法二(玄学但是有用…)

在代码中随意添加一行:将0.0001存入GUP中,之后再重新运行net = trainNetwork( ),不会出现报错问题。即

ile=gpuArray(0.0001);

CCNnet=trainNetwork(x_train,y_train,mylayers,options);

参考链接 https://ww2.mathworks.cn/matlabcentral/answers/391368-cudnn-error-on-surface-book-2-when-running-cnn-example?s_tid=srchtitle

 

 

评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值