Compile error - undefined reference to cudaSetupArgument

Hello, I’m reasonably new to CUDA and am returning to complete a project that I began a few months ago. The problem I’m having is compiling my project.

The code written a few months ago previously compiled and will run on the given machine (a fresh Ubuntu 18.04 machine). The machine’s GPU is a 1070ti and I believe the drivers are correctly installed however when the code (new code or the previous last version of compiled code) is recompiled the process produces a compile error.

The compile error is itself very hard to read but some portions appear legible - such as:

  • undefined reference to `cudaSetupArgument’
  • undefined reference to `cudaLaunch’
  • In function `cudaError cudaLaunch(char*)':

Background:

  1. I have followed the post install instructions for Ubuntu as listed here

  2. The fresh ubuntu machine has a directory structure for cuda that seems to identify cuda as 11.3 (for example the directory structure appears as /usr/local/cuda-11.3

  3. nvcc --version returns the cuda compilation tools as release 9.1, V9.1.85

  4. The compile failure happens when I link some of my previous .cu files. The error occurs even when the code contained within a linked function is completely commented out and it only happens with some functions or linked files - which is completely baffling.

Thanks in advance for all of your help - I’m totally stuck!!

see here

cudaLaunch was deprecated and subsequently removed (also cudaSetupArgument). If you try to build code that uses those (not sure why you are using those) with an older CUDA version, e.g. 9.1 it may build OK. If you use CUDA 11.3, it will not. Those APIs have been removed.

If you’re wondering why nvcc --version returns what it does, you may wish to read the linux install guide mandatory post-install actions.

Robert,

Thanks for the info. I believe I performed the post install actions but maybe I missed something - thanks for the note on the depreciation.

Yes, if you are linking objects previously compiled with e.g. nvcc 9 but now linking those objects using nvcc 11, that could probably cause the issue.

If you’re not calling those functions from your code, then you shouldn’t need to roll back anything. The right thing to do is recompile all your objects using a consistent tool chain. If you were using gnu autotools and a proper Makefile, the advice at this point would be to make clean then make.

Regarding this:

and with respect to this:

If observations 2 and 3 refer to the same machine, and that is the machine for which you believe you have followed the post install instructions, then I would say either you haven’t or your don’t understand those instructions. It’s also curious to me that a “fresh install Ubuntu” on which you installed CUDA 11.3 would also have CUDA 9.x, but I digress.

1 Like