InternalError: libdevice not found at ./libdevice.10.bc [Op:__inference_one_e_step_2806]


解决这个问题参考的是这篇回答

python - TensorFlow libdevice not found. Why is it not found in the searched path? - Stack Overflow

由于我使用的是windows下anaconda环境,所以需要根据这篇回答进行下修改

首先需要在C:\xx\anaconda3\envs\环境名\Library\bin下找到文件"libdevice.10.bc",复制该文件,在当前路径下创建一个“nvvm”的文件,点击进入“nvvm”,再创建一个文件“libdevice”,将“libdevice.10.bc”粘贴到“libdevice”下

其次在windows下的编辑系统环境变量,新建一个变量“XLA_FLAGS”,变量值为“--xla_gpu_cuda_data_dir=C:\xx\anaconda3\envs\环境名\Library\bin\nvvm\libdevice”

最后需要重启下虚拟环境

在运行后,可以找到libdevice,但出现了如下的错误

:E tensorflow/core/platform/windows/subprocess.cc:287] Call to CreateProcess failed. Error code: 2, command: '"ptxas.exe" "--version"'

:W tensorflow/stream_executor/gpu/asm_compiler.cc:80] Couldn't get ptxas version string: INTERNAL: Couldn't invoke ptxas.exe --version

: E tensorflow/core/platform/windows/subprocess.cc:287] Call to CreateProcess failed. Error code: 2, command: '"ptxas.exe" "~\AppData\Local\Temp\/tempfile-OMENZY-4cdc-21752-60c5cf2ceb660" "-o" "~\AppData\Local\Temp\/tempfile-OMENZY-4cdc-21752-60c5cf2cecd52" "-arch=sm_89" "--warn-on-spills"'

: F tensorflow/compiler/xla/service/gpu/nvptx_compiler.cc:453] ptxas returned an error during compilation of ptx to sass: 'INTERNAL: Failed to launch ptxas' If the error message indicates that a file could not be written, please verify that sufficient filesystem space is provided.

 [info] Dispose Kernel process 21752.

 [info] End cell 9 execution after -1702443180.579s, completed 

说无法获得ptxas的版本号,可以使用以下代码解决

conda install -c nvidia cuda-nvcc

该代码确保ptxas是在你的conda环境下运行的

  • 27
    点赞
  • 22
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值