Library not loaded: @rpath/lib​cudart.10.​2.dylib

I've recently been getting the following error when trying to run "bwlabel.m". Trying to run code that had been working as recently as a month ago. Any advice would be appreciated.
Running Matlab 2020b on Mac OS 10.15.7.
%%
Unable to load bundle binary
/Applications/MATLAB_R2020b.app/bin/maci64/builtins/images_builtins/mwlibmwimagescore_builtinimpl.dylib. Error:
dlopen(/Applications/MATLAB_R2020b.app/bin/maci64/builtins/images_builtins/mwlibmwimagescore_builtinimpl.dylib, 10):
Library not loaded: @rpath/libcudart.10.2.dylib
Referenced from: /Applications/MATLAB_R2020b.app/bin/maci64/libopencv_core.4.2.0.dylib
Reason: no suitable image found. Did find:
/Applications/MATLAB_R2020b.app/bin/maci64/libcudart.10.2.dylib: code signature invalid for
'/Applications/MATLAB_R2020b.app/bin/maci64/libcudart.10.2.dylib'

11 commentaires

I'd call tech support on that one. If you can't or won't, then I'd try to reinstall MATLAB. Or you can try
restoredefaultpath
sometimes that fixes weird problems.
https://stackoverflow.com/questions/41865537/how-does-apples-codesign-utility-decide-which-sha-algorithms-to-sign-a-shared maybe??
Luke Mason
Luke Mason le 7 Juin 2022
I'm also having this problem, also 10.15.7. I'll edit this post if I find a solution.
Chenyi Fei
Chenyi Fei le 7 Juin 2022
I got the same problem. I'm running Matlab 2020a on Mac OS 10.15.6
Cata_Ray
Cata_Ray le 7 Juin 2022
Same problem in Mojave with 2020a. 2018 working correctly.
same problem in Monterey 12.4 and Matlab 2019b
Same problem Catalina 10.15.6, MATLAB R2020a
Pierre Lanari
Pierre Lanari le 8 Juin 2022
Modifié(e) : Pierre Lanari le 8 Juin 2022
Same problem with Catalina 10.15.7 and MATLAB R2020b or R2020a. I contacted the tech support and they don't have a solution yet.
Hi evereryone, I am having the same issue and I had spent around 4 days already tryin to find a way around this. From a collegue I got that maybe the reason is the most recent Apple security updates are listed here
These updates are probably what did it. Gatekeeper is what is making the decision that the library is not safe.
The affected operating systems are Catalina, BigSur. Monterrey as of May 16 2022.
I tried to use some of the old suggestions from:
and declaring the DYLD_LIBRARY_PATH as suggested here:
Also, I tried some of the don'ts for Mac
So far no success.
If anyone finds a way around this I am really interested on learning how to Fix it.
Thanks everyone.
Graham Fraser
Graham Fraser le 8 Juin 2022
Modifié(e) : Graham Fraser le 8 Juin 2022
I was able to work around this problem on Mojave (10.14.4) by copying:
/Applications/MATLAB_R2020a.app/bin/maci64/libcudart.10.1.dylib
to:
/usr/lib
Delete and reinstall MATLAB, Reboot, and bwlabel should work again.
This workaround doesn't seem to work on Catalina and above because root cannot modify /usr/lib. Disabling SIP protection may get around this but so far I haven't been able to get my solution to work even with SIP disabled.
Hope this helps get us closer to a permanent solution.
雨鑫 史
雨鑫 史 le 5 Juil 2022
I have the same problemi

Connectez-vous pour commenter.

 Réponse acceptée

MathWorks Support Team
MathWorks Support Team le 22 Juin 2022

0 votes

This error is documented here:
Please refer to the Bug Report for details concerning this issue and its resolution. You may also "Follow" the Bug Report to be notified of future updates regarding this issue.

3 commentaires

Tyler Cumby
Tyler Cumby le 22 Juin 2022
Since older releases will not be fixed, can you augment the error report to link to this MATLAB Answers post? That way, those that cannot upgrade are more likely to find the fix developed in this post.
The workarounds described below are not validated by MathWorks and may result in unintended consequences with our products. As such, these are not recommended. If you are not able to follow the instructions in the Bug Report, please contact MathWorks Technical Support and share your workflow.
Yuval Vardi
Yuval Vardi le 22 Juin 2022
The instructions in the Bug Report only ask to update to Matlab 2021a. What should we do if we cannot update the matlab version?

Connectez-vous pour commenter.

Plus de réponses (5)

guitalele
guitalele le 13 Juin 2022
Modifié(e) : guitalele le 22 Juin 2022

6 votes

For other mac users who don't want to update MATLAB and don't have access to /usr/lib: I found that copying the library to /usr/local/lib did the trick, provided I also added an 'ad-hoc' code signature, eg:
sudo cp /Applications/MATLAB_R2020b.app/bin/maci64/libcudart.10.2.dylib /usr/local/lib
sudo codesign --deep -fs - /usr/local/lib/libcudart.10.2.dylib
Tested on:
  • R2020b on Big Sur (11.6.6)
  • R2019b on Mojave (10.14.6) - note libcudart version is different: libcudart.10.1.dylib
Note that this solution is just based on previous answers (https://uk.mathworks.com/matlabcentral/answers/1735020-library-not-loaded-rpath-libcudart-10-2-dylib#answer_982300 + https://uk.mathworks.com/matlabcentral/answers/403742-invalid-mex-file-and-missing-libmwblas-dylib-error#comment_1506540 ) + google + trial and error. I have no expertise in macOS code signing and would welcome thoughts from Mathworks or others on whether this is a sensible thing to do.
---
Update 22nd June: As pointed out by @Tyler Cumby in the discussion below, there is no need to move the file to /usr/local/lib - you can just run the codesign command directly on the relevant file

14 commentaires

guitalele
guitalele le 13 Juin 2022
@Graham Fraser @Pierre Lanari - tagging you in case it helps on Catalina
Daniel Dahan
Daniel Dahan le 13 Juin 2022
It is working for me. Thanks!
Tyler Cumby
Tyler Cumby le 13 Juin 2022
Modifié(e) : Tyler Cumby le 13 Juin 2022
This also an issue in the 2020b MATLAB Runtime as well. If you check the code-signature via a bash shell
codesign --verbose --verify /Applications/MATLAB/MATLAB_Runtime/v99/bin/maci64/libcudart.10.2.dylib
returns
/Applications/MATLAB/MATLAB_Runtime/v99/bin/maci64/libcudart.10.2.dylib: CSSMERR_TP_CERT_REVOKED
In architecture: x86_64
So the code-signature for the file is not valid, which is prohibited by the Gatekeeper on recent macOS versions (I'm on Mojave and it prohibits dynamic loading of this library).
It is sufficient to code-sign the file 'in place', i.e. you don't need to move the file to /usr/local/lib. If you leave it in place, the dynamic loading will follow the @rpath path expansion, as intended by Mathworks.
guitalele
guitalele le 14 Juin 2022
Modifié(e) : guitalele le 14 Juin 2022
Thanks @Tyler Cumby, that clarifies things. I googled CSSMERR_TP_CERT_REVOKED and found some useful backround eg: https://eclecticlight.co/2020/10/28/code-signatures-1-how-they-work-and-stop-working/. In particular:
"At least on Macs running Mojave and later, notifications of certificate revocations are obtained by the background process com.apple.security.syspolicy.check.revocation which is normally set to run every three days. It also appears able to pick up changes more frequently, but isn’t something the user can control."
Initially I assumed a macOS update had tightened security (hence the sudden appearence of the issue), but looking at the update history on multiple affected machines I couldn't find a common recent secuirty update that could explain this.
It sounds like maybe it's more likely that the certicficate has been revoked and the issue appeared when apple pushed out the latest revocations.
Tested with Matlab R2020b on Mojave 10.14.16 and did the trick !
Thank you for this one.
Tyler Cumby
Tyler Cumby le 14 Juin 2022
@guitalele Well done. I think you're probably right. Debugging issues in macOS are always more complicated because of how (intentionally?) opaque Gatekeeper is when you violate one of its requirements (and somehow I still forget this). Initiially when I was looking into this I was checking dyld debug output to see if there was an errant /imcompatible library getting loaded and was thrown off by rpath expansion failures. otool -L was not reporting any missing symbols and then wondered about code-signing issues (clearly the wrong order for debugging, in retrospect).
Tyler Cumby
Tyler Cumby le 14 Juin 2022
@guitalele On a whim, I tried to install the 10.2 Cuda RT on my Mojave macbook, but the code-signing cert for the installer has been revoked as well. So, I guess NVidia's cert was revoked in the recent past?
guitalele
guitalele le 15 Juin 2022
Good spot @Tyler Cumby - sounds like you're right. Apparently NVIDEA got hacked recently, eg: https://www.tonymacx86.com/threads/nvidia-driver-certificate-revoked.320596/post-2324115
Tyler Cumby
Tyler Cumby le 15 Juin 2022
@guitalele I've reported this to Mathworks Support.
It worked on Mac Mojave 10.14.6 and Matlab R2019b
Thanks
Runnan Cao
Runnan Cao le 21 Juin 2022
This solution works for macOS Catalina 10.15.7!!!
Thank you so much for sharing!
This solution works for me on macOS Catalina as well.
Thank you so much!
Jessica Zhao
Jessica Zhao le 28 Juin 2022
Works for me on macOS Monterey 12.4 for MATLAB R2020a too! Thank you!
It's work for me on macOS Big Sur 11.6. Thank you!

Connectez-vous pour commenter.

Bhavana Ravirala
Bhavana Ravirala le 9 Juin 2022

0 votes

Hi Nitin,
Go through the following link which helps in eliminating the error.
Hope this helps.

1 commentaire

Thanks for the suggestion.
As I don't have access to /usr/lib/ on Catalina, I have tried moving the library to my working directory (and various other locations in the MATLAB path).
I can find the library with the command:
which libcudart.10.2.dylib
However, this does not eliminate the error for me.

Connectez-vous pour commenter.

Naveh Levanon
Naveh Levanon le 9 Juin 2022

0 votes

I had this problem now too in R2020b.
I installed R2021a fresh and the problem is gone. Others say re-installing R2021b works too. Possibly any re-install would fix this.

4 commentaires

Daniel Dahan
Daniel Dahan le 9 Juin 2022
Modifié(e) : Daniel Dahan le 9 Juin 2022
I have this problem in 2019b, and re-installing it did not solve the problem for me. However, 2022a works for me.
Based on the comments here I think the problem is up to 2020 versions.
I had the same problem (MacOs Catalina 10.15.7, R2020b) and installing R2021a worked to fix it, thank you for the tip!
A fresh installation of R2021a did not solve the problem for me.
Joss Knight
Joss Knight le 13 Juin 2022
Hi Pierre. MATLAB does not ship the offending library (libcudart) in R2021a so I'd be interested for you to elaborate more to help us work out what's going wrong for you. Perhaps you are running a MEX function?

Connectez-vous pour commenter.

Abbas Ezzat
Abbas Ezzat le 11 Juin 2022

0 votes

How can i run polymeric composite formulations to optimize selction criteria

1 commentaire

I do not understand the relationship to the libcudart question?

Connectez-vous pour commenter.

Joss Knight
Joss Knight le 4 Juil 2022

0 votes

This problem should now be fixed at Apple, please reboot and report here if you are still experiencing issues.

Catégories

En savoir plus sur Creating, Deleting, and Querying Graphics Objects dans Centre d'aide et File Exchange

Produits

Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by