Matab is very slow in processing figures: might it be caused by NVidia Optimus?

Hi all,
I have a laptop with the following configuration:
CPU: i7-11850H
RAM: 32GB
GPUs: Intel UHD graphics and NVIDIA RTX A2000
I notice that my laptos is pretty slow especially when managing figures. Indeed, by running bench command, the relative speed is 5.78 (this is the output of bench command 0.8408 0.3923 0.3292 0.6592 6.4034 7.0999) and my system lag hugely with respect the reference machines in 2-D and 3-D performance. When running bench command, the CPU usage peaked 18%. From this data, I believe that my system mostly run with Intel graphics rather on on my NVidia. Is that possible to verify which GPU card is running when Matlab is processing?
Thanks for your help.

 採用された回答

Joss Knight
Joss Knight 2024 年 6 月 16 日

0 投票

Check your laptop's power settings and make sure they are in 'best performance' mode.

1 件のコメント

Serbring
Serbring 2024 年 6 月 16 日
you on right, for reducing the fan noise and temperature, I reduced the max CPU load to 90%. I did it a year ago and I forgot this setting. Thanks!

サインインしてコメントする。

その他の回答 (1 件)

Ayush Singh
Ayush Singh 2024 年 6 月 11 日
Hi Serbring,
In order to see which GPU MATLAB is using you can run the following command:
gpuDevice
The 'gpuDevice' function is the primary way to obtain information about the GPU being used by MATLAB. When called without arguments, it returns an object containing information about the currently selected GPU.
For more information on above function, refer following documentation:

10 件のコメント

Serbring
Serbring 2024 年 6 月 11 日
Hi Ayush,
thanks for the message. From the output, it seems that NVidia GPU is running. A colleague of mine has the same laptop (with the same specification) and it is way more performant...
I do not understand why!
Can you try changing your graphics to Intel and then try the workflow by using following commnad:
% Based on the index of your GPU, you can run either statement
gpuDevice(2)
gpuDevice(1)
Serbring
Serbring 2024 年 6 月 12 日
I typed gpuDevice(2) but I got the following message:
Invalid CUDA device id: 2. Select a device id from the range 1:1.
Joss Knight
Joss Knight 2024 年 6 月 14 日
編集済み: Joss Knight 2024 年 6 月 14 日

Ayush, gpuDevice is about what GPU you are using for computation, not graphics. For that you can try opengl info.

Make sure that MATLAB is enabled for hardware acceleration in the NVIDIA Control Panel.

Hi Joss,
thanks. Below, you wiill find the output of opengl info.
Version: '1.1.0'
Vendor: 'Microsoft Corporation'
Renderer: 'GDI Generic'
MaxTextureSize: 1024
Visual: 'Visual 0x17e, (RGB 24 bits (8 8 8), Z depth 16 bits, Software, Single buffer, Antialias 0 samples)'
Software: 'true'
HardwareSupportLevel: 'none'
SupportsGraphicsSmoothing: 0
SupportsDepthPeelTransparency: 0
SupportsAlignVertexCenters: 0
Extensions: {3×1 cell}
MaxFrameBufferSize: 0
Through NVidia Control Panel, I have set "high performance NVidia card" . I have rebooted Matlab after having modified graphic card settings on NVidia Control Panel.
Cheers.
Joss Knight
Joss Knight 2024 年 6 月 15 日
And did it help?
Serbring
Serbring 2024 年 6 月 15 日
Well, I would have expected to see NVidia GPU card rather than a Microsoft device. So, I am wondering why I do not see any specification of one of the two physical GPUs.
Joss Knight
Joss Knight 2024 年 6 月 15 日
編集済み: Joss Knight 2024 年 6 月 15 日
So it still says this after you enabled hardware rendering in the control panel? "Software: 'true'" does imply you are using software rendering. If you type opengl hardware does it make any difference?
Are you certain your settings on the NVIDIA Control Panel have taken effect? Maybe send a screenshot of the control panel.
Also, of course, just confirm that your plots are still sluggish after the changes.
I have solved the issue by running the following
opengl hardware
From bench, I see a huge improvement 2D and 3D. What I still do not understand, is that my colleague using the same laptop (with the same hardware) obtains significant better results. However, he uses Matlab r2023a instead I use R2023b. Might it be such large difference between two Matlab versions?
Thanks again.
Joss Knight
Joss Knight 2024 年 6 月 16 日
This nothing to do with MATLAB, it is your operating system's graphics acceleration settings. You probably have different power settings than your colleague.

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeGraphics Performance についてさらに検索

製品

リリース

R2023b

タグ

質問済み:

2024 年 6 月 11 日

コメント済み:

2024 年 6 月 16 日

Community Treasure Hunt

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

Start Hunting!

Translated by