Skip to content

[BUG]: Cannot build extensions when no gpu device exists #5534

@ccoulombe

Description

@ccoulombe

🐛 Describe the bug

When no GPU device exists, such as CI or build nodes, no extensions can be built since torch.cuda.is_available checks for a device and not if cuda is actually available.

Cuda libraries are available on such nodes.

This is caused by

cuda_available = torch.cuda.is_available()

Solution : use an environment variable FORCE_CUDA which is a common case, to enable such build.

Environment

Linux with Cuda available, but no GPU device.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions