Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CUDA driver fails to initialize in WSL #722

Open
1 task done
ivangplus opened this issue Mar 7, 2025 · 0 comments
Open
1 task done

CUDA driver fails to initialize in WSL #722

ivangplus opened this issue Mar 7, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@ivangplus
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When running profiler in WSL for CUDA-enabled Pytorch code, CUDA driver fails to initialize. Specifically, this happens after entering the memray.Tracker context manager.

$ python -m memray run -q -c 'import torch; print(torch.cuda.is_available())'
False

Expected Behavior

CUDA driver being able to initialize,

$ python -m memray run -q -c 'import torch; print(torch.cuda.is_available())'
False

Steps To Reproduce

  1. WSL2 (Ubuntu 24.04), CUDA 12.7
  2. Prepare python env:
    $ pip install memray
    $ pip install torch --index-url https://download.pytorch.org/whl/cu126
  3. Run python -m memray run -q -c 'import torch; print(torch.cuda.is_available())'

Memray Version

1.16.0

Python Version

3.12

Operating System

Linux

Anything else?

I checked that this happens exactly in WSL environment. If I try to reproduce this in a Docker container of ubuntu:22.04 image, Docker engine being installed in the same WSL environment, CUDA successfully initializes.
Having read about supported environments, I'm still not quite sure if WSL is supported or not.

@ivangplus ivangplus added the bug Something isn't working label Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant