[Bugfix] Fix WSL circular import from pin_memory warning_once (#48444)
Signed-off-by: AlejandroParedesLT <alejandroparedeslatorre@gmail.com> Co-authored-by: Shengqi Chen <harry-chen@outlook.com>
This commit is contained in:
co-authored by
Shengqi Chen
parent
0d9210a502
commit
0a684ab0c0
@@ -290,7 +290,8 @@ class CudaPlatformBase(Platform):
|
||||
# kernel with limited pinned memory support for CUDA.
|
||||
version = _get_wsl_kernel_version()
|
||||
if version is None or version < (4, 19, 121):
|
||||
logger.warning_once(
|
||||
# warning_once() causes a circular import on WSL, see #48397.
|
||||
logger.warning(
|
||||
"Using 'pin_memory=False' as WSL is detected and the "
|
||||
"WSL2 kernel version is below 4.19.121. This may slow "
|
||||
"down performance. Please run `wsl --update`."
|
||||
|
||||
@@ -991,7 +991,8 @@ class Platform:
|
||||
# Pinned memory support under WSL depends on the vendor and driver
|
||||
# version. Conservative default: return False. Platform subclasses
|
||||
# that can verify support (e.g. CudaPlatformBase) override this.
|
||||
logger.warning_once(
|
||||
# warning_once() causes a circular import on WSL, see #48397.
|
||||
logger.warning(
|
||||
"Using 'pin_memory=False' as WSL is detected. "
|
||||
"This may slow down performance."
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user