Why does gpuDevice crash Matlab?
12 views (last 30 days)
Show older comments
Hi,
I'm using gpuDevice(); in the begging of my code. Most of times, my Matlab crashes and I get the following logs:
MATLAB Log File: C:\Users\z585236\AppData\Local\Temp\matlab_crash_dump.16836-1
------------------------------------------------
MATLAB Log File
------------------------------------------------
--------------------------------------------------------------------------------
Invalid handle detected at 2023-03-30 13:34:39 +0200
--------------------------------------------------------------------------------
Configuration:
Crash Decoding : Disabled - No sandbox or build area path
Crash Mode : continue (default)
Default Encoding : UTF-8
Deployed : false
Graphics Driver : Uninitialized hardware
Graphics card 1 : NVIDIA ( 0x10de ) NVIDIA GeForce RTX 3050 Ti Laptop GPU Version 31.0.15.2206 (2022-9-27)
Graphics card 2 : Intel Corporation ( 0x8086 ) Intel(R) Iris(R) Xe Graphics Version 30.0.101.1631 (2022-3-3)
Java Version : Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
MATLAB Architecture : win64
MATLAB Entitlement ID : 668897
MATLAB Root : C:\Program Files\MATLAB\R2022a
MATLAB Version : 9.12.0.2039608 (R2022a) Update 5
OpenGL : hardware
Operating System : Microsoft Windows 10 Enterprise
Process ID : 16836
Processor ID : x86 Family 6 Model 154 Stepping 3, GenuineIntel
Session Key : ddaa5ca4-1fb4-4213-951a-8b78b08811bd
Window System : Version 10.0 (Build 19044)
Fault Count: 1
Abnormal termination:
Invalid handle
Current Thread: '' id 9712
Register State (from fault):
RAX = 0000000000000000 RBX = 0000000000000001
RCX = 0000000000000000 RDX = 0000000000000000
RSP = 000000c2ba1ff1b0 RBP = 0000000000000000
RSI = 0000000000000000 RDI = 0000000000000000
R8 = 0000000000000000 R9 = 0000000000000000
R10 = 0000000000000000 R11 = 0000000000000000
R12 = 0000000000000000 R13 = 000000c2c0334000
R14 = 0000022b1fbc5550 R15 = 0000000000000000
RIP = 00007ffa32032856 EFL = 00000206
CS = 0033 FS = 0053 GS = 002b
Stack Trace (from fault):
[ 0] 0x00007ffa32032856 C:\WINDOWS\SYSTEM32\ntdll.dll+01058902 RtlRaiseStatus+00000054
[ 1] 0x00007ffa31feebb8 C:\WINDOWS\SYSTEM32\ntdll.dll+00781240 memset+00109112
[ 2] 0x00007ffa31f5fcb4 C:\WINDOWS\SYSTEM32\ntdll.dll+00195764 RtlEnterCriticalSection+00000532
[ 3] 0x00007ffa31f5fae2 C:\WINDOWS\SYSTEM32\ntdll.dll+00195298 RtlEnterCriticalSection+00000066
[ 4] 0x00007ff996a0b8cf C:\Program Files (x86)\NVIDIA Corporation\Nsight Visual Studio Edition 2022.3\Monitor\Common\Injection64\Nvda.Cuda.Injection.dll+00440527
[ 5] 0x00007ff996b39bc8 C:\Program Files (x86)\NVIDIA Corporation\Nsight Visual Studio Edition 2022.3\Monitor\Common\Injection64\Nvda.Cuda.Injection.dll+01678280 InitializeInjection+00818200
[ 6] 0x00007ffa31117614 C:\WINDOWS\System32\KERNEL32.dll+00095764 BaseThreadInitThunk+00000020
[ 7] 0x00007ffa31f826a1 C:\WINDOWS\SYSTEM32\ntdll.dll+00337569 RtlUserThreadStart+00000033
Could you please help me with solving this issue?
Moein.
Accepted Answer
More Answers (1)
Animesh
on 4 Apr 2023
Hi,
gpuDevice() is a command in MATLAB that is used to initialize and select a GPU device for performing computations on a GPU. If your MATLAB crashes when you use gpuDevice(), it could be due to a number of reasons:
- Compatibility issues: gpuDevice() is not compatible with all versions of MATLAB or all GPUs. Make sure that you are using a version of MATLAB that supports gpuDevice() and that your GPU is supported by MATLAB.
- Memory allocation issues: GPUs have limited memory, and if you try to allocate more memory than what is available on the GPU, it can cause MATLAB to crash. Make sure that you are allocating the right amount of memory for your computations.
- Driver issues: Make sure that you have the latest GPU drivers installed on your system. Outdated drivers can cause compatibility issues with MATLAB and lead to crashes.
- Hardware issues: If your GPU is faulty or overheating, it can cause MATLAB to crash. Check your GPU's temperature and ensure that it is properly cooled.
To debug this issue, you can try the following:
- Run gpuDevice() with different MATLAB versions or on a different computer to see if the issue persists.
- Check the amount of memory you are allocating and try to reduce it.
- Check if there are any driver updates available for your GPU and install them.
- Monitor the temperature of your GPU and ensure that it is properly cooled.
See Also
Categories
Find more on GPU Computing 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!