TensorFlow依赖CUDA9.0问题:已装9.2如何处理及安装失败求助
Hey there, let's work through your TensorFlow + CUDA issues step by step!
Good news: you don't have to uninstall CUDA 9.2 – different CUDA versions can coexist peacefully on your Windows machine. Each version installs to a separate default directory (like C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0 and v9.2), so you just need to tweak your system's PATH environment variable to prioritize CUDA 9.0 for TensorFlow.
That said, if you don't plan to use CUDA 9.2 for other projects later, uninstalling it is totally safe too. Just head to Control Panel → Programs → Uninstall a program, find "NVIDIA CUDA Toolkit 9.2", and follow the prompts to remove it. This won't damage your system.
Wait a second – you're trying to install Patch 1 first, but patches require the main CUDA 9.0 toolkit to be installed already! That's almost certainly why the installer is crashing immediately. Here's the correct order:
- First, download the main CUDA 9.0 installer (not the patch) from the official archive. Make sure you pick the version matching your Windows 10 x64 system.
- Run the main installer, and choose "Custom Installation" (this lets you skip unnecessary components like Visual Studio integration if you don't need them). Stick to the default install path (or note down whatever path you choose for later).
- Once the main toolkit is fully installed, run the Patch 1 installer again – it should work without crashing this time.
If it still crashes after that, try these quick fixes:
- Right-click the installer and select "Run as administrator" to ensure it has the necessary permissions.
- Re-download the installer – sometimes network glitches can corrupt the setup file.
- Temporarily disable your antivirus/firewall, as some security tools block installer operations by mistake.
Whether you're coexisting versions or only using 9.0, you need to make sure Windows finds CUDA 9.0's files first:
- Right-click "This PC" → "Properties" → "Advanced System Settings" → "Environment Variables".
- In the "System Variables" section, find the
PATHvariable and edit it. - Move the CUDA 9.0
bindirectory (e.g.,C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin) to the top of the list. This ensures Windows loadscudart64_90.dllfrom 9.0 instead of 9.2. - Also, check that the
CUDA_PATHsystem variable points to your CUDA 9.0 installation directory. If it's set to 9.2, update it. You can also add aCUDA_PATH_V9_0variable pointing to the same path (some tools rely on this).
To confirm everything works:
- Open Command Prompt and run
nvcc -V– it should show CUDA 9.0 as the active version. - Launch Python and run
import tensorflow as tf– thecudart64_90.dllerror should be gone.
内容的提问来源于stack exchange,提问作者NeoZoom.lua

