我试图运行下面的代码,但报告错误:
NvvmSupportError:找不到libNVVM.执行conda install
cudatoolkit:找不到库nvvm
我的开发环境是:Ubuntu 17.04,Spyder/Python3.5,我通过conda(numba和cudatoolkit)安装.Nvidia GPU(GTX 1070和GTX 1060).
import numpy as np
from timeit import default_timer as timer
from numba import vectorize
@vectorize(["float32(float32, float32)"], target='cuda')
def VecADD(a,b):
return a+b
n = 32000000
a = np.ones (n, dtype=np.float32)
b = np.ones (n, dtype=np.float32)
c = np.zeros(n, dtype=np.float32)
start = timer()
C = VecADD(a,b)
print (timer() - start)
Run Code Online (Sandbox Code Playgroud)
有谁知道如何解决这个问题?