Make everything compatible for OSX, choose CUDA only if it's found