Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help with iGPU transcoding #226

Open
dsfsdbvxc opened this issue Nov 24, 2023 · 12 comments
Open

Help with iGPU transcoding #226

dsfsdbvxc opened this issue Nov 24, 2023 · 12 comments

Comments

@dsfsdbvxc
Copy link

Looking for a bit of help with getting intel quicksync transcoding set up with this container and Unraid.

I've passed the iGPU through using --device=/dev/dri/ as an extra parameter. The docker compose equivilant to

devices:
- /dev/dri:/dev/dri

Then enabled hardware accelleration in Immich, via settings > hardware acceleration > ACCELERATION API > Select Quicksync

Looking through the immich documentation the steps are where I get stuck as not how to do this in Unraid:

  1. If you do not already have it, download the latest hwaccel.yml file and ensure it's in the same folder as the docker-compose.yml.
  2. Uncomment the lines that apply to your system and desired usage.
  3. In the docker-compose.yml under immich-microservices, uncomment the lines relating to the hwaccel.yml file.
  4. Redeploy the immich-microservices container with these updated settings.

Any help appreciated

@martabal
Copy link
Collaborator

With what you described, it's supposed to work. Use this guide only if you deployed immich with the official containers which is not your case

@dsfsdbvxc
Copy link
Author

Thanks for the reply.

Humm, ok, looking at the GPU load it doesn't look like its being used (intel 12500), can I just check expected behaviour when transcoding. Appreciate its an experemental feature.

I'm using an external library, started a scan and transcoding using 'only video not in the desired format'. Would this be expected to use the GPU or is it when a video's played back and transcoded on the fly?

@martabal
Copy link
Collaborator

martabal commented Nov 24, 2023

If your videos use a compatible codec, I don't think they need to be transcoded

@Hely0n
Copy link

Hely0n commented Dec 10, 2023

Same here. I added devices: /dev/dri too and enabled it in the immich settings. Then I set "transcode all videos not in desired format" (I had transcoding disabled until now) and started the Transcoding Queue. It fills up and is starts to work, but iGPU shows no load, while 2 CPU cores are on 100%, thus it's not transcoding via iGPU.

@Hely0n
Copy link

Hely0n commented Dec 10, 2023

This is my Docker-compose:


version: "3.8"
name: immich
services:
  immich:
    depends_on:
      - db
      - redis
    image: ghcr.io/imagegenius/immich:latest
    container_name: Immich-App
    environment:
      - TZ=Europe/Berlin
      - DB_HOSTNAME=db
      - DB_USERNAME=postgres
      - DB_PASSWORD=...
      - DB_DATABASE_NAME=immich
      - REDIS_HOSTNAME=redis
      - DB_PORT=5432 #optional
      - REDIS_PORT=6379 #optional
      - REDIS_PASSWORD= #optional
      - CUDA_ACCELERATION=false #optional
    volumes:
      ...
    ports:
      - 3000:8080
    devices:
      - /dev/dri:/dev/dri  # If using Intel QuickSync or VAAPI
    restart: always

  # This container requires an external application to be run separately to be run separately.
  # Redis:
  redis:
    image: redis
    container_name: Immich-Redis
    restart: always
    volumes:
      - "/mnt/user/appdata/Immich/redis:/data"
  
  # PostgreSQL 14:
  db:
    image: postgres:14
    container_name: Immich-DB
    restart: always
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: ...
      POSTGRES_DB: immich
    volumes:
      - "/mnt/user/appdata/Immich/db:/var/lib/postgresql/data"
      
volumes:
   unused_data:

@martabal
Copy link
Collaborator

Two things:

  • For some reason, Immich uses a lot of CPU when transcoding videos, you have to make sure it's using your GPU with intel_gpu_top
  • You didn't say in your comment, but you have to specify to Immich to use your GPU in Administration > Video Transcoding Settings > Hardware Acceleration > Quick Sync

@Hely0n
Copy link

Hely0n commented Dec 10, 2023

My information, that the GPU wasn't used comes from intel GPU top. With "enabled it in the immich settings" I meant the Quick Sync Setting. I tested HW-Transcoding in Jellyfin, and here I could see some GPU usage, but Immich doesn't want to 😅. I'm on Unraid btw, but I'm not using any unraid specific Immich-App but vanilla docker compose.

It's not urgent for me, but I wanted to know if my docker-compose looks right.

@martabal
Copy link
Collaborator

Sorry for the late response, everything looks good to me

@Hely0n
Copy link

Hely0n commented Dec 25, 2023

No problem, thank you.
I just let transcode a single video and it indeed used the iGPU.

@masterwishx
Copy link

for vaapi we need MACHINE_LEARNING_GPU_ACCELERATION= vaapi ?

@martabal
Copy link
Collaborator

No, as stated in the README, it only supports cuda

@masterwishx
Copy link

No, as stated in the README, it only supports cuda

So just leave it blank ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants