Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ dependencies = [
"torchcodec==0.7.0",
"torchao==0.13.0",
"kernels>=0.10.4",
"triton==3.4.0; sys_platform != 'win32'",
"triton==3.4.0; sys_platform == 'linux'",
"triton-windows==3.4.0.post21; sys_platform == 'win32'",
]

Expand Down
6 changes: 5 additions & 1 deletion src/scope/core/pipelines/passthrough/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ def __init__(
):
self.height = height
self.width = width
self.device = device if device is not None else torch.device("cuda")
self.device = (
device
if device is not None
else torch.device("cuda" if torch.cuda.is_available() else "cpu")
)
self.dtype = dtype
self.prompts = None

Expand Down
11 changes: 5 additions & 6 deletions src/scope/server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,15 +181,14 @@ async def lifespan(app: FastAPI):
# Startup
global webrtc_manager, pipeline_manager

# Check CUDA availability before proceeding
# Check CUDA availability and warn if not available
if not torch.cuda.is_available():
error_msg = (
warning_msg = (
"CUDA is not available on this system. "
"This application currently requires a CUDA-compatible GPU and "
"other hardware will be supported in the future."
"Some pipelines may not work without a CUDA-compatible GPU. "
"The application will start, but pipeline functionality may be limited."
)
logger.error(error_msg)
sys.exit(1)
logger.warning(warning_msg)

# Log logs directory
logs_dir = get_logs_dir()
Expand Down
7 changes: 6 additions & 1 deletion src/scope/server/pipeline_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
logger = logging.getLogger(__name__)


def get_device() -> torch.device:
"""Get the appropriate device (CUDA if available, CPU otherwise)."""
return torch.device("cuda" if torch.cuda.is_available() else "cpu")


class PipelineNotAvailableException(Exception):
"""Exception raised when pipeline is not available for processing."""

Expand Down Expand Up @@ -328,7 +333,7 @@ def _load_pipeline_implementation(
pipeline = PassthroughPipeline(
height=height,
width=width,
device=torch.device("cuda"),
device=get_device(),
dtype=torch.bfloat16,
)
logger.info("Passthrough pipeline initialized")
Expand Down
6 changes: 3 additions & 3 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading