I encounter this problem when trying to compile the implementation of NIN on the caffe branch cccp-dev.
To fix the error I had to include a MKL_DIR variable in the Makefile.config file and set it to
MKL_DIR := /opt/intel/mkl
I also included the mkl directory on my LD_LIBRARY_PATH but that didn't seem to help.
After doing that it compiled the code
Tuesday, July 15, 2014
Thursday, June 19, 2014
invalid device function cudaGetLastError() on cuda-convnet dropout
When installing the library from this library :
https://github.com/dnouri/cuda-convnet
I came across this error :
invalid device function cudaGetLastError()
All I had to do was to comment this line in the CMakeLists.txt file
#list(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_30,code=sm_30)
and uncomment this line
list(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_20,code=sm_20)
The problem as described by this post
https://forums.udacity.com/questions/100015837/invalid-device-function-cudagetlasterror#cs344
is that the the device requirement is higher than what it is specified
https://github.com/dnouri/cuda-convnet
I came across this error :
invalid device function cudaGetLastError()
All I had to do was to comment this line in the CMakeLists.txt file
#list(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_30,code=sm_30)
and uncomment this line
list(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_20,code=sm_20)
The problem as described by this post
https://forums.udacity.com/questions/100015837/invalid-device-function-cudagetlasterror#cs344
is that the the device requirement is higher than what it is specified
Thursday, May 8, 2014
Thursday, May 1, 2014
Installing caffe with Cuda 5.5 in Ubuntu 12.04
Follow the following instructions to install Nvidia driver and Cuda 5.5
STEP I – Driver installation (if you choose the regular drivers)
This section remains almost unchanged. Download the Nvidia drivers for Linux from their website, making sure to select 32 or 64-bit Linux based on your system.
Make sure the requisite tools are installed using the following command -
sudo apt-get install freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev
Next, blacklist the required modules (so that they don’t interfere with the driver installation) -
sudo nano /etc/modprobe.d/blacklist.conf
Add the following lines to the end of the file, one per line, and save it when done -
blacklist amd76x_edac
blacklist vga16fb
blacklist nouveau
blacklist rivafb
blacklist nvidiafb
blacklist rivatv
In order to get rid of any nVidia residuals, run the following command in a terminal -
sudo apt-get remove --purge nvidia*
This may take a while, so be patient. Once it’s done, reboot your machine. At the login screen, don’t login just yet. Press Ctrl+Alt+F1 to switch to a text-based login, and switch to the directory which contains the downloaded driver. Run the following commands -
sudo service lightdm stop
chmod +x NVIDIA*.run
where NVIDIA*.run is the full name of your driver. Next, start the installation with -
sudo ./NVIDIA*.run
Follow the onscreen instructions. If the installer throws up an error about nouveau still running, allow it to create a blacklist for nouveau, quit the installation and reboot. In that case, run the following commands again -
sudo service lightdm stop
sudo ./NVIDIA*.run
The installation should now proceed smoothly. When it asks you if you want the 32-bit libraries and if you want it to edit xorg.conf to use these drivers by default, allow both.
Reboot once the installation completes.
STEP II – CUDA toolkit installation
Download the CUDA toolkit (I used the Ubuntu 11.10 64-bit version). Navigate to the directory that contains the downloaded CUDA toolkit package, and run the following command -
chmod +x cuda*.run
sudo ./cuda*.run
where
cuda*.run is the full name of the downloaded CUDA toolkit. Accept the license that appears. Next, choose to install the driver if you’ve not done so already (this is the development version). Installation of the driver will require switching to a text-based shell (Ctrl+Alt+F1), stopping lightdm as detailed in the previous step and running the toolkit installer as superuser. The CUDA 5.0 toolkit installation is compulsory, while that of the included samples isn’t. Allow the installer to proceed with default locations unless you have specific reasons for not doing so. This makes for easier troubleshooting in the future.
This process might take a while depending upon your system config. Once it’s done, double check the summary screen to make sure everything is in place. If the installation of the samples fails (which it does more often than not), it’s probably due to one or more missing libraries. In that case, install the required libraries and rerun the installer, choosing to install the samples alone.
To make sure the necessary environment variables (
PATH and LD_LIBRARY_PATH) are modified every time you access a terminal, add the requisite lines (from the summary screen) to the end of ~/.bashrcas follows -
32 bit systems -
export PATH=$PATH:/usr/local/cuda-5.0/bin
export LD_LIBRARY_PATH=/usr/local/cuda-5.0/lib
64 bit systems -
export PATH=$PATH:/usr/local/cuda-5.0/bin
export LD_LIBRARY_PATH=/usr/local/cuda-5.0/lib64:/lib
The paths used above will vary based on the install directory you choose for the toolkit. This wraps up the arguably simpler setup (compared to CUDA 4.x for Linux users), although the samples’ installation still suffers from dependency hell.
STEP III – CUDA samples installation and troubleshooting
While the installation of the samples should be straightforward (simply run the all in one toolkit installer), it’s often not all that easy. If you’re getting an error similar to “Samples installation failed due to missing libraries – libglut.so not found”, it’s typically because the installer looks for libglut.so and not variants (like libglut.so.3). To fix this, we’ll have to create softlinks so the installer can track down these files.
Determine if variants of libglut.so are present as follows -
sudo find /usr -name libglut\*
On my 64-bit installation of Ubuntu 12.04, this output the following text -
/usr/lib/x86_64-linux-gnu/libglut.so.3
/usr/lib/x86_64-linux-gnu/libglut.so.3.9.0
/usr/lib/x86_64-linux-gnu/libglut.a
/usr/lib/x86_64-linux-gnu/libglut.so
Now that a variant of libglut.so (that is, libglut.so.3) has been found, we can create a softlink to it -
sudo ln -s /usr/lib/x86_64-linux-gnu/libglut.so.3 /usr/lib/libglut.so
Next, rerun the all in one installer choosing to install only the samples this time around. That should fix the “Missing libraries” error that cropped up previously.
Further reading resources can be found here if you’re looking for books on CUDA and GPGPU programming in general.
Credit of this steps for Cuda goes here and hereSTEP IV – Caffe installation
Follow the following instructions to install caffehttp://caffe.berkeleyvision.org/installation.htmlEverything should work fine, except for me I had to run first
sudo apt-get install libgl1-mesa-dri
which was a dependency. Also I had an error complaining about glog which was fixed once I added '/usr/local/lib' to the LD_LIBRARY_PATH in my .bashrc file in the home directory. In my case:
export LD_LIBRARY_PATH=/usr/local/cuda-5.5/lib64:/lib:/usr/local/lib
I also had the following error:
build/src/caffe/test/test_all.testbin: error while loading shared libraries: libmkl_rt.so: cannot open shared object file: No such file or directory
in my case:
export LD_LIBRARY_PATH=/usr/local/cuda-5.5/lib64:/lib:/usr/local/lib:/opt/intel/composer_xe_2013_sp1/mkl/lib/intel64
Sunday, April 20, 2014
Monday, January 13, 2014
Installing OpenCV 2.4.8 on Visual Studio 2012
Step 1
Download OpenCV from here
unzip and change the name of opencv to OpenCV2.4.8
add to system path:
C:\OpenCV2.4.8\build\x64\vc10\bin
Step 2:
Open Visual Studio 2012 and create a new console win32 application preferrebly uncheck the precomplied hadear and security options
Go to BUILD -> Configuration Manager
Click on Win32 and create a new x64
Step 3:
Go to Project properties and add the following :
C/C++ -> Additional Include Directories
C:\OpenCV2.4.8\build\include\opencv;C:\OpenCV2.4.8\build\include;
Linker-> General -> Additional Library Dependencies
C:\OpenCV2.4.8\build\x64\vc10\lib
Linker->Input-> Additional Dependencies
Release mode:
opencv_core248.lib
opencv_imgproc248.lib
opencv_highgui248.lib
opencv_ml248.lib
opencv_video248.lib
opencv_features2d248.lib
opencv_calib3d248.lib
opencv_objdetect248.lib
opencv_contrib248.lib
opencv_legacy248.lib
opencv_flann248.lib
for Debug mode:
opencv_core248d.lib
opencv_imgproc248d.lib
opencv_highgui248d.lib
opencv_ml248d.lib
opencv_video248d.lib
opencv_features2d248d.lib
opencv_calib3d248d.lib
opencv_objdetect248d.lib
opencv_contrib248d.lib
opencv_legacy248d.lib
opencv_flann248d.lib
Step 4
Run this small snippet
#include "stdafx.h"
#include <opencv2/core/core.hpp> // Basic OpenCV structures (cv::Mat, Scalar)
#include <opencv2/highgui/highgui.hpp>
int _tmain(int argc, _TCHAR* argv[])
{
IplImage *img = cvLoadImage("image.jpg");
cvNamedWindow("Image:",1);
cvShowImage("image:",img);
cvWaitKey();
cvDestroyWindow("Image:");
cvReleaseImage(&img);
return 0;
}
Download OpenCV from here
unzip and change the name of opencv to OpenCV2.4.8
add to system path:
C:\OpenCV2.4.8\build\x64\vc10\bin
Step 2:
Open Visual Studio 2012 and create a new console win32 application preferrebly uncheck the precomplied hadear and security options
Go to BUILD -> Configuration Manager
Click on Win32 and create a new x64
Step 3:
Go to Project properties and add the following :
C/C++ -> Additional Include Directories
C:\OpenCV2.4.8\build\include\opencv;C:\OpenCV2.4.8\build\include;
Linker-> General -> Additional Library Dependencies
C:\OpenCV2.4.8\build\x64\vc10\lib
Linker->Input-> Additional Dependencies
Release mode:
opencv_core248.lib
opencv_imgproc248.lib
opencv_highgui248.lib
opencv_ml248.lib
opencv_video248.lib
opencv_features2d248.lib
opencv_calib3d248.lib
opencv_objdetect248.lib
opencv_contrib248.lib
opencv_legacy248.lib
opencv_flann248.lib
for Debug mode:
opencv_core248d.lib
opencv_imgproc248d.lib
opencv_highgui248d.lib
opencv_ml248d.lib
opencv_video248d.lib
opencv_features2d248d.lib
opencv_calib3d248d.lib
opencv_objdetect248d.lib
opencv_contrib248d.lib
opencv_legacy248d.lib
opencv_flann248d.lib
Step 4
Run this small snippet
#include "stdafx.h"
#include <opencv2/core/core.hpp> // Basic OpenCV structures (cv::Mat, Scalar)
#include <opencv2/highgui/highgui.hpp>
int _tmain(int argc, _TCHAR* argv[])
{
IplImage *img = cvLoadImage("image.jpg");
cvNamedWindow("Image:",1);
cvShowImage("image:",img);
cvWaitKey();
cvDestroyWindow("Image:");
cvReleaseImage(&img);
return 0;
}
Tuesday, December 17, 2013
Installing OpenCV 2.4.6 in Visual Studio 2012
Step 1
Download OpenCV from here
unzip and change the name of opencv to OpenCV2.4.6
add to system path:
C:\OpenCV2.4.6\build\x64\vc10\bin
Step 2:
Open Visual Studio 2012 and create a new console win32 application preferrebly uncheck the precomplied hadear and security options
Go to BUILD -> Configuration Manager
Click on Win32 and create a new x64
Step 3:
Go to Project properties and add the following :
C/C++ -> Additional Include Directories
C:\OpenCV2.4.6\build\include\opencv;C:\OpenCV2.4.6\build\include;
Linker-> General -> Additional Library Dependencies
C:\OpenCV2.4.6\build\x64\vc10\lib
Linker->Input-> Additional Dependencies
Release mode:
opencv_core246.lib
opencv_imgproc246.lib
opencv_highgui246.lib
opencv_ml246.lib
opencv_video246.lib
opencv_features2d246.lib
opencv_calib3d246.lib
opencv_objdetect246.lib
opencv_contrib246.lib
opencv_legacy246.lib
opencv_flann246.lib
for Debug mode:
opencv_core246d.lib
opencv_imgproc246d.lib
opencv_highgui246d.lib
opencv_ml246d.lib
opencv_video246d.lib
opencv_features2d246d.lib
opencv_calib3d246d.lib
opencv_objdetect246d.lib
opencv_contrib246d.lib
opencv_legacy246d.lib
opencv_flann246d.lib
Step 4
Run this small snippet
#include "stdafx.h"
#include <opencv2/core/core.hpp> // Basic OpenCV structures (cv::Mat, Scalar)
#include <opencv2/highgui/highgui.hpp>
int _tmain(int argc, _TCHAR* argv[])
{
IplImage *img = cvLoadImage("image.jpg");
cvNamedWindow("Image:",1);
cvShowImage("image:",img);
cvWaitKey();
cvDestroyWindow("Image:");
cvReleaseImage(&img);
return 0;
}
Subscribe to:
Posts (Atom)