Cause of error "Caught "std::exception" Exception message is: basic_string::substr: __pos (which is 18446744073709551615) > this->size() (which is 52)"

I get the following error message when using 'arrayfun()' to evaluate a function on the gpu. (I have often used this command without this error)
Caught "std::exception" Exception message is:
basic_string::substr: __pos (which is 18446744073709551615) > this->size() (which is 52)
I cannot understand the cause. Any ideas?

6 Kommentare

that number is negative one in 64 bits, and probably indicates that an allocation failed such as if you ran out of gpu memory
This sounds like a bug, can you provide the code to reproduce this? Thanks.
Code follows, but it is rather complex. I will try and create a stripped back version tomorrow.
[Is being run on Matlab 2020b in Kubuntu 20.04.2 LTS, gpu is an Nvidia Quadro P4000.]
The code is 'ConesaKitaoKrueger2009'. You will need both the attached and also 'Value Function Iteration (VFI) Toolkit for Matlab' (https://au.mathworks.com/matlabcentral/fileexchange/53478-value-function-iteration-vfi-toolkit-for-matlab).
The actual problem occurs when trying to evaluate 'ConesaKitaoKrueger2009_ReturnFn' on gpu grid using arrayfun() in line 113 of 'CreateReturnFnMatrix_Case1_Disc_Par2.m'.
[Line 188 of ConesaKitaoKrueger2009 calls ValueFnIter_Case1_FHorz_PType line 78 of which calls ValueFnIter_Case1_FHorz line 243 of which calls ValueFnIter_Case1_FHorz_raw line 47 of which calls CreateReturnFnMatrix_Case1_Disc_Par2 line 113 of which makes the aforementioned call to arrayfun() which results in the error.]
I will try and find time tomorrow to create a simpler version of this that results in the same error (without all the intermediate functions).
PS. I have used the same arrayfun() call many times will this VFI Toolkit without any problems. The novel parts versus previous calls are the ConesaKitaoKrueger2009 and ConesaKitaoKrueger2009_ReturnFn scripts, plus some minor updates to ValueFnIter_Case1_FHorz_PType.
Attached is a shorter version of code that is enough to generate the error. I have attached the two scripts required. (No need for VFI Toolkit, I copy-pasted the minimum required lines.)
Not sure if it is relevant but when Matlab starts up it says "Warning: Name is nonexistent or not a directory: /tmp/Editor_xadmj "
Unfortunately I cannot reproduce this. You might have to capture the value of the variables used in the arrayfun call in a mat-file so I can be sure of getting the exact same numbers.
This isn't the first problem we've seen on Ubuntu 20. It might be worth downgrading your GPU driver to a 455 to see if that's the problem. You can start here to search for archived drivers for your GPU.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Produkte

Tags

Gefragt:

am 24 Mär. 2021

Kommentiert:

am 27 Mär. 2021

Community Treasure Hunt

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

Start Hunting!

Translated by