[Rtk-users] using >1 video cards

Boris Lahmadulin zagahulik at gmail.com
Sat Oct 15 03:30:55 EDT 2016


 Hello. I work with high resolution projections (32 mp) and reconstuction
takes some longstanding time. At the same time there are two video cards in
my computer, but uses only one. I wonder if i can use two video cards to
reduce reconstruction time.
What i tried to do in short:

- execute this script on newest rtk revisiion
for ($i in $(grep -nrl "cuCtxSetCurrent" utilities/ITKCudaCommon/*))
    echo "!$i"
    p="_"
    grep -vE "(cuCtxSetCurrent)" $i > $i$p
    mv $i$p $i
done
i.e. remove all lines where happens setting of video card context

- in rtkfdk.cxx by using posix threads create two threads, where i set
contexts through cuCtxSetCurrent(0) and cuCtxSetCurrentset(1)
correspondingly and wait for signals;
- in main thread for each working thread it created separated graphs, with
reader, ddf, pssf, constant   (which is splitted by two, i.e. dimension[1]
/= 2; origin+= ), fdk.
- then fdk pointers put to shared data, so working threads can use them.
After all signal is emmited  and fdk->update() is called at working threads
- since job is done, i copy two resulted subvolumes to one and save.

it works and reconstuction time is reduced for about 1.5 times! However, if
i run it a lot of times, finally it crashes with

img->GetRequestedRegion() = [ img->GetRequestedRegion() = [
ImageRegionImageRegion ( (0x7f45f02293600x7f45f0229360)
)
  Dimension:   Dimension: 0x30x3
  Index:
  Index: [[00, , 0x14d0x14d, , 0xcf0xcf]]
  Size:
  Size: [[0x3e8, 0x14f, 0x3e8, 0x1]0x14f,
 ]
img->GetLargestPossibleRegion() = [ 0x1ImageRegion (]0x7f45f0229328)

  Dimension:  ]
img->GetLargestPossibleRegion() = [ ImageRegion (0x30x7f45f0229328
)
  Index: [0, 0, 0]
  Size: [0x3e8, 0x29a, 0x1bc]
 ]
  Dimension: 0x3
  Index: [0, 0, 0]
  Size: [0x3e8, 0x29a, 0x1bc]
 ]
ExceptionObject caught with arg->fdk->Update() in file rtkfdk.cxx line
ExceptionObject caught with arg->fdk->Update() in file 242
rtkfdk.cxx line 242


itk::InvalidRequestedRegionError (itk::InvalidRequestedRegionError
(0x7f45d048a100)
0x7f45d85a9ee0)
Location: "unknown"
Location: "unknown"
File:
/home/koza/thirdparty/InsightToolkit-4.8.0/Modules/Core/Common/src/itkDataObject.cxx
Line: File:
/home/koza/thirdparty/InsightToolkit-4.8.0/Modules/Core/Common/src/itkDataObject.cxx
Line: 393
Description: Requested region is (at least partially) outside the largest
possible region.

393
Description: Requested region is (at least partially) outside the largest
possible region.


It seems that itk classes are not reenterable, Is there way to fix it ? Or
is there another way to make several video cards using for reconstuction in
parallel ?

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/rtk-users/attachments/20161015/c21af7e0/attachment-0009.html>


More information about the Rtk-users mailing list