How to deal with ptxas : fatal error : Unresolved extern function 'cudaGetParameterBuffer'

Hi,

I’m trying to implement a dynamic parallelism programming. However, when I compile the code on VS 2008, I got an fatal error which told me Unresolved extern function ‘cudaGetParameterBuffer’. I went through the dynamic parallelism guide and found that it’s about the PTX. However, there is no examples to show me how to use declare it. Anybody has any ideas?

And there is a helloword simple example at the bottom of the dynamic parallelism guide. However, when I try to move that code to a new project and compile it. I get a pretty the same error which is “ptxas : fatal error : Unresolved extern function ‘cudaLaunchDevice’”.

Please give me some ideas, some specific examples will be highly appreciated.

Hi, could you provide your compile command-line?

Hi, actually, I just worked on visual studio 2008 and there was no command. I have set the compute and sm to 35. And I have also added the cudadevrt.lib to the project’s property.

Thanks

I had the same issue under Visual Studio 2010 (Unresolved extern function ‘cudaGetParameterBuffer’) and I have solved the problem in few steps.

  1. View -> Property Pages
  2. Configuration Properties -> CUDA C/C++ -> Common -> Generate Relocatable Device Code -> Yes (-rdc=true)
  3. Configuration Properties -> CUDA C/C++ -> Code Generation -> compute_35,sm_35
  4. Configuration Properties -> Linker -> Input -> Additional Dependencies -> cudadevrt.lib

Probably you were missing the second point.

The procedure above fixed my problem. Thank you very much!!

It really helps a lot. Thx

I was reading the Dynamic Parallelism programming guide and it says that Dynamic parallelism is only supported on devices of compute capability 3.5 and higher. Taking a look at Nvidia’s products, the only 3.5 device I could find is Tesla K20, which is not available in any of the stores in my area. Does anyone know what’s the best and cheapest way to start developing with dynamic parallelism?

You could try the GPU Test Drive program: http://www.nvidia.com/object/gpu-test-drive.html

Following these steps I resolved the initial issue of “Unresolved extern function”. However, now I face the following output message when trying to compile a CUDA project in VS 2015.

nvcc fatal : A single input file is required for a non-link phase when an outputfile is specified

I’ve seen a fair number of posts about this issue, but they all discuss changing the command line arguments, which, as zzzhe1990 mentioned earlier, we don’t have direct access to in Visual Studio. I’ve been stuck for two days trying to separate my CUDA functions into modular files!

Correct, that error message is indicative of an incorrectly formed sequence of nvcc command line arguments.

Turn on detailed logging in MSVS, extract the exact invocation of nvcc from the log, find the error in the sequence of command line arguments, then fix it.

This is the invocation:

“C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin\nvcc.exe” -dlink -o Debug\RBF.device-link.obj -Xcompiler “/EHsc /W3 /nologo /Od /Zi /RTC1 /MDd " -L"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\lib\Win32” cudart.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib cudadevrt.lib -dc -gencode=arch=compute_61,code=sm_61 -G --machine 32 Debug\kmeans.cu.obj Debug\source.cu.obj

However I’m unable to see any obvious errors…

Something is messed up in your project settings. -dc and -dlink don’t belong in the same command issued to nvcc.

If you’re unsure what to do, try inspecting an existing cuda dynamic parallelism sample project. In fact it may be easiest just to take one of those projects and setup your code in it.