[ITK] [ITK-users] GPU Implementation

Xiaopeng Yang yxp233 at postech.ac.kr
Fri Dec 5 00:41:20 EST 2014


Dear Jim,

 

Thanks for your help. I built the test successfully, but I met an error when
I run the program. Please see the attached image file. 

 

Best,

Xiaopeng

 



 

From: Jim Miller [mailto:millerjv at gmail.com] 
Sent: Friday, December 05, 2014 6:26 AM
To: Xiaopeng Yang
Cc: Insight-Users at Itk. Org
Subject: Re: [ITK-users] GPU Implementation

 

Xiaopeng, 

 

I changed your target_link_libraries line to be

 

target_link_libraries(itkGPUDemonsRegistrationFilterTest ITKGPUPDEDeformable
${ITK_LIBRARIES} )

 

Without adding ITKGPUPDEDeformable to the target_link_libraries, I would get
an error in linking like you had.    

 

When ITK is built, the kernel functions (OpenCL code) are "compiled into"
the C++ code. Basically, the .cl files are converted into a C++ file where
the OpenCL code is encoded as a C++ string. This C++ code implements the
method GetOpenCLSource() which returns that string containing the OpenCL
code.  The PDE registration OpenCL kernels are compiled into the library
ITKGPUPDEDeformable. If you had used other GPU filters, you would have had
to add the libraries that contain those kernels as well to your
target_link_libraries.

 

Jim

 

 

 

On Thu, Nov 27, 2014 at 7:34 AM, Xiaopeng Yang <yxp233 at postech.ac.kr> wrote:

Hi Jim,

I am sorry but could you please build the code enclosed to check whether you
also have that kind of errors or not?

Thank you very much.

Best,
Xiaopeng

-----Original Message-----
From: Xiaopeng Yang [mailto:yxp233 at postech.ac.kr]
Sent: Wednesday, November 26, 2014 9:34 PM
To: 'Jim Miller'
Cc: 'Michael Pinkert'; 'insight-users at itk.org'
Subject: RE: [ITK-users] GPU Implementation

Hi,

I tried to compile the code from Modules\Registration\GPUPDEDeformable\test
folder. Enclosed please find the code and CMakeLists file. I am quite new to
GPU, sorry I could not understand your explanation. Could you point out what
I missed please?

Thanks,
Xiaopeng


-----Original Message-----
From: Jim Miller [mailto:millerjv at gmail.com]
Sent: Wednesday, November 26, 2014 9:10 PM
To: Xiaopeng Yang
Cc: Michael Pinkert; insight-users at itk.org
Subject: Re: [ITK-users] GPU Implementation

This doesn't look like any issue with finding OpenCL. The link error is
saying it cannot find the implementation of an ITK method.

I think  GPUPDEDeformableRegistrationFilterKernel::GetOpenCLSource(void) is
supposed to return the kernel's implementation (probably as a string
containing the OpenCL code).

Is there a txx file that is not being included? Does your program contain
the same headers and test?

(I guess the error could occur if OpenCL was not found if the implementation
of this method in  GPUPDEDeformableRegistrationFilterKernel is within
#ifdef/#endif on OpenCL.)

Jim

> On Nov 25, 2014, at 10:03 PM, Xiaopeng Yang <yxp233 at postech.ac.kr> wrote:
>
> Hi Michael,
>
> I also had the same errors while building my GPU registration program.
> Have you solved the problems? I guess the error was caused by improper
> setting in CMakeLists.txt file, but I could not find any
> CMakeLists.txt sample regarding GPU implementation in ITK. I doubt
> whether there are users using this GPU module or not.
>
> Best regards,
> Xiaopeng Yang
>
>
> This is the question you raised:
>
> I am trying to implement the GPU demons registration algorithm, but I
> have been having difficulty getting the program to compile.  I believe
> the errors are because it cannot find the OpenCL library correctly,
> but I'm not sure how to fix it.
>
> I am using a NVIDIA Quadro FX 570 and am currently using OpenCL
> through the CUDA Computing Toolkit 4.2.  My cmake file is attached,
> but I have had to manually enter in the directory locations to CMake
> because I have not been able to find a FindOpenCL.cmake file that
> works correctly.  My operating system is Windows 7 x64.
>
> I am able to compile ITK after generating it in CMake with manually
> linked directories and Itk_Use_Gpu checked, but I have not been able
> to compile my program without getting errors, which are listed at the
bottom.
>
> Does anyone have suggestions as to how to fix this?
>
> Best regards,
> Michael Pinkert
>
> 2>registrationFunctions.obj : error LNK2019: unresolved external

> 2>symbol
> "public: static char const * __cdecl
> itk::GPUPDEDeformableRegistrationFilterKernel::GetOpenCLSource(void)"
> (?GetOpenCLSource at GPUPDEDeformableRegistrationFilterKernel@itk@@SAPEBD
> XZ) referenced in function "public: static char const * __cdecl
> itk::GPUPDEDeformableRegistrationFilter<class
> itk::GPUImage<float,3>,class itk::GPUImage<float,3>,class
> itk::GPUImage<class itk::Vector<float,3>,3>,class
> itk::DemonsRegistrationFilter<class
> itk::GPUImage<float,3>,class itk::GPUImage<float,3>,class
> itk::GPUImage<class itk::Vector<float,3>,3> > >::GetOpenCLSource(void)"
> (?GetOpenCLSource@?$GPUPDEDeformableRegistrationFilter at V?$GPUImage at M$0
> 2 at itk@
> @V12 at V?$GPUImage at V?$Vector at M$02 at itk@@$02 at 2@V?$DemonsRegistrationFilter
> @V?$GP
> UImage at M$02 at itk@@V12 at V?$GPUImage at V?$Vector at M$02 at itk@@$02 at 2@@2@@itk@@SA
> PEBDXZ
> )
>
> 2>registrationFunctions.obj : error LNK2019: unresolved external
> 2>symbol

> "public: static char const * __cdecl
> itk::GPUDemonsRegistrationFunctionKernel::GetOpenCLSource(void)"
> (?GetOpenCLSource at GPUDemonsRegistrationFunctionKernel@itk@@SAPEBDXZ)
> referenced in function "public: static char const * __cdecl
> itk::GPUDemonsRegistrationFunction<class itk::GPUImage<float,3>,class
> itk::GPUImage<float,3>,classitk::GPUImage<class
> itk::Vector<float,3>,3>
>> ::GetOpenCLSource(void)"
> (?GetOpenCLSource@?$GPUDemonsRegistrationFunction at V?$GPUImage at M$02 at itk
> @@V12@
> V?$GPUImage at V?$Vector at M$02 at itk@@$02 at 2@@itk@@SAPEBDXZ)
>
>
>
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/insight-users




 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20141205/f7225e20/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 43723 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/community/attachments/20141205/f7225e20/attachment-0001.png>
-------------- next part --------------
_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/insight-users


More information about the Community mailing list