The problem with undefined references to the functions is because you don't link libcuda library using -lcuda. The guide at How can I get nVidia CUDA or OpenCL working on a laptop with nVidia discrete card/Intel Integrated Graphics? mentions that you should remove -lcuda at one place in common.mk, but that did not work for me. But, as the compiler couldn't find the library, it is important to add the directory, where the library is located, so that the corresponding line in common.mk (it is line 276 for me) looks like
LIB += -L/usr/lib/nvidia-current -lcuda $(RENDERCHECKGLLIB) ${OPENGLLIB} $(PARAMGLLIB) ${LIB}
Similar correction had to be done in the Makefile of the src/deviceQuery folder, last line, changing
LIB += -lcuda
to
LIB += -L/usr/lib/nvidia-current -lcuda
Hope that helps!
I have a pc with an old Geforce 6800 card and I have managed to successfully install the 32bit Nvidia 304.137 driver for it on Lubuntu 18.04; all thanks to a community patch. Here is the procedure.
Install build tools
$ sudo apt install gcc make build-essential gcc-multilib dkms mesa-utils
Download driver from https://www.nvidia.com/Download/driverResults.aspx/123708/en-us
Download patch from https://adufray.com/nvidia-304.137-bionic-18.04.patch
Extract archive, place patch into extracted folder and apply patch
$ ./NVIDIA-Linux-x86_64-304.137.run -x
$ cd ./NVIDIA-Linux-x86_64-304.137
$ patch -p1 < nvidia-304.137-bionic-18.04.patch
Disable nouveau driver and reboot
$ sudo -i
# cat << END > /etc/modprobe.d/disable-nouveau.conf
blacklist nouveau
blacklist vga16fb
blacklist rivafb
blacklist nvidiafb
blacklist rivatv
blacklist amd76_edac
options nouveau modeset=0
END
# update-initramfs -u
# reboot
Stop x-server
Logout
Bring up terminal with Ctrl-Alt-F1, login
$ sudo -i
# service lightdm stop
# init 3
Install NVidia driver
Ignore the first warning about preinstall failing, agree to driver recompilation on kernel update and to configuration files update. Reboot.
# ./nvidia-installer
# reboot
Driver should be working now. Check with the following:
$ lshw -c video 2>&1 | grep driver
Should output "configuration: driver=nvidia"
There is one small problem though. Apparently Nvidia driver installs it's own version of libvdpau, which does not work with mplayer. That's why we need to forcefully reinstall libvdpau (and possibly need to do this on kernel update, because driver will recompile and reinstall it's own, non-functioning version for this library?)
$ sudo apt --reinstall install libvdpau1
References:
Compiling nVidia 304.137 on Ubuntu 18.04: https://adufray.com/blog/2018/06/02/nvidia-304-127-on-bionic
How to install NVIDIA.run?: How to install NVIDIA.run?
PS: This post is basically a duplicate of my post at ubuntu-mate.community, but since installing 304 Nvidia driver on Lubuntu 18.04 is a very common problem, I have decided to make additional post on askubuntu.
Best Answer
Option 1: apt-get
Install unmet dependencies
Install main package
Option 2: aptitude
Install aptitude
Install main package