How can I stop Matlab from using dedicated GPU in laptop?

68 views (last 30 days)
I can't stop Matlab from using my dGPU even after I've set Nvidia's program to use "Integrated Graphics". I was thinking that Matlab enables the Nvidia chip anyway, because it has CUDA support?
Setup: Matlab 2015a, Win7 x64, Intel HD4600 + Nvidia GTX970M
Regards Martin
  1 Comment
Walter Roberson
Walter Roberson on 14 Jan 2017
Are you using any of the gpu functions such as gpuArray() ? Those can only be executed on the NVIDIA; there is no GPU support for any other manufacturer.

Sign in to comment.

Answers (2)

TJ Smith
TJ Smith on 7 Jan 2018
You can turn off the GPU with this code:
gpuDevice([]);
I found this on this page: https://www.mathworks.com/help/distcomp/gpudevice.html which described it as:
gpuDevice([]), with an empty argument (as opposed to no argument), deselects the GPU device and clears its memory of gpuArray and CUDAKernel variables. This leaves no GPU device selected as the current device.

Adam
Adam on 21 Apr 2015
doc gpuDevice
You should be able to get a list of GPU devices with
g = gpuDevice;
Then select a particular device from that list by its index:
D = gpuDevice(idx)
  5 Comments
Yetti
Yetti on 13 Jan 2017
Also, on a microsoft Surface Book, the dGPU is in the keyboard base. Detaching the screen requires quiting matlab when matlab grabs the dGPU automatically.
Kenz Dale
Kenz Dale on 18 Jan 2018
Frustratingly, this command is only available if you have the Parallel Computing Toolbox. So I can't detach my Surface Book 2's screen unless I quit Matlab. This is bonkers, as one of the primary reasons I moved from macOS to Windows was to leverage the awesome power of the Surface Book.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!