【问题标题】:What is the reason that TensorFlow does not detect GPU on WindowsTensorFlow在Windows上检测不到GPU是什么原因
【发布时间】:2019-01-18 02:02:02
【问题描述】:

我已在配备 NVIDIA GTX 1080 显卡的机器上安装了 CUDA 9.0。当我运行命令nvcc --version 时,我得到:

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2017 NVIDIA Corporation
Built on Fri_Sep__1_21:08:32_Central_Daylight_Time_2017
Cuda compilation tools, release 9.0, V9.0.176

但是我已经尝试了 TensorFlow 官方网站上的步骤来安装支持 GPU 的 TF,但它仍然使用 CPU。

我试过pip install 和Anaconda install,结果都是一样的。没有人能够检测到 GPU,然后我在网上尝试了许多其他教程,他们能够检测到 GPU,但我没有。

可能是什么原因,新的GPU版本的TF有什么变化吗?如果是,那么安装支持 GPU 的 TF 的最新文档是什么,如果不是,那么我做错了什么。

谢谢!

Update1:​​ Tensorflow 真的很浪费我的时间。非常烦人,起初我决定从源代码构建 TF,将其与 CUDA 10 一起使用,但在 OS Windows 10 和 Ubuntu 18.04 上我都无法成功构建它。所以我放弃了,然后我决定使用 CUDA 9.0,Ubuntu 18.04 不支持,所以我回到了 windows,但即使 TF 的预建库仍然无法正常工作,真的很烦人。

不知道为什么TF还在使用CUDA 10.0已经正式发布的CUDA 9.0,而TF还不支持Python 3.7?很神奇不是吗?与 MS Build Tools 2015 相同,2017 已经存在,还有更多工具。 TF 依赖旧版本的工具,这给一些人带来了很多问题,他们必须卸载仍在使用的新版本,这很烦人......

Update2: nvidia-smi 输出:

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 417.71       Driver Version: 417.71       CUDA Version: 9.0      |
|-------------------------------+----------------------+----------------------+
| GPU  Name            TCC/WDDM | Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 1080   WDDM  | 00000000:01:00.0  On |                  N/A |
| 27%   35C    P8     8W / 180W |    498MiB /  8192MiB |      1%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      1264    C+G   Insufficient Permissions                   N/A      |
|    0      2148    C+G   ...0108.0_x64__8wekyb3d8bbwe\HxOutlook.exe N/A      |
|    0      4360    C+G   ...mmersiveControlPanel\SystemSettings.exe N/A      |
|    0      7332    C+G   C:\Windows\explorer.exe                    N/A      |
|    0      7384    C+G   ...t_cw5n1h2txyewy\ShellExperienceHost.exe N/A      |
|    0      8488    C+G   ...dows.Cortana_cw5n1h2txyewy\SearchUI.exe N/A      |
|    0      9704    C+G   ...osoft.LockApp_cw5n1h2txyewy\LockApp.exe N/A      |
|    0     10588    C+G   ...al\Google\Chrome\Application\chrome.exe N/A      |
|    0     10904    C+G   ...x64__8wekyb3d8bbwe\Microsoft.Photos.exe N/A      |
|    0     12608    C+G   ...DIA GeForce Experience\NVIDIA Share.exe N/A      |
|    0     13000    C+G   ...241.0_x64__8wekyb3d8bbwe\Calculator.exe N/A      |
|    0     14668    C+G   ...ng4wbp0\app\DellMobileConnectClient.exe N/A      |
|    0     17628    C+G   ...2.0_x64__8wekyb3d8bbwe\WinStore.App.exe N/A      |
|    0     18060    C+G   ...oftEdge_8wekyb3d8bbwe\MicrosoftEdge.exe N/A      |
+-----------------------------------------------------------------------------+

【问题讨论】:

  • 安装显卡驱动后yourebbot有吗?你跑pip3 install tensorflow-gpu了吗?
  • 您安装的具体步骤是什么?
  • @Tezirg 没有重新启动,但我已经安装了五次 GPU,pip3、pip、conda。没有什么可以尝试的了,只有 StackOverflow。
  • @DmytroPrylipko https://www.tensorflow.org/install/pip#package-location and https://medium.com/@lmoroney_40129/installing-tensorflow-with-gpu-on-windows-10-3309fec55a00 and https://www.pugetsystems.com/labs/hpc/Install-TensorFlow-with-GPU-Support-on-Windows-10-without-a-full-CUDA-install-1172/ and many others
  • 你安装了 libcudnn 吗?

标签: tensorflow gpu


【解决方案1】:

我终于找到了问题所在。 这可能对其他人有所帮助这是 TF 1.12 的一个错误,我已删除并重新安装了 TF 1.11,它能够检测 GPU。

给 TF 团队的一些建议:

  • 在发布新版本之前,请确保它可以正常工作 在所有没有任何错误的操作系统系统中(像我这样的错误 反对是一个非常低杠杆的错误)
  • 还请刷新您的第三方库以支持最新的 版本,例如:CUDA 10,我已经安装在我的机器上,但由于安装了 TF,我退回到 9.0;恼人的。与 2015 年相比, Python 3.7 和 and and ... 也是如此。
  • 请更新文档,用于安装和构建 源,描述清楚一切,需要什么,安装什么,如何构建所有需要的工具和实用程序必须描述清楚。在文档中,我发现从源代码构建 TF 是 非常非常容易,但实际上并非如此,我发现了很多错误 像其他人一样,所以我无法从源代码构建。

到目前为止,我发现 TF 是最烦人的框架,构建和安装。 TF非常敏感,无论是搭建还是安装,出错的概率都很高。

祝你好运!!

【讨论】:

    猜你喜欢
    • 2020-12-04
    • 2017-11-05
    • 2017-09-15
    • 2021-03-26
    • 2023-03-19
    • 2021-05-12
    • 2018-05-31
    • 2020-12-10
    • 2020-01-03
    相关资源
    最近更新 更多