OpenBMB / cpm_kernels

Apache License 2.0
23 stars 7 forks source link

Library cudart is not initialized #12

Open woaipichuli opened 10 months ago

woaipichuli commented 10 months ago

运行如下代码报错

from cpm_kernels import library <module 'cpm_kernels.library.cudart' from '/usr/local/lib/python3.9/site-packages/cpm_kernels/library/cudart.py'> library.cudart.cudaGetDevice() Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.9/site-packages/cpm_kernels/library/base.py", line 72, in wrapper raise RuntimeError("Library %s is not initialized" % self.__name) RuntimeError: Library cudart is not initialized exit()

采用docker容器启动,宿主机的驱动情况如下: image 容器内安装了pytorch对应的cudatoolkit: nvidia-cublas-cu11 11.10.3.66 nvidia-cuda-nvrtc-cu11 11.7.99 nvidia-cuda-runtime-cu11 11.7.99 nvidia-cudnn-cu11 8.5.0.96 尝试了将容器内的libcudart.so.11.0添加到环境变量LD_LIBRARY_PATH,但貌似并不是这个引起的报错