# About GPU Version Compilation of RTK

**URL:** https://discourse.itk.org/t/about-gpu-version-compilation-of-rtk/5905
**Category:** Engineering
**Created:** [April 28, 2023, 8:11am UTC](https://discourse.itk.org/t/about-gpu-version-compilation-of-rtk/5905 "2023-04-28T08:11:30Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![ma1282029525](https://discourse.itk.org/user_avatar/discourse.itk.org/ma1282029525/32/3084_2.png) [@ma1282029525](https://discourse.itk.org/u/ma1282029525)
#### Post date: [April 28, 2023, 8:11am UTC](https://discourse.itk.org/t/about-gpu-version-compilation-of-rtk/5905/1 "2023-04-28T08:11:30Z")

</div>

Recently, I have been learning RTK, and there are no issues with the CPU version compilation. However, after installing Cuda, I marked RTK in the cmake option\_ USE\_ CUDA, I can’t compile it anymore. I am sure Cuda has been installed and tested on my computer

```auto
>D:\RTK-2.4.1\src\rtkCudaForwardWarpImageFilter.cu(152): error : no instance of overloaded function "tex1Dfetch" matches the argument list
8> argument types are: (<error-type>, int)
8>D:\RTK-2.4.1\src\rtkCudaDisplacedDetectorImageFilter.cu(96): error : no instance of overloaded function "tex1Dfetch" matches the argument list
8> argument types are: (<error-type>, int)
8>
8>D:\RTK-2.4.1\src\rtkCudaDisplacedDetectorImageFilter.cu(155): error : identifier "cudaBindTexture" is undefined
8>
8>D:\RTK-2.4.1\src\rtkCudaDisplacedDetectorImageFilter.cu(185): error : identifier "cudaUnbindTexture" is undefined
8>
8>
8>7 errors detected in the compilation of "D:/RTK-2.4.1/src/rtkCudaDisplacedDetectorImageFilter.cu".
8>10 errors detected in the compilation of "D:/RTK-2.4.1/src/rtkCudaFDKWeightProjectionFilter.cu".
8>D:\RTK-2.4.1\src\rtkCudaForwardWarpImageFilter.cu(152): error : no instance of overloaded function "tex1Dfetch" matches the argument list
8> argument types are: (<error-type>, int)
8>Compiling CUDA source file ..\..\RTK-2.4.1\src\rtkCudaLaplacianImageFilter.cu...
8>
8>D:\RTK-2.4.1\src\rtkCudaForwardWarpImageFilter.cu(153): error : no instance of overloaded function "tex1Dfetch" matches the argument list
8> argument types are: (<error-type>, int)
8>
8>D:\RTK-2.4.1\src\rtkCudaForwardWarpImageFilter.cu(153): error : no instance of overloaded function "tex1Dfetch" matches the argument list
8> argument types are: (<error-type>, int)
8>
8>D:\RTK-2.4.1\src\rtkCudaForwardWarpImageFilter.cu(158): error : no instance of overloaded function "tex3D" matches the argument list
8> argument types are: (<error-type>, float, float, float)
8>
8>D:\RTK-2.4.1\src\rtkCudaForwardWarpImageFilter.cu(159): error : no instance of overloaded function "tex3D" matches the argument list
8> argument types are: (<error-type>, float, float, float)
8>
8>D:\RTK-2.4.1\src\rtkCudaForwardWarpImageFilter.cu(160): error : no instance of overloaded function "tex3D" matches the argument list
8> argument types are: (<error-type>, float, float, float)
8>
8>D:\RTK-2.4.1\src\rtkCudaForwardWarpImageFilter.cu(164): error : no instance of overloaded function "tex1Dfetch" matches the argument list
8> argument types are: (<error-type>, int)
8>
8>D:\RTK-2.4.1\src\rtkCudaForwardWarpImageFilter.cu(164): error : no instance of overloaded function "tex1Dfetch" matches the argument list
8> argument types are: (<error-type>, int)
8>
8>D:\RTK-2.4.1\src\rtkCudaForwardWarpImageFilter.cu(165): error : no instance of overloaded function "tex1Dfetch" matches the argument list
8>rtkCudaDisplacedDetectorImageFilter.cu
8> argument types are: (<error-type>, int)
8>
8>D:\RTK-2.4.1\src\rtkCudaForwardWarpImageFilter.cu(165): error : no instance of overloaded function "tex1Dfetch" matches the argument list
8> argument types are: (<error-type>, int)
8>
8>D:\RTK-2.4.1\src\rtkCudaForwardWarpImageFilter.cu(166): error : no instance of overloaded function "tex1Dfetch" matches the argument list
8> argument types are: (<error-type>, int)
8>
8>D:\RTK-2.4.1\src\rtkCudaForwardWarpImageFilter.cu(166): error : no instance of overloaded function "tex1Dfetch" matches the argument list
8> argument types are: (<error-type>, int)
8>
8>D:\RTK-2.4.1\src\rtkCudaForwardWarpImageFilter.cu(167): error : no instance of overloaded function "tex1Dfetch" matches the argument list
8> argument types are: (<error-type>, int)
8>
8>D:\RTK-2.4.1\src\rtkCudaForwardWarpImageFilter.cu(167): error : no instance of overloaded function "tex1Dfetch" matches the argument list
8>rtkCudaFDKWeightProjectionFilter.cu
8> argument types are: (<error-type>, int)
8>
8>D:\RTK-2.4.1\src\rtkCudaForwardWarpImageFilter.cu(168): error : no instance of overloaded function "tex1Dfetch" matches the argument list
8> argument types are: (<error-type>, int)
8>
8>D:\RTK-2.4.1\src\rtkCudaForwardWarpImageFilter.cu(168): error : no instance of overloaded function "tex1Dfetch" matches the argument list
8> argument types are: (<error-type>, int)
8>
8>D:\RTK-2.4.1\src\rtkCudaForwardWarpImageFilter.cu(169): error : no instance of overloaded function "tex1Dfetch" matches the argument list
8> argument types are: (<error-type>, int)
8>
8>D:\RTK-2.4.1\src\rtkCudaForwardWarpImageFilter.cu(169): error : no instance of overloaded function "tex1Dfetch" matches the argument list
8> argument types are: (<error-type>, int)
8>
8>D:\RTK-2.4.1\src\rtkCudaForwardWarpImageFilter.cu(178): error : no instance of overloaded function "tex1Dfetch" matches the argument list
8> argument types are: (<error-type>, int)
8>
8>D:\RTK-2.4.1\src\rtkCudaForwardWarpImageFilter.cu(179): error : no instance of overloaded function "tex1Dfetch" matches the argument list
8> argument types are: (<error-type>, int)
8>
8>D:\RTK-2.4.1\src\rtkCudaForwardWarpImageFilter.cu(180): error : no instance of overloaded function "tex1Dfetch" matches the argument list
8> argument types are: (<error-type>, int)
8>
8>D:\RTK-2.4.1\src\rtkCudaForwardWarpImageFilter.cu(181): error : no instance of overloaded function "tex1Dfetch" matches the argument list
8> argument types are: (<error-type>, int)
8>
8>D:\RTK-2.4.1\src\rtkCudaForwardWarpImageFilter.cu(182): error : no instance of overloaded function "tex1Dfetch" matches the argument list
8> argument types are: (<error-type>, int)
8>
8>D:\RTK-2.4.1\src\rtkCudaForwardWarpImageFilter.cu(183): error : no instance of overloaded function "tex1Dfetch" matches the argument list
8> argument types are: (<error-type>, int)
8>
8>D:\RTK-2.4.1\src\rtkCudaForwardWarpImageFilter.cu(184): error : no instance of overloaded function "tex1Dfetch" matches the argument list
8> argument types are: (<error-type>, int)
8>
8>D:\RTK-2.4.1\src\rtkCudaForwardWarpImageFilter.cu(185): error : no instance of overloaded function "tex1Dfetch" matches the argument list
8> argument types are: (<error-type>, int)
8>
8>D:\RTK-2.4.1\src\rtkCudaForwardWarpImageFilter.cu(186): error : no instance of overloaded function "tex1Dfetch" matches the argument list
8> argument types are: (<error-type>, int)
8>
8>D:\RTK-2.4.1\src\rtkCudaForwardWarpImageFilter.cu(187): error : no instance of overloaded function "tex1Dfetch" matches the argument list
8> argument types are: (<error-type>, int)
8>
8>D:\RTK-2.4.1\src\rtkCudaForwardWarpImageFilter.cu(188): error : no instance of overloaded function "tex1Dfetch" matches the argument list
8> argument types are: (<error-type>, int)
8>
8>D:\RTK-2.4.1\src\rtkCudaForwardWarpImageFilter.cu(189): error : no instance of overloaded function "tex1Dfetch" matches the argument list
8> argument types are: (<error-type>, int)
8>
8>D:\RTK-2.4.1\src\rtkCudaForwardWarpImageFilter.cu(326): error : no instance of overloaded function "tex1Dfetch" matches the argument list
8> argument types are: (<error-type>, int)
8>
8>D:\RTK-2.4.1\src\rtkCudaForwardWarpImageFilter.cu(326): error : no instance of overloaded function "tex1Dfetch" matches the argument list
8> argument types are: (<error-type>, int)
8>
8>D:\RTK-2.4.1\src\rtkCudaForwardWarpImageFilter.cu(327): error : no instance of overloaded function "tex1Dfetch" matches the argument list
8> argument types are: (<error-type>, int)
8>
8>D:\RTK-2.4.1\src\rtkCudaForwardWarpImageFilter.cu(327): error : no instance of overloaded function "tex1Dfetch" matches the argument list
8> argument types are: (<error-type>, int)
8>
8>D:\RTK-2.4.1\src\rtkCudaForwardWarpImageFilter.cu(328): error : no instance of overloaded function "tex1Dfetch" matches the argument list
8> argument types are: (<error-type>, int)
8>
8>D:\RTK-2.4.1\src\rtkCudaForwardWarpImageFilter.cu(328): error : no instance of overloaded function "tex1Dfetch" matches the argument list
8> argument types are: (<error-type>, int)
8>

```

Here are some error messages

 ![image](https://discourse.itk.org/uploads/default/original/2X/9/9345cfb2b0a65cd3e866b4b6bb3f1aae84c171df.png)

---

<div class="post-metadata">

### Author: ![ma1282029525](https://discourse.itk.org/user_avatar/discourse.itk.org/ma1282029525/32/3084_2.png) [@ma1282029525](https://discourse.itk.org/u/ma1282029525)
#### Post date: [April 28, 2023, 8:24am UTC](https://discourse.itk.org/t/about-gpu-version-compilation-of-rtk/5905/2 "2023-04-28T08:24:16Z")

</div>

[itk-module-init.cmake](https://discourse.itk.org/uploads/short-url/1padJV9vhORrZxiwHWDATFIuGch.cmake) (2.1 KB)

When I check RTK\_ CUDA\_ Cmake does not pass during VERSION

CMake Error at Modules/Remote/RTK/itk-module-init.cmake:42 (find\_package):  
find\_package called with invalid argument “ON”  
Call Stack (most recent call first):  
CMake/ITKModuleEnablement.cmake:338 (include)  
CMakeLists.txt:517 (include)

---

<div class="post-metadata">

### Author: ![simon.rit](https://discourse.itk.org/letter_avatar_proxy/v4/letter/s/f08c70/32.png) [@simon.rit](https://discourse.itk.org/u/simon.rit)
#### Post date: [April 28, 2023, 11:02am UTC](https://discourse.itk.org/t/about-gpu-version-compilation-of-rtk/5905/3 "2023-04-28T11:02:31Z")

</div>

Let’s focus on the configure error. `RTK_CUDA_VERSION` should be set with a CUDA version, e.g., 11.6. But you don’t have to set it, you can leave it empty.

---

<div class="post-metadata">

### Author: ![ma1282029525](https://discourse.itk.org/user_avatar/discourse.itk.org/ma1282029525/32/3084_2.png) [@ma1282029525](https://discourse.itk.org/u/ma1282029525)
#### Post date: [April 28, 2023, 11:24am UTC](https://discourse.itk.org/t/about-gpu-version-compilation-of-rtk/5905/4 "2023-04-28T11:24:35Z")

</div>

When I didn’t tick RTK\_CUDA\_VERSION , it was the compilation error in my question, do you know how to fix it？

---

<div class="post-metadata">

### Author: ![ma1282029525](https://discourse.itk.org/user_avatar/discourse.itk.org/ma1282029525/32/3084_2.png) [@ma1282029525](https://discourse.itk.org/u/ma1282029525)
#### Post date: [April 28, 2023, 1:33pm UTC](https://discourse.itk.org/t/about-gpu-version-compilation-of-rtk/5905/5 "2023-04-28T13:33:27Z")

</div>

help me

---

<div class="post-metadata">

### Author: ![ma1282029525](https://discourse.itk.org/user_avatar/discourse.itk.org/ma1282029525/32/3084_2.png) [@ma1282029525](https://discourse.itk.org/u/ma1282029525)
#### Post date: [April 29, 2023, 1:16am UTC](https://discourse.itk.org/t/about-gpu-version-compilation-of-rtk/5905/6 "2023-04-29T01:16:46Z")

</div>

my cuda version is 12.0

---

<div class="post-metadata">

### Author: ![ma1282029525](https://discourse.itk.org/user_avatar/discourse.itk.org/ma1282029525/32/3084_2.png) [@ma1282029525](https://discourse.itk.org/u/ma1282029525)
#### Post date: [May 1, 2023, 3:37am UTC](https://discourse.itk.org/t/about-gpu-version-compilation-of-rtk/5905/7 "2023-05-01T03:37:03Z")

</div>

I sovled this by change cuda version to 11.6

---

<div class="post-metadata">

### Author: ![simon.rit](https://discourse.itk.org/letter_avatar_proxy/v4/letter/s/f08c70/32.png) [@simon.rit](https://discourse.itk.org/u/simon.rit)
#### Post date: [May 1, 2023, 7:11am UTC](https://discourse.itk.org/t/about-gpu-version-compilation-of-rtk/5905/8 "2023-05-01T07:11:37Z")

</div>

Thanks for letting me know, I’ll try to have a look this week at what’s going with Cuda 12. I have never tested it myself.

---

<div class="post-metadata">

### Author: ![mzukovec](https://discourse.itk.org/user_avatar/discourse.itk.org/mzukovec/32/2732_2.png) [@mzukovec](https://discourse.itk.org/u/mzukovec)
#### Post date: [May 5, 2023, 2:43pm UTC](https://discourse.itk.org/t/about-gpu-version-compilation-of-rtk/5905/9 "2023-05-05T14:43:02Z")

</div>

CUDA 12 removed some long deprecated functionalities (see the deprecation warnings in CUDA 11), lots of them being related to textures.
