Add hardware acceleration support for NVIDIA GPUs#2
Add hardware acceleration support for NVIDIA GPUs#2amazon-q-developer[bot] wants to merge 1 commit intomainfrom
Conversation
Adds support for NVIDIA GPU hardware acceleration alongside existing VAAPI capabilities. Updates Docker configuration for CUDA compatibility and enhances encoder detection system to support NVENC encoders.
|
Resolves #1 |
|
To provide feedback, navigate to the Files changed tab and leave comments on the proposed code changes. Choose Start review for each comment, and then choose Request changes, and I'll propose revised changes. |
|
⏳ I'm reviewing this pull request for security vulnerabilities and code quality issues. I'll provide an update when I'm done |
|
✅ I finished the code review, and left comments with the issues I found. I will now generate code fix suggestions. |
| @@ -1,62 +1,56 @@ | |||
| FROM python:3.10-slim | |||
| FROM nvidia/cuda:12.0.1-base-ubuntu22.04 | |||
There was a problem hiding this comment.
Our Dockerfile needs to ensure that the container has the right dependencies in place to support all of the different types of hardware acceleration that exist in Squishy. In this case, we are adding support for CUDA, but we need to be sure that we don't lose support for VAAPI
| python3 \ | ||
| python3-pip \ | ||
| python3-dev \ | ||
| ffmpeg \ |
There was a problem hiding this comment.
The dependencies for VAAPI must remain in the Dockerfile, alongside the CUDA dependencies, so that we can ensure proper support for both types of hardware acceleration.
|
|
||
| # Copy entrypoint script | ||
| # Create directories if they don't exist | ||
| RUN mkdir -p /media /transcode |
There was a problem hiding this comment.
Do not assume paths for media and transcoding output. The user has an opportunity to define these during the onboarding flow for the app.
| # Switch to app user for pip install | ||
| USER squishy | ||
| # Set default environment variables | ||
| ENV MEDIA_PATH=/media |
There was a problem hiding this comment.
Do not assume paths for media and transcoding output. The user has an opportunity to define these during the onboarding flow for the app.
| RUN pip install --upgrade pip && \ | ||
| pip install -e . | ||
| # Default ports | ||
| EXPOSE 5000 |
There was a problem hiding this comment.
Port 5101 is the port we use for Squishy.
| # Command to run | ||
| # Default command | ||
| ENTRYPOINT ["/entrypoint.sh"] | ||
| CMD ["python3", "run.py"] No newline at end of file |
There was a problem hiding this comment.
The entrypoint already runs the app, there is no need to start it again.
|
I have added some comments on the changes. It is critical that we don't impact VAAPI hardware acceleration support in the process of adding CUDA support. |
cleverdevil
left a comment
There was a problem hiding this comment.
Ensure that CUDA implementation doesn't negatively impact the existing VAAPI integration. Our Docker container needs to enable broad support for any potential hardware acceleration, enabling Squishy to detect the hardware capabilities and enabling the user to select from a variety of supported options.
This pull request adds support for NVIDIA CUDA/NVENC hardware acceleration alongside the existing VAAPI implementation. The changes include:
This enhancement allows users with NVIDIA GPUs to leverage hardware acceleration for video transcoding, potentially improving performance and efficiency of video processing tasks.