Skip to content
This repository was archived by the owner on Jun 10, 2024. It is now read-only.
This repository was archived by the owner on Jun 10, 2024. It is now read-only.

CUDA_ERROR_NO_DEVICE when used inside Ray Actor #571

@tbenst

Description

@tbenst

Describe the bug
I get the error CUDA error: CUDA_ERROR_NO_DEVICE when run inside of ray.remote

To Reproduce

##
import PyNvCodec as nvc
import ray
##
# ok
nv = nvc.PyNvEncoder(
            {
                "preset": "P4",
                "codec": "hevc",  # Use H.265 codec
                "fps": "30",
                "s": "1920x1080",
                "bitrate": "10M",
                "gop": "60",
                "profile": "high"
            },
            0  # G
)
##
@ray.remote
class T():
    def __init__(self):
        self.nv = nvc.PyNvEncoder(
            {
                "preset": "P4",
                "codec": "hevc",  # Use H.265 codec
                "fps": "30",
                "s": "1920x1080",
                "bitrate": "10M",
                "gop": "60",
                "profile": "high"
            },
            0  # G
        )
# fails
T.remote()
(T pid=47452) Exception raised in creation task: The actor died because of an error raised in its creation task, ray::T.__init__() (pid=47452, ip=192.168.1.68, actor_id=34d055865916a666bd2e62b501000000, repr=<2024-05-25_ray_nvenc.T object at 0x70db17bfda20>)
(T pid=47452)   File "<ipython-input-3-bd07d4f981a3>", line 5, in __init__
(T pid=47452) RuntimeError: [/tmp/pip-req-build-k99edwsy/src/PyNvCodec/src/PyNvCodec.cpp:61](https://vscode-remote+ssh-002dremote-002binference1.vscode-resource.vscode-cdn.net/tmp/pip-req-build-k99edwsy/src/PyNvCodec/src/PyNvCodec.cpp:61)
(T pid=47452) CUDA error: CUDA_ERROR_NO_DEVICE
(T pid=47452) no CUDA-capable device is detected

Expected behavior
The CUDA device should be found

Desktop (please complete the following information):

  • OS: Ubuntu 22.04
  • Nvidia driver version: 550.67
  • CUDA Version: 12.4
  • Python Version: 3.10.13
  • Video Codec SDK Version: PyNvCodec 2.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions