TensorFlow GPU版无法启用求助:CUDA计算能力不兼容问题
Hey there! Let's break down what's happening with your TensorFlow setup and get it working properly.
The Root Cause
Your Quadro K1000M has a CUDA compute capability of 3.0, but the TensorFlow GPU version you installed requires a minimum compute capability of 3.7. When TensorFlow detects your GPU doesn't meet this requirement, it automatically falls back to using the CPU (even if you didn't install the standalone CPU version—GPU packages include CPU support as a fallback). That's why you're seeing the warning and the "no known devices" message.
Step-by-Step Solutions
Downgrade TensorFlow to a version that supports compute capability 3.0
TensorFlow versions up to 1.13.x still support GPUs with compute capability 3.0. Since you're using Python 3.5 and CUDA 9.0, the best compatible versions are TensorFlow 1.12.0 or 1.13.1. Here's how to install it:- First, uninstall your current TensorFlow GPU version:
(Usepip uninstall tensorflow-gpupip3instead if you're targeting Python 3 specifically.) - Install the matching version:
pip install tensorflow-gpu==1.12.0
- First, uninstall your current TensorFlow GPU version:
Install the correct cuDNN version
TensorFlow 1.12.0 requires cuDNN 7.1.x to work with CUDA 9.0. Download this specific cuDNN version, then copy its files into your CUDA 9.0 installation directory:- Copy files from the cuDNN
binfolder toCUDA_PATH\bin - Copy files from the cuDNN
includefolder toCUDA_PATH\include - Copy files from the cuDNN
lib\x64folder toCUDA_PATH\lib\x64
- Copy files from the cuDNN
Verify your setup
Run this code to check if TensorFlow now recognizes your GPU:import tensorflow as tf sess = tf.Session(config=tf.ConfigProto(log_device_placement=True)) sess.close()If successful, you'll see log messages confirming that TensorFlow has detected your Quadro K1000M GPU.
Double-check environment variables
Make sure your system has the right CUDA environment variables configured:- For Windows: Set
CUDA_PATHto point to your CUDA 9.0 folder, and add%CUDA_PATH%\binto yourPATHvariable. - For Linux: Add these lines to your shell profile (like
.bashrcor.zshrc):export CUDA_HOME=/usr/local/cuda-9.0 export LD_LIBRARY_PATH=$CUDA_HOME/lib64:$LD_LIBRARY_PATH
- For Windows: Set
内容的提问来源于stack exchange,提问作者alyaa mahdi




