users > Compilation with CUDA support
Showing 1-2 of 2 posts
Display:
Results per page:
Aug 30, 2016  03:08 PM | Vilim Stih
Compilation with CUDA support
Hello,

I am trying to compile CMTK with CUDA support on Linux (Ubuntu Linux 2016.4, 64 bit). The compilation works fine without CUDA support enabled, but when it is enabled I get the following errors:

[ 73%] Building CXX object libs/GPU/CMakeFiles/cmtkGPU.dir/cmtkImagePairAffineRegistrationFunctionalDevice.cxx.o
/home/vilim/Programs/cmtk/cmtk-scm-2016-08-28/core/libs/GPU/cmtkImagePairAffineRegistrationFunctionalDevice.cxx: In member function 'virtual cmtk::Functional::ReturnType cmtk::ImagePairAffineRegistrationFunctionalDevice::Evaluate()':
/home/vilim/Programs/cmtk/cmtk-scm-2016-08-28/core/libs/GPU/cmtkImagePairAffineRegistrationFunctionalDevice.cxx:87:127: error: cannot convert 'const long long int*' to 'const int*' for argument '1' to 'float cmtk::ImagePairAffineRegistrationFunctionalDeviceEvaluateMSD(const int*, void*, const int*, void*, const float (*)[4])'
his->m_MovingVolumeOnDevice->GetDeviceArrayPtr()->GetArrayOnDevice(), matrix );
^
libs/GPU/CMakeFiles/cmtkGPU.dir/build.make:381: recipe for target 'libs/GPU/CMakeFiles/cmtkGPU.dir/cmtkImagePairAffineRegistrationFunctionalDevice.cxx.o' failed
make[2]: *** [libs/GPU/CMakeFiles/cmtkGPU.dir/cmtkImagePairAffineRegistrationFunctionalDevice.cxx.o] Error 1
CMakeFiles/Makefile2:6275: recipe for target 'libs/GPU/CMakeFiles/cmtkGPU.dir/all' failed
make[1]: *** [libs/GPU/CMakeFiles/cmtkGPU.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2

The same error happens for both the 3.3.1 source and the nightly version downloaded from the subversion repository, and persists for both gcc 4.9 and 5.4

Is there perhaps a precompiled package with CUDA support, or a way to fix this bug?

Best regards,
Vilim
Sep 1, 2016  12:09 AM | Torsten Rohlfing
RE: Compilation with CUDA support
Hi Vilim -

Sorry for the inconvenience.

The problem you are seeing is that when I recently lifted the 32bit image indexing requirement, I didn't make the necessary changes to the CUDA code also. Unfortunately, I do not currently have a CUD-capable development system, so I can't give you an estimate on how long that's going to take either.

As an immediate fix, you could build from the SVN source code, revision 5395. That is the state right before the switch to 64bit.

However, I somewhat doubt you really want CUDA support anyway. Basically, the only algorithms in CMTK that have CUDA acceleration are the image symmetry plane computation and the MR bias field correction. If you are using neither, there won't be one bit of a difference in terms of computational performance.

Best,
  Torsten