cuda-samples icon indicating copy to clipboard operation
cuda-samples copied to clipboard

texture not a template?

Open es2ace opened this issue 1 year ago • 6 comments

Why, in cuda samples, projects with "texture" object, tell me errors with that: " texture is not a template "? for an example, in project simpleD3D10RenderTarget's "simpleD3D10RenderTarget_kernel.cu", and with other errors, like that: "identifier 'threadIdx' is undefined" ? I am using Visual Studio 2022 under windows 10, with cuda sdk 12.1 Many thanks in advanced for you replies.

ss

es2ace avatar Jun 21 '23 07:06 es2ace

Why, and, suppose that "texture" object can be replaced with "cudaTextureObject_t", the method "tex2DLayered" is still not recognized, like it in the module "simpleLayeredTexture.cu" in line 71? But, confused with that, in the line 189 of module "voumeRender_kernel.cu", "tex2DLayered" is OK? Debug into the definition of "tex2DLayered", can find the file "texture_indirect_functions.h", and include it into the module "simpleLayeredTexture.cu", "tex2DLayered" is still unrecognized?

Thanks again, if anyone can help me...

ss

es2ace avatar Jun 26 '23 02:06 es2ace

I met this issue also with both 2019 and 2022.

ztz0223 avatar Aug 07 '23 04:08 ztz0223

https://forums.developer.nvidia.com/t/texture-is-not-a-template/47442/5?u=adlinge.pa

As per this code is needs to be fixed for CUDA 12.2, suggested to use CUDA 11.x SDK

adlingepa avatar Sep 03 '23 18:09 adlingepa

It should be a version issue

zly5 avatar Oct 05 '23 02:10 zly5

Hello! I ran into this issue while trying to run the samples on my laptop. I have CUDA 12.4 installed and I'm using msbuild to compile the samples. All the other samples ran fine, but simpleD3D10RenderTarget_vs2022.vcxproj is throwing the texture is not a template error. On the main branch, the sample's vcxproj file seems to have been updated for CUDA 12.4, but I'm still running into this issue. Any idea why this might be happening? Thanks in advance!

Error trace:

"C:\Users\ew423\cuda-samples\Samples_VS2022.sln" (default target) (1) -> "C:\Users\ew423\cuda-samples\Samples\5_Domain_Specific\simpleD3D10RenderTarget\simpleD3D10RenderTarget_vs2022.vcxproj" (def ault target) (23) -> "C:\Users\ew423\cuda-samples\Samples\5_Domain_Specific\simpleD3D10RenderTarget\simpleD3D10RenderTarget_vs2022.vcxproj" (Cud aBuildCore target) (23:2) -> (CudaBuildCore target) -> C:\Users\ew423\cuda-samples\Samples\5_Domain_Specific\simpleD3D10RenderTarget\simpleD3D10RenderTarget_kernel.cu(53): erro r : texture is not a template [C:\Users\ew423\cuda-samples\Samples\5_Domain_Specific\simpleD3D10RenderTarget\simpleD3D10Ren derTarget_vs2022.vcxproj] C:\Users\ew423\cuda-samples\Samples\5_Domain_Specific\simpleD3D10RenderTarget\simpleD3D10RenderTarget_kernel.cu(129): err or : no instance of overloaded function "tex2D" matches the argument list [C:\Users\evely\cuda-samples\Samples\5_Domain_Spe cific\simpleD3D10RenderTarget\simpleD3D10RenderTarget_vs2022.vcxproj] C:\Users\ew423\cuda-samples\Samples\5_Domain_Specific\simpleD3D10RenderTarget\simpleD3D10RenderTarget_kernel.cu(195): err or : identifier "cudaBindTextureToArray" is undefined [C:\Users\evely\cuda-samples\Samples\5_Domain_Specific\simpleD3D10Ren derTarget\simpleD3D10RenderTarget_vs2022.vcxproj] C:\Users\ew423\cuda-samples\Samples\5_Domain_Specific\simpleD3D10RenderTarget\simpleD3D10RenderTarget_kernel.cu(205): err or : identifier "cudaUnbindTexture" is undefined [C:\Users\evely\cuda-samples\Samples\5_Domain_Specific\simpleD3D10RenderTa rget\simpleD3D10RenderTarget_vs2022.vcxproj] C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\BuildCustomizations\CUDA 12.4.targets(7 99,9): error MSB3721: The command ""C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\bin\nvcc.exe" -gencode=arch=co mpute_50,code="sm_50,compute_50" -gencode=arch=compute_52,code="sm_52,compute_52" -gencode=arch=compute_60,code="sm_60 ,compute_60" -gencode=arch=compute_61,code="sm_61,compute_61" -gencode=arch=compute_70,code="sm_70,compute_70" -gencod e=arch=compute_75,code="sm_75,compute_75" -gencode=arch=compute_80,code="sm_80,compute_80" -gencode=arch=compute_86,cod e="sm_86,compute_86" -gencode=arch=compute_89,code="sm_89,compute_89" -gencode=arch=compute_90,code="sm_90,compute_90
" --use-local-env -ccbin "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\bin\HostX86\x64 " -x cu -I./ -I../../../Common -I./ -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4/include" -I../../../Comm on -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\include" -G --keep-dir x64\Debug -maxrregcount=0 --mac hine 64 --compile -cudart static -Xcompiler "/wd 4819" --threads 0 -g -DWIN32 -DWIN32 -D_MBCS -D_MBCS -Xcompiler "/EHsc / W3 /nologo /Od /FS /Zi /RTC1 /MTd " -Xcompiler "/Fdx64/Debug/vc143.pdb" -o C:\Users\evely\cuda-samples\Samples\5_Domain_Spe cific\simpleD3D10RenderTarget\x64\Debug\simpleD3D10RenderTarget_kernel.cu.obj "C:\Users\evely\cuda-samples\Samples\5_Domain _Specific\simpleD3D10RenderTarget\simpleD3D10RenderTarget_kernel.cu"" exited with code -1. [C:\Users\evely\cuda-samples\Sam ples\5_Domain_Specific\simpleD3D10RenderTarget\simpleD3D10RenderTarget_vs2022.vcxproj]

ew423 avatar Apr 06 '24 17:04 ew423