NVIDIA driver and Ubuntu: How to fix blackscreen after kernel update!

If you use the Nvidia driver and updated your kernel, it’s possible that you run into a blackscreen after boot.
There are two solutions to solve this issue:

Solution 1:
1. Boot into GRUB by pressing “shift” during boot.
2. Edit the starting command by pressing “e“.
3. Add “nomodeset” before “quiet splash“.
4. Press “Ctrl-x” to boot.
You should now see the GUI and be able to reinstall the Nvidia driver correctly.
5. Disable lightdm and reinstall the Nvidia driver.

Solution 2:
If the solution above didn’t work for you, try these steps:
1. Boot into GRUB by pressing shift during boot.
2. Chose the recovery mode.
3. Choose “root” to go into the root shell
4. To leave read only mode enter “mount -o remount,rw /”
5. Remove all installed nvidia packages using “sudo apt-get remove –purge nvidia-*”
6. Continue following the stept mentioned at solution 1.

NVIDIA and libfreenect2: How to fix undefined reference to ‘clReleaseDevice’ and ‘clRetainDevice’

Because AMD and Nvidia provide different versions of the OpenCL header, the following error can occur compiling a program using libfreenect2 and a Nvidia GPU.

/usr/local/lib/libfreenect2.so: undefined reference to `clReleaseDevice'
/usr/local/lib/libfreenect2.so: undefined reference to `clRetainDevice'

This error can be fixed by installing:

sudo apt-get install ocl-icd-opencl-dev

After the installation, the undefined reference should be fixed.

Update: If the problem occurs compiling a catkin package, it might be solved by reinitializing the catkin workspace.