报错NVIDIA GeForce RTX 4060 Laptop GPU with CUDA capability sm_89 is not compatible with ...

完整报错

serWarning: 
NVIDIA GeForce RTX 4060 Laptop GPU with CUDA capability sm_89 is not compatible with the current PyTorch installation.
The current PyTorch install supports CUDA capabilities sm_37 sm_50 sm_60 sm_61 sm_70 sm_75 compute_37.
If you want to use the NVIDIA GeForce RTX 4060 Laptop GPU GPU with PyTorch, please check the instructions at https://pytorch.org/get-started/locally/

  warnings.warn(incompatible_device_warn.format(device_name, capability, " ".join(arch_list), device_name))

报错原因:

显卡算力与cuda版本不匹配,需要卸载原本的cuda安装新的

解决方案:

1.检查显卡算力

import torch
print('CUDA版本:',torch.version.cuda)
print('Pytorch版本:',torch.__version__)
print('显卡是否可用:','可用' if(torch.cuda.is_available()) else '不可用')
print('显卡数量:',torch.cuda.device_count())
print('是否支持BF16数字格式:','支持' if (torch.cuda.is_bf16_supported()) else '不支持')
print('当前显卡型号:',torch.cuda.get_device_name())
print('当前显卡的CUDA算力:',torch.cuda.get_device_capability())
print('当前显卡的总显存:',torch.cuda.get_device_properties(0).total_memory/1024/1024/1024,'GB')
print('是否支持TensorCore:','支持' if (torch.cuda.get_device_properties(0).major >= 7) else '不支持')
print('当前显卡的显存使用率:',torch.cuda.memory_allocated(0)/torch.cuda.get_device_properties(0).total_memory*100,'%')

 你也可以直接在链接里查看:CUDA GPU - 计算能力 |NVIDIA 开发者报错NVIDIA GeForce RTX 4060 Laptop GPU with CUDA capability sm_89 is not compatible with ..._第1张图片

2. 算力和cuda的版本对应关系

哪些 CUDA 版本支持哪种计算能力?- 堆栈溢出 (stackoverflow.com)

报错NVIDIA GeForce RTX 4060 Laptop GPU with CUDA capability sm_89 is not compatible with ..._第2张图片 3.显卡驱动和cuda对应关系

报错NVIDIA GeForce RTX 4060 Laptop GPU with CUDA capability sm_89 is not compatible with ..._第3张图片 

CUDA 12.3 Update 2 Release Notes (nvidia.com)

卸载cuda

4.安装cuda

你可能感兴趣的:(深度学习报错,人工智能)