CELL 1
# install the world of CUDA
!apt update -qq;
!wget https://developer.nvidia.com/compute/cuda/8.0/Prod2/local_installers/cuda-repo-ubuntu1604-8-0-local-ga2_8.0.61-1_amd64-deb;
!dpkg -i cuda-repo-ubuntu1604-8-0-local-ga2_8.0.61-1_amd64-deb;
!apt-key add /var/cuda-repo-8-0-local-ga2/7fa2af80.pub;
!apt-get update -qq;
!apt-get install cuda gcc-5 g++-5 -y -qq;
!ln -s /usr/bin/gcc-5 /usr/local/cuda/bin/gcc;
!ln -s /usr/bin/g++-5 /usr/local/cuda/bin/g++;
!apt install cuda-8.0;
CELL 2
!/usr/local/cuda/bin/nvcc --version
CELL 3
!pip install git+git://github.com/andreinechaev/nvcc4jupyter.git
CELL 4
# load the extension
%load_ext nvcc_plugin
CELL 5
!gcc --version
CELL 6
# this should work
%%cu
#include <stdio.h>
// this is a cell for CUDA code
int main()
{
printf("yes, it worked");
return 1;
}