You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG]: Stream.from_handle(0) keeps the first context it sees #3242
A Stream over the NULL stream (handle 0), from Stream.from_handle(0) or a foreign object whose __cuda_stream__ returns (0, 0), still keeps the first context it resolves. #2485 fixed this for LEGACY_DEFAULT_STREAM and PER_THREAD_DEFAULT_STREAM, but Stream_is_default_token only matches CU_STREAM_LEGACY and CU_STREAM_PER_THREAD, while the driver resolves handle 0 against the current context just like those two. After a context switch, .context, .device, .resources and the event from record() still name the old context, and with a second context made by cuCtxCreate, record() fails with CUDA_ERROR_INVALID_HANDLE.
True, as LEGACY_DEFAULT_STREAM.context == green already gives in the same script. The NULL stream refers to whatever context is current, so nothing resolved from it should be cached on the Stream.
Operating System
Ubuntu 26.04 LTS (WSL2)
nvidia-smi output
NVIDIA-SMI 615.65.07 KMD Version: 616.64 CUDA UMD Version: 13.4
GPU 0: NVIDIA GeForce RTX 4060 Ti
Activity