mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
[CUDA-13] Implement workaround for cudaErrorNotSupported (#162412)
See https://github.com/pytorch/pytorch/issues/162333#issuecomment-3267929585 Pull Request resolved: https://github.com/pytorch/pytorch/pull/162412 Approved by: https://github.com/eqy, https://github.com/atalman
This commit is contained in:
committed by
PyTorch MergeBot
parent
065c446193
commit
847d7f21af
@ -78,6 +78,18 @@ int device_count_impl(bool fail_if_no_driver) {
|
||||
"would like to use GPUs, turn off ASAN.");
|
||||
break;
|
||||
#endif // C10_ASAN_ENABLED
|
||||
#if _WIN32 && CUDA_VERSION >= 13000
|
||||
// Workaround for CUDA-13.0 error handling on Windows, see
|
||||
// https://github.com/pytorch/pytorch/issues/162333#issuecomment-3267929585
|
||||
case cudaErrorNotSupported:
|
||||
if (!fail_if_no_driver) {
|
||||
TORCH_WARN(
|
||||
"cudaGetDeviceCount() returned cudaErrorNotSupported, "
|
||||
"likely using older driver or on CPU machine");
|
||||
count = 0;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
default:
|
||||
TORCH_CHECK(
|
||||
false,
|
||||
|
Reference in New Issue
Block a user