Error using gpuDevice call

2 views (last 30 days)
Richard Nunziata
Richard Nunziata on 2 Jan 2018
Edited: Joss Knight on 16 Jan 2018
I am trying to run vl_testnn for gpu in matconvnet ...I get CUDA error if I try to access the device using gpuDevice I get the same error below. There is nothing wrong with my installation as I run other project using tensorflow, cafe and others that use the gpu and cudnn just fine. This seem to be only happening for matlab. Any ideas on how to resolve? I am on a nivida gpu under ubuntu16.
gpuDevice(1)
Error using gpuDevice (line 26)
An unexpected error occurred during CUDA execution. The CUDA error was:
CUDA_ERROR_UNKNOWN
  11 Comments
Petter Stefansson
Petter Stefansson on 14 Jan 2018
Yes I can confirm that Matlab R2017a does not support CUDA 9. As soon as you install it and attempt to compile something you get the following warning:
Warning: Version 8.0 of the CUDA toolkit could not be found.
No supported compiler or SDK was found
So Matlab 2017a explicitly says in its warning messages that it needs toolkit 8.0
Joss Knight
Joss Knight on 16 Jan 2018
Edited: Joss Knight on 16 Jan 2018
There is a lot of confusion here, understandably, so it's worth being clear.
Applications like MATLAB are built with a version of the CUDA compiler and libraries that comes with the CUDA toolkit. These applications (if built correctly) are forward compatible to any future CUDA architecture using the JIT compilation pipeline through the driver. This pipeline has its limitations - the one-off compilation takes time and the resulting binaries may not be well optimised. MATLAB ships all those libraries in its installation so if you install a new CUDA toolkit it makes no difference to MATLAB, only to the things you compile with it.
New device architectures require new drivers that are themselves labelled with a new version of the CUDA toolkit, because they are built using it. This is what people mean when they say a card 'requires' a particular CUDA version, they mean the driver, not the toolkit. These drivers work with older cards and with applications built with older CUDA toolkits. Occasionally, there are problems with the forward/backward compatibility. For instance, the cuDNN library has twice failed to support new device architectures. These problems are bugs - the expected behaviour is that a version of MATLAB will work with any new card as long as you have up-to-date drivers.
Where future versions of the CUDA toolkit are not supported is for compiling MEX functions, that is all. And even that is just a precaution to avoid binary incompatibilities. In fact I have several times posted here the workaround that allows you to compile MEX functions using a different toolkit from the one MATLAB was built with. Sometimes it's useful if a new toolkit brings support for your latest host compiler.
Anywhere where someone has explicitly posted in this forum that MATLAB doesn't yet support some future CUDA version, then either they are mistaken, or they are referring to a bug. It's not even particularly meaningful because it's new cards that sometimes have limitations due to not being properly supported by the JIT pipeline, not new 'CUDA versions' (which come with drivers, and with applications like MATLAB, not with cards). The most honest thing to say would be to say a new GPU architecture (not CUDA version) is not fully supported.
Case in point, here is me using a Pascal GPU in R2016a:
< M A T L A B (R) >
Copyright 1984-2016 The MathWorks, Inc.
R2016a (9.0.0.341360) 64-bit (glnxa64)
February 11, 2016
>> gpuDevice
ans =
CUDADevice with properties:
Name: 'TITAN Xp'
Index: 1
ComputeCapability: '6.1'
SupportsDouble: 1
DriverVersion: 9
ToolkitVersion: 7.5000
MaxThreadsPerBlock: 1024
MaxShmemPerBlock: 49152
MaxThreadBlockSize: [1024 1024 64]
MaxGridSize: [2.1475e+09 65535 65535]
SIMDWidth: 32
TotalMemory: 1.2782e+10
AvailableMemory: 1.2546e+10
MultiprocessorCount: 30
ClockRateKHz: 1582000
ComputeMode: 'Default'
GPUOverlapsTransfers: 1
KernelExecutionTimeout: 0
CanMapHostMemory: 1
DeviceSupported: 1
DeviceSelected: 1
>> gpuArray.rand(5) * gpuArray.rand(5,1)
ans =
1.5732
2.0223
3.2198
2.0951
1.4465

Sign in to comment.

Answers (0)

Categories

Find more on Performance in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!