InsightSoftwareConsortium / ITK

Insight Toolkit (ITK) -- Official Repository. ITK builds on a proven, spatially-oriented architecture for processing, segmentation, and registration of scientific images in two, three, or more dimensions.
https://itk.org
Apache License 2.0
1.37k stars 660 forks source link

itkGPUDemonsRegistrationFilterTest.cxx error! #1826

Open caipinjia opened 4 years ago

caipinjia commented 4 years ago

Dear author

 I can't run "itkGPUDemonsRegistrationFilterTest.cxx" successfully,with some error log info:

Available tests:

  1. itkGPUDemonsRegistrationFilterTest
  2. itkGPUDemonsRegistrationFilterTest2 To run a test, enter the test number: 0

    Starting GPU Demons Platform : NVIDIA CUDA GeForce GTX 1080 Maximum Work Item Sizes : { 1024, 1024, 64 } Maximum Work Group Size : 1024 Alignment in bits of the base address : 4096 Smallest alignment in bytes for any data type : 128 cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_fp64 cl_khr_byte_addressable_store cl_khr_icd cl_khr_gl_sharing cl_nv_compiler_options cl_nv_device_attribute_query cl_nv_pragma_unroll cl_nv_d3d10_sharing cl_khr_d3d10_sharing cl_nv_d3d11_sharing cl_nv_copy_opts cl_nv_create_buffer cl_khr_int64_base_atomics cl_khr_int64_extended_atomics Defines: #define DIM_2

    define BUFPIXELTYPE float

    define OUTPIXELTYPE float

    define PIXELDIM 2

Defines: #define DIM_2

define OUTPIXELTYPE float

Defines: #define DIM_2

define IMGPIXELTYPE float

define BUFPIXELTYPE float

define OUTPIXELTYPE float

Defines: #define blockSize 128

define nIsPow2 1

define T int

Defines: #define blockSize 128

define nIsPow2 1

define T float

Defines: #define blockSize 128

define nIsPow2 1

define T float

Debug: In E:\ITK\ITK-5.0.1\Modules\Registration\GPUPDEDeformable\test\itkGPUDemonsRegistrationFilterTest.cxx, line 66 Object (000000D7BEBEEEE0): Progress: 0 Iter: 0 Metric: 1.79769e+308 RMSChange: 0

Debug: In E:\ITK\ITK-5.0.1\Modules\Registration\GPUPDEDeformable\test\itkGPUDemonsRegistrationFilterTest.cxx, line 66 Object (000000D7BEBEEEE0): Progress: 0.002 Iter: 1 Metric: 211.118 RMSChange: 0.279633

GPU InitTime in seconds = 0.0182793 GPU ComputeUpdateTime in seconds = 0.00183034 GPU ApplyUpdateTime in seconds = 7.00951e-05 GPU SmoothFieldTime in seconds = 0.00192523 Debug: In E:\ITK\ITK-5.0.1\Modules\Core\Common\src\itkObject.cxx, line 609 Object (000000D7BEBEEEE0): Destructing!

WARNING: In E:\ITK\ITK-5.0.1\Modules\Core\Common\src\itkLightObject.cxx, line 206 LightObject (000000D7BEBEEEE0): Trying to delete object with non-zero reference count.

Finished GPU Demons

dzenanz commented 4 years ago

Are you invoking it using ctest or directly?

caipinjia commented 4 years ago

I want to compare the speed of demons deformable registration in cpu and gpu.so I download the ITK-5.0.1.zip in github and get the makefile with CMake,then I open the makefile and run ITKGPUDEDeformableRegistrationDriver project and select itkGPUDemonsRegistrationFilterTest.cxx file,I used two JPG images as fixedImage and movingImage.itkGPUDemonsRegistrationFilterTest can run "itkGPUDemons" function and "itkCPUDemons" function with the same input file.finally, I found that itkCPUDemons can output an right result but itkGPUDemons can't output an right result.

dzenanz commented 4 years ago

When I run it this is what I get:

---------------------------------------------------
Starting GPU Demons
Platform  : Intel(R) OpenCL
Total # of platform : 2
Platform 0 : Intel(R) OpenCL
Platform 1 : NVIDIA CUDA
Quadro K620
Maximum Work Item Sizes : { 1024, 1024, 64 }
Maximum Work Group Size : 1024
Alignment in bits of the base address : 4096
Smallest alignment in bytes for any data type : 128
cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_fp64 cl_khr_byte_addressable_store cl_khr_icd cl_khr_gl_sharing cl_nv_compiler_options cl_nv_device_attribute_query cl_nv_pragma_unroll cl_nv_d3d10_sharing cl_khr_d3d10_sharing cl_nv_d3d11_sharing cl_nv_copy_opts cl_khr_gl_event cl_nv_create_buffer
GPU InitTime in seconds = 0.0159812
GPU ComputeUpdateTime in seconds = 0.0506721
GPU ApplyUpdateTime in seconds = 0.00214624
GPU SmoothFieldTime in seconds = 0.0499353
WARNING: In C:\Dev\ITK-git\Modules\Core\Common\src\itkLightObject.cxx, line 196
LightObject (0000005C870FF620): Trying to delete object with non-zero reference count.

Finished GPU Demons
---------------------------------------------------
Starting CPU Demons
WARNING: In C:\Dev\ITK-git\Modules\Core\Common\src\itkLightObject.cxx, line 196
LightObject (0000005C870FF630): Trying to delete object with non-zero reference count.

Finished CPU Demons
Average GPU registration time in seconds = 0.252992
Average CPU registration time in seconds = 0.625613
Maximum displacement difference = 1.78478
Average displacement difference = 0.312757
Test passed

There is a warning, but the test completes successfully.

caipinjia commented 4 years ago

Tanks you for your reply

my input is: argv[1] = "2";   argv[2] = "5000";   argv[3] = "D:\Desktop\deletTestGPU\fixedImage.jpg";   argv[4] = "D:\Desktop\deletTestGPU\movingImage.jpg";   argv[5] = "D:\Desktop\deletTestGPU\rgistImage.jpg";

fixedImage.jpg

movingImage.jpg

I would like to know what's your input,I'm not sure my input file is correct,so I want to know what your input is.

I have another question: I want to use ITK rigid registration with GPU too.I found the "itkGPUDemonsRegistrationFilter" class with deformable registration,but I don't know how to perform rigid registration with GPU.Do you have some suggestions?

------------------ 原始邮件 ------------------ 发件人: "Dženan Zukić"<notifications@github.com>; 发送时间: 2020年5月18日(星期一) 晚上9:45 收件人: "InsightSoftwareConsortium/ITK"<ITK@noreply.github.com>; 抄送: "才品嘉"<249032661@qq.com>;"Author"<author@noreply.github.com>; 主题: Re: [InsightSoftwareConsortium/ITK] itkGPUDemonsRegistrationFilterTest.cxx error! (#1826)

When I run it this is what I get: --------------------------------------------------- Starting GPU Demons Platform : Intel(R) OpenCL Total # of platform : 2 Platform 0 : Intel(R) OpenCL Platform 1 : NVIDIA CUDA Quadro K620 Maximum Work Item Sizes : { 1024, 1024, 64 } Maximum Work Group Size : 1024 Alignment in bits of the base address : 4096 Smallest alignment in bytes for any data type : 128 cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_fp64 cl_khr_byte_addressable_store cl_khr_icd cl_khr_gl_sharing cl_nv_compiler_options cl_nv_device_attribute_query cl_nv_pragma_unroll cl_nv_d3d10_sharing cl_khr_d3d10_sharing cl_nv_d3d11_sharing cl_nv_copy_opts cl_khr_gl_event cl_nv_create_buffer GPU InitTime in seconds = 0.0159812 GPU ComputeUpdateTime in seconds = 0.0506721 GPU ApplyUpdateTime in seconds = 0.00214624 GPU SmoothFieldTime in seconds = 0.0499353 WARNING: In C:\Dev\ITK-git\Modules\Core\Common\src\itkLightObject.cxx, line 196 LightObject (0000005C870FF620): Trying to delete object with non-zero reference count. Finished GPU Demons --------------------------------------------------- Starting CPU Demons WARNING: In C:\Dev\ITK-git\Modules\Core\Common\src\itkLightObject.cxx, line 196 LightObject (0000005C870FF630): Trying to delete object with non-zero reference count. Finished CPU Demons Average GPU registration time in seconds = 0.252992 Average CPU registration time in seconds = 0.625613 Maximum displacement difference = 1.78478 Average displacement difference = 0.312757 Test passed
There is a warning, but the test completes successfully.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.