libcaffe-cuda-dev does not work with CUDA 10

Bug #1812522 reported by Jesse Kleemann
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
caffe-contrib (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

It depends on libcublas_device.a which is deprecated and not available in CUDA 10.

My caffe projects are compiling fine after removing libcublas_device.a from "/usr/share/caffe/CaffeTargets-release.cmake".

Ubuntu Release:
Description: Ubuntu 18.04.1 LTS
Release: 18.04

Packages:
libcaffe-cuda1:
  Installed: 1.0.0-6build1
  Candidate: 1.0.0-6build1
  Version table:
 *** 1.0.0-6build1 500
        500 http://ftp.halifax.rwth-aachen.de/ubuntu bionic/multiverse amd64 Packages
        100 /var/lib/dpkg/status
libcaffe-cuda-dev:
  Installed: 1.0.0-6build1
  Candidate: 1.0.0-6build1
  Version table:
 *** 1.0.0-6build1 500
        500 http://ftp.halifax.rwth-aachen.de/ubuntu bionic/multiverse amd64 Packages
        100 /var/lib/dpkg/status

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in caffe-contrib (Ubuntu):
status: New → Confirmed
information type: Public → Public Security
information type: Public Security → Public
Revision history for this message
Lenin (gagarin) wrote :

Hi Jesse

I can't find that file CaffeTargets-release.cmake in the debian source package of caffe-contrib... how did you patch it to get it work with CUDA 10?

Cheers,

Revision history for this message
Jesse Kleemann (jesseklm) wrote :

Hi Lenin,

it has to be generated somewhere while building the package.
I made it work by removing "/usr/lib/x86_64-linux-gnu/libcublas_device.a;" from the IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE properties of caffe in line 11.

Or alternatively the following fix in CMakeLists.txt:
find_package(Caffe)
if(Caffe_FOUND)
    find_package(CUDA)
    if(CUDA_FOUND)
        if((CUDA_VERSION VERSION_GREATER "10.0") OR (CUDA_VERSION VERSION_EQUAL "10.0"))
            get_target_property(${PROJECT_NAME}_libraries caffe IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE)
            list(REMOVE_ITEM ${PROJECT_NAME}_libraries "/usr/lib/x86_64-linux-gnu/libcublas_device.a")
            set_target_properties(caffe PROPERTIES
                    IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE "${${PROJECT_NAME}_libraries}"
                    )
        endif()
    endif()
endif()

Many greetings,

Revision history for this message
Lenin (gagarin) wrote :

Do you have a debian source package that is already fixed/patched as .dsc link that I can just dget?

Revision history for this message
Lenin (gagarin) wrote :

Out of interest, what do you need it for? I have some photogrammetry people here that asked for it...

Revision history for this message
Jesse Kleemann (jesseklm) wrote :

The original package might work because the dependencies are not resolved until the deb package is created.
https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/caffe-contrib/1.0.0-8ubuntu2/caffe-contrib_1.0.0-8ubuntu2.dsc

We are using it to detect road surface markings with an autonomous driving modelcar.

Revision history for this message
Lenin (gagarin) wrote :

Unfortunately not, even when patching away gcc-6 deps, replacing the gcc version in debian/rules, and dropping the nvidia-cuda 9 dependency.

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
CUDA_cublas_device_LIBRARY (ADVANCED)
    linked by target "caffe" in directory /scratch/caffe/caffe-contrib-1.0.0/src/caffe

That was what I already tried before... no chance to get your source .dsc? I'll try to get it fixed, and put it online, for others to profit.

Revision history for this message
Jesse Kleemann (jesseklm) wrote :

I'd publish my source .dsc if I had one.
I only installed the pre-built binaries myself.
- sudo apt install libcaffe-cuda-dev
- edited /usr/share/caffe/CaffeTargets-release.cmake

Those were the only steps I took to get our project compiled.

Revision history for this message
Lenin (gagarin) wrote :

ah you only need the header files! so you don't need any other packages but libcaffe-cuda-dev?
we got ubuntu 18.04, and coda 10, so we need to get this built from source...

Revision history for this message
Lenin (gagarin) wrote :

Ok, getting the master from github, using

ccmake .
using this
/usr/local/cuda-10.0/bin/nvcc
/usr/local/cuda-10.0/
/usr/local/cuda-10.0/
g
cmake .
make

works. Thanks.

Revision history for this message
Jesse Kleemann (jesseklm) wrote :

I'm sorry I didn't make it clear that I just needed the header files. libcaffe-cuda-dev was the only package I needed.

Ah okay, will build the caffe master from github until cuda 10 is available as ubuntu package, thanks a lot.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.