[英]TensorFlow cannot find integrated GPU
我正在嘗試在具有集成顯卡和獨立顯卡的機器上的集成英特爾 GPU 上運行 TensorFlow。
user@host:~$ lscpu | grep "Model name"
Model name: Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
當我運行 TensorFlow 的腳本來檢查設備列表時
from tensorflow.python.client import device_lib
def get_available_gpus():
local_device_protos = device_lib.list_local_devices()
return [x.name for x in local_device_protos]
print(get_available_gpus())
我得到以下結果
18:30:21.335442: E tensorflow/stream_executor/cuda/cuda_driver.cc:397] failed call to cuInit: CUDA_ERROR_UNKNOWN
18:30:21.335465: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:145] kernel driver does not appear to be running on this host (host): /proc/driver/nvidia/version does not exist
['/device:CPU:0', '/device:XLA_CPU:0', '/device:XLA_GPU:0']
我想這可能與 OpenCL 的某些問題有關,因為當我運行 clinfo 時,我得到了
user@host:~$ clinfo
Number of platforms 0
user@host:~$ ls /etc/OpenCL/vendors/
intel.icd nvidia.icd
另一件事是,當我運行一些我在網上找到的示例測試應用程序時
#include "CL/cl.h"
#include <stdio.h>
int main()
{
cl_platform_id pid;
cl_uint num;
cl_uint n=1;
cl_int error=clGetPlatformIDs(1,&pid,&num);
printf("Error code= %d\nNo. of platforms= %d",error,num);
getchar();
}
我收到錯誤代碼 -1001 和 0 平台。 正如我發現的那樣,這可能意味着我需要安裝驅動程序,但據我了解查看/etc/OpenCL/vendors/
我已經安裝了它們。
在 PRIME 配置文件中,我有
user@host:~$ sudo prime-select query
[sudo] password for user:
intel
切換到 nvidia clinfo 也能正常工作 TensorFlow。
我正在運行 Ubuntu 18.04 LTS
user@host:~$ uname -a
Linux host 4.15.0-30-generic #32-Ubuntu SMP Thu Jul 26 17:42:43 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
我認為可能對調試有幫助的附加信息是我在這台機器上遠程工作,沒有直接連接任何顯示器。
我真的很感激任何我在這里缺少的解決 TensorFlow 和 clinfo 問題的建議。
首先請檢查您使用的 CUDA 和 cuDNN 版本是否正確,FROM:- https://www.tensorflow.org/install/source對應您的操作系統和 TF 版本。
如果這是正確的,那么請檢查您使用的是 tensorflow-gpu 而不是 tensorflow-cpu。
此外,我建議您使用機器上的離散 GPU 而不是集成的。
這是一個可能有助於解決上述問題的鏈接
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.