GPUmat doesn't work in my matlab - matlab

I want to use GPU in matlab, so I installed CUDA toolkit(cuda_6.0.37), downloaded GPUmat 0.28 version. Of course my pc has geforce 850m. I clicked 'GPUstart', and it seems working and type the 'GPUmatSystemCheck', it says CUBLAS, CUFFT, CUDART installed, but there is warning 'GPUmat and SYSTEM architecture are different.'. My pc is 64 bit. Type the GPUsingle(1) on the command window, it says
'Warning: The following error was caught while executing 'GPUtype'
class destructor: Undefined function 'GPUtypeDelete' for input
arguments of type 'double'. Undefined function
'mxNumericArrayToGPUtypePtr' for input arguments of type
'GPUsingle'.'.
What should I do next? What am I missing?

I suppose you installed the newest version of GPUmat, which is a 32 bit version, and hence there is the warning. Maybe it would help to download an older version of GPUmat, which is made for 64 bit systems. I tried it myself and at least I don't get the warning anymore. Instead I have the problem that some DLL files are not found (Invalid MEX-file
'..\GPUmat\win64\bin\GPUfullInfo.mexw64': not found). You could still give it a try and see if it works for you.

Related

Linux Mint 21.1 MATLAB 2022b VideoReader/initReader Could not read file due to an unexpected error. Reason: Unable to initialize the video properties

I have installed MATLAB 2022b on my LInux Mint 21.1. My laptop is an Acer Swift 3 with an Nvidia MX250 dedicated gpu. I have installed the drivers for the gpu, namely the nvidia-driver-525 and nvidia-utils-525 package.
The Nvidia X Server Settings seems to work and the Prime Profile is set to NVIDIA (Performance Mode).
The problem is when I am trying to load a video (.mp4 and .mov) in different frames, but when I ran the code I get this error in the console:
Main Error using VideoReader/initReader Could not read file due to an unexpected error. Reason: Unable to initialize the video properties
Error in audiovideo.internal.IVideoReader (line 136) initReader(obj, fileName, currentTime);
Error in VideoReader (line 104) obj#audiovideo.internal.IVideoReader(varargin{:});
Error in load_picture (line 2) vid = VideoReader(obj);
Error in Main (line 12) [vid, yval, t, nulv]=load_picture(obj);
When I was trying to run the code reading the video, I was getting this errors in the terminal session I opened MATLAB with:
(MATLAB:4591): GStreamer-WARNING **: 10:55:45.878: Failed to load plugin '/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstlibav.so': /home/malina/MATLAB/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /lib/x86_64-linux-gnu/librubberband.so.2)
(MATLAB:4591): GStreamer-Base-CRITICAL **: 10:55:45.909: basetransform: second attempt to fixate caps returned invalid (NULL) caps on pad vaapipostproc0:sink
I moved the libstdc++.so.6 from the MATLAB/sys/os folder to an unused folder, I have read that by doing this matlab will be forced to use the systems libstdc++.so.6 package, the version coming with the install being known to cause problems as stated by some forums. Doing that resulted in the same error from the console while running the code, but there is no more output from the terminal session.
The problem might be driver specific, but I am unsure. I have installed the codecs and libgstreamer1.0 packages, but I do not know how to test if they are the correct version for matlab. I can open the files on my system normally, so the codecs shouldn't be the problems.
Can anyone guide me through solving this issue? I'd be really grateful. Let me know if you want any other info that might be useful and if there are any log files created by matlab that could be useful in solving this issue, please let me know where I can find them.

Undefined reference error when using mexcuda ubuntu

Ive installed matlab,gcc and CUDA toolkit on ubuntu .to use mexcuda .
but when i compile i get the following errors and i cant find any references on them anywhere .
Error using mex
/tmp/mex_42185702054896_15548/testmem04.o: In function `mexFunction':
tmpxft_00003e3a_00000000-5_testmem04.compute_70.cudafe1.cpp:(.text+0x152): undefined reference
to `__cudaPushCallConfiguration'
/tmp/mex_42185702054896_15548/testmem04.o: In function `__device_stub__Z9MulKernelPhPi(unsigned
char*, int*)':
tmpxft_00003e3a_00000000-5_testmem04.compute_70.cudafe1.cpp:(.text+0x35e): undefined reference
to `__cudaPopCallConfiguration'
collect2: error: ld returned 1 exit status
please note that when i first installed matlab, cuda 10 (my current version) was not supported by it , ive encountered the same thing when i installed matlab on windows , and fixed it by commenting a line in file "nvcc_g++.xml" and it works . when i did this in ubuntu matlab,matlab now detects the nvcc compiler but i get the previous error .
i realize "undefined reference errors " are linker errors , what should i do here ? i tried linking to cuda library but it didnt work .
For mexcuda, it is crucial that you match the CUDA toolkit to the version shipping with your installation of MATLAB (and Parallel Computing Toolbox). This is because Parallel Computing Toolbox ships a selection of libraries from the CUDA toolkit, and expects to be able to link against them. If you use the wrong version of the CUDA toolkit, all sorts of things can go wrong.
To check the appropriate version of the CUDA toolkit, look at the CUDA ToolkitVersion Version showing in the output from gpuDevice.
(Note that it is only the toolkit version that needs to match with MATLAB & PCT - it's almost always fine to get the latest driver).
For more details, see my answer https://uk.mathworks.com/matlabcentral/answers/432360-after-uninstalling-cuda-toolkit-still-matlab-responds-for-gpudevice over there on MATLAB Answers.

Encountered an error while compiling cobalt on raspberry pi

While compiling cobalt for raspberry pi on ninja, im getting an error like this:
undefined reference to symbol 'eglCreateImageKHR'
here is the full trace:
[1/1] LINK cobalt
FAILED: cobalt
/home/mi07/work/raspitools/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++ #cobalt.rsp
/home/mi07/work/raspitools/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: obj/starboard/raspi/2/../shared/open_max/starboard_platform.decode_target_create.o: undefined reference to symbol 'eglCreateImageKHR'
/home/mi07/work/raspitools/sysroot/opt/vc/lib/libbrcmEGL.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
I googled it and found somewhat related article on this site.
As per this article the fault could be that of libssl1.0-dev not being there. I checked and found it was libssl-dev. Replaced it with libssl1.0-dev but still the error persists.
Can somebody tell me what is going wrong?
eglCreateImageKHR() is an EGL extension EGL_KHR_image. Since Cobalt compiled, it appears the headers declare the extension, but the linked EGL library didn't define it. It's surprising that only eglCreateImageKHR() is missing and not eglDestroyImageKHR as well.
At any rate, I recommend trying to update the EGL library, but I'm not familiar with the raspi install, so can't tell you the specifics.
Alternatively, it is safe to comment out the call to that function in decode_target_create.cc since SbImageIsDecodeSupported() always returns false for raspi (see image_is_decode_supported.cc), so decode targets should never be created / destroyed on the platform. (Decode target support is a work in progress for raspi.)
I resolved this by changing the os itself. The problem was that the cobalt was not compatible with raspi stretch but with raspi jessie. Because sysroot files are being copied from the OS it was creating that error. I don't know exactly where the difference is but changing to raspi jessie worked fine for me.

ld: cannot find -lguide while compiling files using mex with intel c++ compiler

Here is the situation:
Ubuntu 13.04, Matlab 2012a and Intel C++ Composer XE 2013 for Linux.
I downloaded a matlab code archive and followed the instructions in it to compile the .cpp files. Formerly when I finished installing Matlab 2012a and started it, some error messages showed up and I googled out an answer which is:
sudo ln -s /lib/x86_64-linux-gnu/libc.so.6 /lib64/libc.so.6
And then there came out another error message which told me 'missing lstdc++' when I started compiling, the idea of re-installing g++ first came into my mind, and the error message disappeared after I did so. However, finally I got an error which I could not find an answer anywhere:
>> compilemex
ld: cannot find -lguide
mex: link of ' "max_pool.mexa64"' failed.
Error using mex (line 206)
Unable to complete successfully.
Error in compilemex (line 20)
eval(exec_string{1});
During the the process of searching for a solution, I found a thread for my previous 'missing lstdc++' error which differed from what I did to fix it, does this matter or not? And another hint is that I could not find any file named like 'libguide' under the /opt/intel/ directory, how could I fix it?
Thanks in advance!
Googl'ing for libguide, i found this:
http://software.intel.com/en-us/forums/topic/284445
According to this, the build script you're using refers to an old version of the intel compiler. Newer versions seem to have the functions in libguide.so moved to libiomp5.so.
So try replacing -lguide by -liomp5.
Disclaimer: this is pure google knowledge. Personally I have no idea what either library is good for :)

Strange Matlab error while building using Matlab coder

My Matlab coder was building stuff fine the last time I used (which was 2 months ago), but now when I try to build a project with it, I get the following error:
\>> coder -build get_scores.prj
Warning: 'perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LC_ALL = "en_GB",
LANG = (unset)
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
VSINSTALLDIR'
exceeds MATLAB's maximum name length of 63 characters and has been truncated to
'perl: warning: Setting locale failed.
perl: warning: Please che'.
\> In CompilerConfigurationFactory>CompilerConfigurationFactory.determineLocation at 275
In CompilerConfigurationFactory>CompilerConfigurationFactory.process at 130
In getCompilerConfigurations at 56
In C:\Program Files\MATLAB\R2011b\toolbox\coder\coder\private\compilerman.p>parse_opts_file at 57
In C:\Program Files\MATLAB\R2011b\toolbox\coder\coder\private\compilerman.p>compilerman at 15
In C:\Program Files\MATLAB\R2011b\toolbox\coder\coder\private\emlckernel.p>emlckernel/getCompilerName at 148
In C:\Program Files\MATLAB\R2011b\toolbox\coder\coder\private\emlckernel.p>emlckernel/finalizeProject at 711
In C:\Program Files\MATLAB\R2011b\toolbox\coder\coder\private\emlckernel.p>emlckernel at 36
In C:\Program Files\MATLAB\R2011b\toolbox\coder\coder\private\codeProject.p>codeProject/doit at 8
In C:\Program Files\MATLAB\R2011b\toolbox\coder\coder\private\codeProject.p>codeProject at 13
In C:\Program Files\MATLAB\R2011b\toolbox\coder\coder\emlcprivate.p>emlcprivate at 18
The current MEX compiler '`<unknown>`' is not supported.
Use mex -setup to select a supported compiler.
Use help codegen for more information on using this command.
I've run mex -setup several times, chosen Visual Studio (which was what I was using previously and was working fine), and rerun the Build command, but the same error comes up repeatedly. Also, the part "exceeds MATLAB's maximum name length of 63 characters and has been truncated" seems to say Matlab is somehow interpreting the Perl warning as some variable name - I have no idea what's going on there.
I'm not sure why the Perl warning is coming up either - the LC_ALL was previously unset, and now is en_GB, but the same error comes up any way.
Any steps to rectify this would be highly appreciated.
Ok, after looking carefully at the message, I guessed that Matlab is trying to get the variable name VSINSTALLDIR using Perl internally, and the warning message is throwing it off. I tried running Perl on the command line to confirm the warning appears there too. Then while searching for ways to fix the locale error (Googling gave solutions only for linux and Mac systems), I found a way to simply suppress the Perl warning on this page. After doing that, the above error is gone.