New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
RuntimeError: _share_filename_: only available on CPU with num_workers>0 #87688
Comments
This Error comes from pytorch/torch/csrc/StorageSharing.cpp Lines 90 to 91 in aaba0bd
Do you have any cuda Tensor created within your Dataset? |
No, I'm getting this error only when using MPS. With CUDA it works fine. |
It would be good if you can provide a minimum reproducible code for us. And, wondering if it's the problem that MPS tensor shared by multiprocessing? |
Ho I haven't looked into that in details. It might be a problem on MPS indeed. |
Hi, I have the same error when using MPS. Everything works fine on CPU and on CUDA. I already checked and the number of workers in dataloader is 0. I attach the error:
|
With number of workers as 0, why does the multiprocessing get involved? Do you mean number of workers larger than 0? |
@lucacorbucci |
I experienced this same error after cloning the mnist hogwild example, so could work as a minimum reproducible example: pytorch/examples#1105 |
I was able to solve the issue by adding this argument to the multiprocessing_context='fork' if torch.backends.mps.is_available() else None |
Interesting, nice find @lucadiliello . This solution of using |
This issue happens only if try to use mps, if using cpu on mac it not happens. |
It worked, thanks! |
馃悰 Describe the bug
I'm getting the following error when setting the number of workers in the
DataLoader
to be greater than 0.I can try to create a working example if needed, but since the bug comes from a big project it will take some time to remove everything not publishable.
Versions
PyTorch version: 1.14.0.dev20221025
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A
OS: macOS 12.6.1 (arm64)
GCC version: Could not collect
Clang version: 14.0.0 (clang-1400.0.29.102)
CMake version: version 3.24.1
Libc version: N/A
Python version: 3.9.12 (main, Jun 1 2022, 06:34:44) [Clang 12.0.0 ] (64-bit runtime)
Python platform: macOS-12.6.1-arm64-arm-64bit
Is CUDA available: False
CUDA runtime version: No CUDA
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True
Versions of relevant libraries:
[pip3] numpy==1.23.3
[pip3] pytorch-lightning==1.7.7
[pip3] torch==1.14.0.dev20221025
[pip3] torchmetrics==0.10.0
[conda] numpy 1.23.3 pypi_0 pypi
[conda] pytorch-lightning 1.7.7 pypi_0 pypi
[conda] torch 1.14.0.dev20221025 pypi_0 pypi
[conda] torchmetrics 0.10.0 pypi_0 pypi
cc @ssnl @VitalyFedyunin @ejguan @NivekT @kulinseth @albanD @malfet @DenisVieriu97 @razarmehr @abhudev
The text was updated successfully, but these errors were encountered: