Why do I get "Warning: Error occurred during graphics initialization" after upgrading to MATLAB R2024b and later?
11 views (last 30 days)
Show older comments
MathWorks Support Team
on 14 Oct 2025
Answered: MathWorks Support Team
on 17 Oct 2025
I just upgraded to MATLAB R2025a. After installation, I received the following warning related to graphics and "hgrc.m":
Warning: Can't find the resource file 'toolbox/matlab/graphics/core/hg/hgrc.m' needed by 'C:\Program Files\MATLAB\R2025a\bin\win64\hg.dll'
Warning: Error occurred during graphics initialization
Why do I get this graphics initialization warning?
Accepted Answer
MathWorks Support Team
on 19 Nov 2025 at 0:00
This warning may be related to mismatches in the MATLAB Search Path when upgrading from previous releases to MATLAB R2024b and later. To resolve this warning, refer to How can I perform initial troubleshooting of MATLAB or Simulink errors?. This page provides instructions on how to restore the default MATLAB path and rehash the toolbox cache.
If the steps at the above link don't work, please provide the following information to MathWorks Technical Support:
1) Obtain the path to "hgrc.m" by running the following command in the MATLAB Command Window:
which -all hgrc
2) Obtain a copy of the "startup.m" file if one exists. You can find the path to this file using the following command in the MATLAB Command Window:
which -all startup
0 Comments
More Answers (0)
See Also
Categories
Find more on Introduction to Installation and Licensing 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!