I am just wondering how I find GPU version/info in MATLAB. Is there a MATLAB function doing so? Thanks a lot.

 채택된 답변

Thomas
Thomas 2012년 6월 22일

3 개 추천

Use the function gpuDevice.
gpuDevice
If you do not have a cuda enabled GPU device the function will throw an error.

댓글 수: 6

Nick Tsui
Nick Tsui 2012년 6월 22일
hi Thomas:
Thanks a lot. That is exactly what I needed.
Jason Ross
Jason Ross 2012년 6월 22일
Other assumptions:
- CUDA driver needs to be installed
- GPU needs to support compute capability 1.3 or better (http://developer.nvidia.com/cuda-gpus)
- On Windows, special care must be taken when using Remote Desktop so the GPU can be found.
Abdelrahman Anis
Abdelrahman Anis 2021년 7월 16일
May you please elaborate more on the special care that must be taken when accessing the system remotely? Thank you!
I am accessing a version of MATLAB R2020a, installed in a linux OS, remotely from a Windows OS using MobaXterm. I get an error when I try to access the GPU information using the command gpuDevice. The CUDA drivers are installed because Pytorch is working properly. In such case, I think the third reason is the last reason left.
Jason Ross
Jason Ross 2021년 7월 19일
@Abdelrahman Anis -- the "special care" that I was specifically referring to was that in 2012, nVidia did not have great support for their cards being usable/finadble when using Remote Desktop -- it was pretty restricive and you had to use something like VNC in many cases. At some point between 2012 and today, nVidia added support for Remote Desktop across their product line so there's not really as much "special care" needed any longer. Note that this was for the specific case of the remote machine being Windows.
For Linux, if you connect to a host and an nvidia-smi shows your GPU, a MATLAB running on that system should be able to find the GPU. It should work if you start it in console/nodesktop mode (which I assume you are doing with MobaXTerm), or if you start a VNC session on the Linux host and start MATLAB in the VNC session.
Abdelrahman Anis
Abdelrahman Anis 2021년 7월 20일
@Jason Ross Thank you!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Get Started with GPU Coder에 대해 자세히 알아보기

태그

질문:

2012년 6월 22일

댓글:

2021년 7월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by