Skip to content

unable to use caffe with GPU support

The cpp flag -DCPU_ONLY is added automatically. This is not used in vgg_classifier and I believe it is only there for caffe. If the flag is removed and Caffe was indeed built without gpu support, our build fails with:

In file included from /usr/include/caffe/common.hpp:19,
                 from /usr/include/caffe/blob.hpp:8,
                 from /usr/include/caffe/caffe.hpp:7,
                 from /home/carandraug/src/vic/vgg-classifier/src/directencode/caffe_encoder_utils.h:8,
                 from /home/carandraug/src/vic/vgg-classifier/src/directencode/caffe_encoder.h:11,
                 from /home/carandraug/src/vic/vgg-classifier/src/cpuvisor_testimg.cc:9:
/usr/include/caffe/util/device_alternate.hpp:34:10: fatal error: cublas_v2.h: No such file or directory
 #include <cublas_v2.h>
          ^~~~~~~~~~~~~
compilation terminated.

But this also prevents the use of Caffe with GPU support. We could add a cmake flag ourselves but this can all be avoided if instead of setting the flag ourselves, we use the config file provided by the installed Caffe, i.e., we remove our own FindCaffe.cmake file and let cmake find the right flags. However, this requires Caffee be installed with cmake (and Caffe does provide cmake files) but all our documentation and configuration do not do it (instead, it manually modifies a Makefile.config).

Edited by David Miguel Susano Pinto
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information