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