I have installed CUDA 8.0.61 and I run python on Ubuntu 16.04.3.
The code is available on-line so that it should not be wrong.
However, I got the error message below:
RuntimeError: ‘nvcc’ command returns non-zero exit status.
command: [‘nvcc’, ‘–cubin’, ‘-arch’, ‘sm_61’, ‘/tmp/tmpsiw3X0/kern.cu’]
return-code: 1
stdout/stderr:
nvcc fatal : Value ‘sm_61’ is not defined for option ‘gpu-architecture’
I suspect you have an older version of CUDA installed on your machine somewhere, and python is picking up that older version.
Find all instances of nvcc on your machine:
sudo find / -name nvcc
Make sure you have set the PATH variable correctly for your CUDA 8.0.61 install. (Compare the path to your 8.0.61 nvcc from the output above, with echo $PATH)