簡體   English   中英

安裝兩個不同版本的CUDA后如何切換CUDA版本?

[英]How to switch CUDA version after installing two different version of CUDA?

我已經有 CUDA V9.0 但現在我用 cudnn 7.3 安裝了 CUDA V10.0。我已將我的 tensorflow-gpu 版本升級到 1.13.1。但是當我導入 tensorflow 時出現以下錯誤。當我搜索 CUDA 的版本時在cmd中版本仍然是v9.0。當我檢查環境變量時,CUDA v9.0和10.0都在那里。那么我需要如何將CUDA vrersion切換到10.0

CUDA 版本:-

C:\Users\Gokul Adethya>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

Error:-

Traceback (most recent call last):
  File "C:\Users\Gokul Adethya\AppData\Roaming\Python\Python35\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "C:\Users\Gokul Adethya\AppData\Roaming\Python\Python35\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "C:\Users\Gokul Adethya\AppData\Roaming\Python\Python35\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
  File "C:\Users\Gokul Adethya\AppData\Local\Programs\Python\Python35\lib\imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "C:\Users\Gokul Adethya\AppData\Local\Programs\Python\Python35\lib\imp.py", line 342, in load_dynamic
    return _load(spec)
ImportError: DLL load failed: The specified module could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\Gokul Adethya\AppData\Roaming\Python\Python35\site-packages\tensorflow\__init__.py", line 24, in <module>
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
  File "C:\Users\Gokul Adethya\AppData\Roaming\Python\Python35\site-packages\tensorflow\python\__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "C:\Users\Gokul Adethya\AppData\Roaming\Python\Python35\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "C:\Users\Gokul Adethya\AppData\Roaming\Python\Python35\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "C:\Users\Gokul Adethya\AppData\Roaming\Python\Python35\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "C:\Users\Gokul Adethya\AppData\Roaming\Python\Python35\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
  File "C:\Users\Gokul Adethya\AppData\Local\Programs\Python\Python35\lib\imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "C:\Users\Gokul Adethya\AppData\Local\Programs\Python\Python35\lib\imp.py", line 342, in load_dynamic
    return _load(spec)
ImportError: DLL load failed: The specified module could not be found.

使用它來刪除舊版本的鏈接:

cd /usr/local
sudo rm -rf cuda

使用它來建立新的鏈接:

sudo ln -snf /usr/local/cuda-8.0 /usr/local/cuda

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM