When I am running a simple Theano application (it uses CUDA), I get:
mod.cu(3038): warning: conversion from a string literal to "char *" is deprecated
mod.cu(3041): warning: conversion from a string literal to "char *" is deprecated
/usr/include/c++/5/bits/locale_classes.h(789) (col. 20): internal error: assertion failed at: "/dvs/p4/build/sw/rel/gpu_drv/r340/r340_00/drivers/compiler_CUREL/edg/EDG_4.8/src/cp_gen_be.c", line 8408
1 catastrophic error detected in the compilation of "/tmp/tmpxft_0000085a_00000000-4_mod.cpp4.ii".
Compilation aborted.
Aborted (core dumped)
['nvcc', '-shared', '-O3', '-use_fast_math', '-m64', '-Xcompiler', '-DCUDA_NDARRAY_CUH=mc72d035fdf91890f3b36710688069b2e,-DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION,-fPIC,-fvisibility=hidden', '-Xlinker', '-rpath,/home/denplusplus/.theano/compiledir_Linux-3.19--generic-x86_64-with-Ubuntu-15.10-wily-x86_64-3.4.3+-64/cuda_ndarray', '-I/usr/local/lib/python3.4/dist-packages/Theano-0.7.0-py3.4.egg/theano/sandbox/cuda', '-I/usr/lib/python3/dist-packages/numpy/core/include', '-I/usr/include/python3.4m', '-I/usr/local/lib/python3.4/dist-packages/Theano-0.7.0-py3.4.egg/theano/gof', '-o', '/home/denplusplus/.theano/compiledir_Linux-3.19--generic-x86_64-with-Ubuntu-15.10-wily-x86_64-3.4.3+-64/cuda_ndarray/cuda_ndarray.so', 'mod.cu', '-L/usr/lib', '-lpython3.4m', '-lcublas', '-lcudart']
ERROR (theano.sandbox.cuda): Failed to compile cuda_ndarray.cu: ('nvcc return status', 134, 'for cmd', 'nvcc -shared -O3 -use_fast_math -m64 -Xcompiler -DCUDA_NDARRAY_CUH=mc72d035fdf91890f3b36710688069b2e,-DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION,-fPIC,-fvisibility=hidden -Xlinker -rpath,/home/denplusplus/.theano/compiledir_Linux-3.19--generic-x86_64-with-Ubuntu-15.10-wily-x86_64-3.4.3+-64/cuda_ndarray -I/usr/local/lib/python3.4/dist-packages/Theano-0.7.0-py3.4.egg/theano/sandbox/cuda -I/usr/lib/python3/dist-packages/numpy/core/include -I/usr/include/python3.4m -I/usr/local/lib/python3.4/dist-packages/Theano-0.7.0-py3.4.egg/theano/gof -o /home/denplusplus/.theano/compiledir_Linux-3.19--generic-x86_64-with-Ubuntu-15.10-wily-x86_64-3.4.3+-64/cuda_ndarray/cuda_ndarray.so mod.cu -L/usr/lib -lpython3.4m -lcublas -lcudart')
The program itself:
#!/usr/bin/env python3
import theano
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' % iters, t1 - t0, 'seconds')
print('Result is', 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')
It seems that CUDA 6.5 is the latest available for by GPU. It does not support GCC 5. Can you actually ask NVIDIA to update the 340th family of drivers to support GCC 5?