mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01: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:
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.");
|
"would like to use GPUs, turn off ASAN.");
|
||||||
break;
|
break;
|
||||||
#endif // C10_ASAN_ENABLED
|
#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:
|
default:
|
||||||
TORCH_CHECK(
|
TORCH_CHECK(
|
||||||
false,
|
false,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user