Steps to resolve PyTorch and CUDA version conflicts
When the version mismatch problem occurs, it is recommended to follow the following process to troubleshoot and solve the problem:
- Check the video card driver version: In the terminal, type
nvidia-smi
View the highest supported CUDA version (shown in the upper right corner) - Verifying PyTorch installation commands: AccessPyTorch official website, select the installation command that corresponds to the CUDA version. For example:
- CUDA 11.8 users should use:
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu118
- CUDA 12.1 users need to use the corresponding version 12.1 commands.
- CUDA 11.8 users should use:
- Forced reloading program: If the wrong version is installed, first run
pip uninstall torch torchvision
Uninstall completely and install the correct version again - Validation Program: Run after installation
python -c "import torch; print(torch.cuda.is_available())"
If the configuration is successful, it will return True.
Special case handling: if using an older graphics card (e.g. Maxwell architecture), you may need to install an older version of CUDA (11.3 or lower) or switch to a different CPU version.
This answer comes from the articleTripoSG: Generating high-resolution 3D modeled digital assets from a single imageThe