OS: OSX 10.11.4
GPU: GeForce GT 750M, CUDA7.5
Language: Python Anaconda 2.7
I have followed theano's instructions to setup CUDA on my Mac:
I copied the code from theano website and pasted it into test.py file:
from theano import function, config, shared, sandbox
import theano.tensor as T
import numpy
import time
vlen = 10 * 30 * 768 # 10 x #cores x # threads per core
iters = 1000
rng = numpy.random.RandomState(22)
x = shared(numpy.asarray(rng.rand(vlen), config.floatX))
f = function([], T.exp(x))
print(f.maker.fgraph.toposort())
t0 = time.time()
for i in range(iters):
r = f()
t1 = time.time()
print("Looping %d times took %f seconds" % (iters, t1 - t0))
print("Result is %s" % (r,))
if numpy.any([isinstance(x.op, T.Elemwise) for x in f.maker.fgraph.toposort()]):
print('Used the cpu')
else:
print('Used the gpu')
But when I run this line:
THEANO_FLAGS='floatX=float32,device=gpu0,nvcc.fastmath=True' python test.py
I got this error:
nvcc fatal: The version ('70300') of the host compiler ('Apple clang') is not supported
and a warning looks like this:
WARNING (theano.sandbox.cuda): CUDA is installed, but device gpu0 is not available (error: cuda unavailable)
Is it something because of my Xcode version(it is Version 7.3)? How to solve this problem?
I fixed this error: "nvcc fatal: The version ('70300').." installing the last version of the CUDA SDK 7.5.27, for OSX 10.11.4