MATLAB: cannot open shared object file: No such file or directory

  c++, cuda, matlab, mex, ubuntu

I’ve been using a MATLAB program to perform some gridding for the past couple days and all of a sudden it stopped working and started giving the following error message:

Invalid MEX-file '/home/user/ReconCode/gpuNUFFT-master/gpuNUFFT/@gpuNUFFT/private/mex_gpuNUFFT_precomp_f.mexa64': cannot open shared object file: No such file or directory.

Error in gpuNUFFT (line 104)
[res.op.dataIndices,res.op.sectorDataCount,res.op.densSorted,res.op.coords,res.op.sectorCenters,res.op.sectorProcessingOrder,res.op.deapoFunction] =

Error in MCNUFFT_GPU_indv (line 23){tt} = gpuNUFFT([real(col(kk)), imag(col(kk))]',(col(ww)),over_sample,Grid_kern,Region,[Nd],[]);

Error in rtPC_timeAverage_v2_GPU (line 30)

Error in Coil_unstreaking_rtCine_v2 (line 4)
    [rt_Cine_Streak] =  rtPC_timeAverage_v2_GPU(kdata_ref(:,:,1:Ns,:),5,1,frames_keep);

Error in rtCine_GPU_recon_frames_unStreak (line 49)
            Coil1 = Coil_unstreaking_rtCine_v2(Coil1,4,8,frames_keep);

Error in MainScript_SAX (line 27)
[recon_cs_TV,recon_nufft,time_PreProcessing,time_CS] = rtCine_GPU_recon_frames_unStreak(filename,foldernameSave,filenameSave,nspokes_use,loadType,frames_keep,N,mod_switch,Lp,str_start,str_end);

Based on my research this seems to be a CUDA related issue which makes sense since this program uses the GPU to perform accelerated calculations. What I can’t understand is what suddenly caused it to stop working.

The code base I’m using has over 3000 files so I can’t post all of it but the important part is taken from this repo and the error is specifically being caused by line 101 of this file.

I’m assuming what caused the error has to be some kind of background process that updated CUDA or something like that because no code was changed prior to this error emerging. I’m not sure how to begin debugging this issue and will post any additional information requested.

I’m running this on Ubuntu 16.04 and running the code with MATLAB R2018b.

Source: Windows Questions C++