building cudpp with cuda-9.1

216 views
Skip to first unread message

cameronsimm...@gmail.com

unread,
Dec 15, 2017, 10:41:59 PM12/15/17
to CUDPP
Hey everyone.

For the past day or so I have been trying and finally managing to get cudpp built and the tests passing with cuda-9.1 and ubuntu 16.04 so I thought I might make a post so other people dont have to go through what I did.


I first cloned the cudpp git repo with: 



I then ran these commands from the root cudpp directory

$ git submodule init

$ git submodule update


This should clone the moderngpu and cub git repos to ext/ but the cub git repo failed for me. So I cloned it by using this command in the ext/ directory (you will need to remove the existing cub directory)


$ git clone https://github.com/NVlabs/cub.git


At this point the build should work according to the documentation but running "cmake . " and "make" in the root cudpp directory will fail with an error something like "src/cudpp/CMakeFiles/cudpp.dir/build.make:105: recipe for target 'src/cudpp/CMakeFiles/cudpp.dir/app/cudpp_generated_multisplit_app.cu.o' failed". I think the is because of the cub repo changing causing cudpp to break.


To fix this you need to add an include to the file at cudpp/src/cudpp/app/multisplit_app.cu. Near the top of the file you should see these includes


#include <cub/cub.cuh>

#include "cuda_util.h"

#include "cudpp.h"

#include "cudpp_util.h"


add "#include <cub/util_allocator.cuh>" to these 


At this point cmake will get up to some cuda_hash files which will cause errors saying  "nvcc fatal   : Unsupported gpu architecture 'compute_20'". So for the last step we need to modify a cmakefile that has outdated architectures in them (if you are using cuda-9). The CMakeLists.txt file resides in cudpp/src/cudpp_hash/ you need to modify this file removing all instances of SM's less then 30. To comment them out use '#'


these are the parts you have to remove


set(GENCODE_SM12 -gencode=arch=compute_12,code=sm_12 -gencode=arch=compute_12,code=compute_12)


set(GENCODE_SM13 -gencode=arch=compute_13,code=sm_13 -gencode=arch=compute_13,code=compute_13)


set(GENCODE_SM20 -gencode=arch=compute_20,code=sm_20 -gencode=arch=compute_20,code=compute_20)


if (CUDPP_GENCODE_SM12)

  set(GENCODE ${GENCODE} ${GENCODE_SM12})

endif(CUDPP_GENCODE_SM12)


if (CUDPP_GENCODE_SM13)

  set(GENCODE ${GENCODE} ${GENCODE_SM13})

endif(CUDPP_GENCODE_SM13)


if (CUDPP_GENCODE_SM20)

  set(GENCODE ${GENCODE} ${GENCODE_SM20})

endif(CUDPP_GENCODE_SM20)



Once this is done you should be able to build cudpp without any further hassle using these commands in the root of the cudpp directory. 

$ cmake .
$ make


This should build the library successfully and I have verified that all the tests pass. I have to say my knowledge with building projects like this is limited so I probably cant help you outside what I have described, but if you do have further question I will try to help out


I hope this helps those having trouble building this project







John Owens

unread,
Dec 15, 2017, 10:43:15 PM12/15/17
to cu...@googlegroups.com
Thank you, Cameron, we are happy to take pull requests for CUDPP fixes as new CUDA versions are released.

JDO

cameronsimm...@gmail.com

unread,
Dec 16, 2017, 3:48:33 AM12/16/17
to CUDPP
I am unfortunately not good enough with cmake or git to fix the issues without possibly breaking the build for other architectures. I posted this work around for the errors because a fellow student also wanted to know how I managed to do it so I thought it could be helpful to others.

hopefully someone with more knowledge of build systems can look at the problems described and find a fix
Reply all
Reply to author
Forward
0 new messages