Skip to content

Instantly share code, notes, and snippets.

@weilinear
Created December 1, 2012 07:21
Show Gist options
  • Star 12 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save weilinear/4180952 to your computer and use it in GitHub Desktop.
Save weilinear/4180952 to your computer and use it in GitHub Desktop.
cutil_inline.h

The original great cuda-convnet package is here: http://code.google.com/p/cuda-convnet/

To build the convnet using CUDA 5:

  1. Change the build.sh to use correct pathes. For cuda SDK path, use the path contains file helper_cuda.h.
  2. Make a dummyinclude folder, and put the cutil_inline.h into that folder.
  3. For MAKEFILE, include the dummyinclude file.

Try ./build.sh and see whether that can compiles.

The functionality is not fully tested and this can just compiles the package.

/*
Dummy Includes for cutil_inline.h
Wei LI <kuantkid <at> gmail <dot> com>
*/
#include <helper_cuda.h>
#define cutilCheckMsg(a) getLastCudaError(a)
#define cutGetMaxGflopsDeviceId() gpuGetMaxGflopsDeviceId()
#define MIN(a,b) (a) < (b) ? (a) : (b)
# Change the include line in Makefile
INCLUDES := -DCUDA_5 -I$(PYTHON_INCLUDE_PATH) -I$(NUMPY_INCLUDE_PATH) -I$(CUDA_SDK_PATH) -I./include -I./include/common -I./include/cudaconv2 -I./include/nvmatrix -I./dummyinclude/
@skosch
Copy link

skosch commented Dec 18, 2012

This is awesome, thank you! I also had to comment out line 332 in common-gcc-cuda-4.0.mk to stop it from linking to cutil and shrutil. That made it compile; I don't know if it actually works yet.

@weilinear
Copy link
Author

There is some further comments in email from David Reichert and hope this will benefit others:

Thanks a lot! It looks like you also added this to the Makefile 
-LGLEW

as well as commented out the lines below makedirectories, which is what caused me trouble
(I don't really know how makefiles work in detail). Maybe these details could be added to
your explanation. Also, I also had to comment out those cutil lines to make it work. It does
seem to work now though, so thanks!

@jb124816
Copy link

In addition to this I also followed instructions from here to modify common-gcc-cuda-4.0.mk

@wxnfifth
Copy link

Thank you very much!

@benselby
Copy link

benselby commented Apr 2, 2014

This is great, but can anyone verify that it is in fact functional? I am unable to recreate the sample specified here: https://code.google.com/p/cuda-convnet/wiki/TrainingNet with no error output...

@geraldstanje
Copy link

did you get it installed with cuda 6 on osx?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment