SuperElastix / SimpleElastix

Multi-lingual medical image registration library
http://simpleelastix.github.io
Apache License 2.0
509 stars 149 forks source link

SimpleElastix with OpenCL #304

Open Guillaume2705 opened 5 years ago

Guillaume2705 commented 5 years ago

Hi

I am using SimpleElastix to make registration but it is too much time computing so i am trying to install OpenCL with SimpleElastix to use OpenCL paramters. But i have some errors in the SimpleElastix build..

What i did :

  1. CMake ITK 4.1.3 with -ITK_GPU = 0 And msbuild /p:configuration=release ALL_BUILD.vcxproj with VS2017 x64 Native Tools Command Prompt. Works

  2. CMake Elastix as a standalone project with -ELASTIX_USE_OPENCL = 1 -USE_OpenCLFixedGenericPyramid = 1 -USE_OpenCLMovingGenericPyramid = 1 -USE_OpenCLResampler = 1 -OPENCL_USE_NVIDIA_SDK = 1 -OPENCL_INCLUDE_DIRS = path_to_dir -OPENCL_LIBRARIES = path_to_lib -ELASTIX_BUILD_EXECUTABLE = 0 And msbuild /p:configuration=release ALL_BUILD.vcxproj with VS2017 x64 Native Tools Command Prompt. Works

  3. CMake SimpleElastix with ITK -SimpleItk_USE_SYSTEM_ELASTIX = path_to_elastix_bin -SimpleItk_USE_SYSTEM_ITK = path_to_itk_bin put only -WRAP_PYTHON = 1

200 Errors : elxOpenCL.lib(itkOpenCLImage.obj) : error LNK2019: unresolved external symbol clEnqueueMapImage referenced in functio n "public: void * __cdecl itk::OpenCLImage::Map(enum itk::OpenCLMemoryObject::Access,class itk::OpenCLSize const &,clas s itk::OpenCLSize const &,unsigned __int64 *,unsigned __int64 *)" (?Map@OpenCLImage@itk@@QEAAPEAXW4Access@OpenCLMemoryO bject@2@AEBVOpenCLSize@2@1PEA_K2@Z) [C:\p\SimpleITK-build\Wrapping\Python\SimpleITK_PYTHON.vcxproj] [C:\p\SimpleITK.vcx proj] C:\p\SimpleITK-build\Wrapping\Python_SimpleITK.pyd : fatal error LNK1120: 64 unresolved externals [C:\p\SimpleITK-bu ild\Wrapping\Python\SimpleITK_PYTHON.vcxproj] [C:\p\SimpleITK.vcxproj] 36 Warning(s) 200 Error(s)

I think it is a problem with the linker with OpenCL?

Thanks,

MarHHM commented 4 years ago

Hi

I am using SimpleElastix to make registration but it is too much time computing so i am trying to install OpenCL with SimpleElastix to use OpenCL paramters. But i have some errors in the SimpleElastix build..

What i did :

  1. CMake ITK 4.1.3 with -ITK_GPU = 0 And msbuild /p:configuration=release ALL_BUILD.vcxproj with VS2017 x64 Native Tools Command Prompt. Works
  2. CMake Elastix as a standalone project with -ELASTIX_USE_OPENCL = 1 -USE_OpenCLFixedGenericPyramid = 1 -USE_OpenCLMovingGenericPyramid = 1 -USE_OpenCLResampler = 1 -OPENCL_USE_NVIDIA_SDK = 1 -OPENCL_INCLUDE_DIRS = path_to_dir -OPENCL_LIBRARIES = path_to_lib -ELASTIX_BUILD_EXECUTABLE = 0 And msbuild /p:configuration=release ALL_BUILD.vcxproj with VS2017 x64 Native Tools Command Prompt. Works
  3. CMake SimpleElastix with ITK -SimpleItk_USE_SYSTEM_ELASTIX = path_to_elastix_bin -SimpleItk_USE_SYSTEM_ITK = path_to_itk_bin put only -WRAP_PYTHON = 1

200 Errors : elxOpenCL.lib(itkOpenCLImage.obj) : error LNK2019: unresolved external symbol clEnqueueMapImage referenced in functio n "public: void * __cdecl itk::OpenCLImage::Map(enum itk::OpenCLMemoryObject::Access,class itk::OpenCLSize const &,clas s itk::OpenCLSize const &,unsigned __int64 *,unsigned __int64 *)" (?Map@OpenCLImage@itk@@QEAAPEAXW4Access@OpenCLMemoryO bject@2@AEBVOpenCLSize@2@1PEA_K2@Z) [C:\p\SimpleITK-build\Wrapping\Python\SimpleITK_PYTHON.vcxproj] [C:\p\SimpleITK.vcx proj] C:\p\SimpleITK-build\Wrapping\Python_SimpleITK.pyd : fatal error LNK1120: 64 unresolved externals [C:\p\SimpleITK-bu ild\Wrapping\Python\SimpleITK_PYTHON.vcxproj] [C:\p\SimpleITK.vcxproj] 36 Warning(s) 200 Error(s)

I think it is a problem with the linker with OpenCL?

Thanks,

i tried building elastix with open cl support (VS 2019 on Win 10 - NVIDIA SDK also), but it didn't work (& i think others were reporting similar issues).. so maybe u have the same problem (coming from elastix, not SimpleITK), specially that it's complaining about a missing lib (i think from elastix not being built correctly)..

@kaspermarstal what do u think ??