gpt4 book ai didi

由于在环境中设置 NUMBA_DISABLE_CUDA=1,python-CUDA 被禁用

转载 作者:行者123 更新时间:2023-12-01 01:53:46 27 4
gpt4 key购买 nike

这是我第一次尝试在 python 中使用 cuda,所以我跟进了一些有关如何设置它的教程......但我最终遇到了这个错误:

numba.cuda.cudadrv.error.CudaSupportError: Error at driver init: 
CUDA is disabled due to setting NUMBA_DISABLE_CUDA=1 in the environment, or because CUDA is unsupported on 32-bit systems.:

我正在运行 x64 Windows 版本,并且我也检查了 python 版本(也在 x64 上)。我使用的是 Nvidia gtx 960m,带有最新的驱动程序。

我已经尝试搜索这个问题两个多星期了,但没有找到任何可能有效的解决方案

我也会在这里插入代码,但我不认为这是问题所在:

@vectorize(["float32(float32, float32)"], target='cuda')
def test(a,b):
return a+b

def main():

a=np.arange(1,10,dtype=np.float32)
b=np.arange(11,20,dtype=np.float32)
c=np.zeros(9, dtype=np.float32)

c=test(a,b)

print(c)

main()

最佳答案

I am runnig [sic] a x64 Windows version and i've [sic] checked the python version too (which is also on x64). I am using a Nvidia gtx 960m, with the latest drivers.

尽管如此,您的 Python 解释器仍然是 32 位。这在 print(tuple.__itemsize__) 返回 4 的注释中得到了证实。对于 64 位 Python 解释器,它将返回 8。

可以清楚地看到here NUMBA_DISABLE_CUDA 只能在 Numba 中设置(如果在主机环境中设置),或者通过 32 位 Python 解释器进行设置,并且由 tuple.__itemsize__ 的值确定努巴内。本例属于后者。

I've tried to search for this problem for over two weeks now, but didn't find any solution that might work

没有解决方案,因为任何足以与 Numba 一起使用的新版本 CUDA 都不支持 Windows 上的 32 位环境。这在 Windows 平台上很久以前就被弃用了。您唯一的办法是安装 Anaconda 的 native 64 位版本以及 64 位 Python 解释器和相关库。

关于由于在环境中设置 NUMBA_DISABLE_CUDA=1,python-CUDA 被禁用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50451056/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com