I
Immich5mo ago
nigels

Problem enabling hw accelleration.

I've just set up Immich and it seems really good, I'm running it on an old PC and I have imported a portion of my photo archive. It's syncing from my phone and is doing pretty much what I want. When importing more of my photo archive I would like to run the remote machine learning on other PC's with dedicated nvidia GPUs to help with the face detection as this is pretty slow on my current server. I have tried following the instructions in the documentation for setting up hardware accellerated ml and I think I've almost got it but I'm getting an error. I set this up on two separate PCs running windows 11 under WSL and I hit the same issue on both. Under WSL I installed docker, downloaded the hwaccel.ml.yml and docker-compose.yml files specified here https://immich.app/docs/features/ml-hardware-acceleration and here https://immich.app/docs/guides/remote-machine-learning/ . I editied the docker-compose.yml file to use cuda (as attached) and ran "docker compose up -d". The output on both is as follows: $ docker compose up -d [+] Running 1/2 ✔ Network immich_remote_ml_default Created 0.1s ⠙ Container immich_machine_learning Starting 0.1s Error response from daemon: could not select device driver "nvidia" with capabilities: [[gpu]] running nvidia-smi in WSL shows the graphics card as being detected, but I think I've missed something that isn't letting immich find it. Any ideas on what I've missed or the next steps in diagnosing this ?
11 Replies
Immich
Immich5mo ago
:wave: Hey @nigels, Thanks for reaching out to us. Please carefully read this message and follow the recommended actions. This will help us be more effective in our support effort and leave more time for building Immich :immich:. References - Container Logs: docker compose logs docs - Container Status: docker ps -a docs - Reverse Proxy: https://immich.app/docs/administration/reverse-proxy - Code Formatting https://support.discord.com/hc/en-us/articles/210298617-Markdown-Text-101-Chat-Formatting-Bold-Italic-Underline#h_01GY0DAKGXDEHE263BCAYEGFJA Checklist I have... 1. :ballot_box_with_check: verified I'm on the latest release(note that mobile app releases may take some time). 2. :ballot_box_with_check: read applicable release notes. 3. :ballot_box_with_check: reviewed the FAQs for known issues. 4. :ballot_box_with_check: reviewed Github for known issues. 5. :ballot_box_with_check: tried accessing Immich via local ip (without a custom reverse proxy). 6. :ballot_box_with_check: uploaded the relevant information (see below). 7. :ballot_box_with_check: tried an incognito window, disabled extensions, cleared mobile app cache, logged out and back in, different browsers, etc. as applicable (an item can be marked as "complete" by reacting with the appropriate number) Information In order to be able to effectively help you, we need you to provide clear information to show what the problem is. The exact details needed vary per case, but here is a list of things to consider: - Your docker-compose.yml and .env files. - Logs from all the containers and their status (see above). - All the troubleshooting steps you've tried so far. - Any recent changes you've made to Immich or your system. - Details about your system (both software/OS and hardware). - Details about your storage (filesystems, type of disks, output of commands like fdisk -l and df -h). - The version of the Immich server, mobile app, and other relevant pieces. - Any other information that you think might be relevant. Please paste files and logs with proper code formatting, and especially avoid blurry screenshots. Without the right information we can't work out what the problem is. Help us help you ;) If this ticket can be closed you can use the /close command, and re-open it later if needed. Successfully submitted, a tag has been added to inform contributors. :white_check_mark:
nigels
nigelsOP5mo ago
If I comment out the 'extends' section in docker-compose.yml (the extends, file and service lines) then the container starts up. Presumably this is ready to do remote ml but without hardware accelleration. This confirms the issue is with the immich code accessing the GPU.
mertalev
mertalev5mo ago
It’s impossible for this to be an immich code issue because the error is coming from Docker before the container has started. It’s saying that it can’t find an nvidia gpu to provide to the container
nigels
nigelsOP5mo ago
Yep, I didn't think it was immich directly but was hoping I could get some guidance on how to set up docker to allow the nvidia gpu to be used.
mertalev
mertalev5mo ago
It should normally “just work” without any explicit setup. You have the latest nvidia driver installed right? And the latest Docker Desktop version
nigels
nigelsOP5mo ago
I'm running the latest graphics driver, but I'm not running Docker Desktop. I installed Docker in WSL via
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
Is Docker Desktop required ?
mertalev
mertalev5mo ago
Oh, if you installed it that way then you probably do need to install nvidia container toolkit Docker desktop is not required (and is actually less stable and efficient compared to what you did), but the instructions kind of assume you’re using it
nigels
nigelsOP5mo ago
Is there a recommended way to install nvidia container toolkit? on one of the PC's I tried installing it following these instructions https://docs.nvidia.com/cuda/wsl-user-guide/index.html#getting-started-with-cuda-on-wsl-2 and aside from putting some software in /usr/local/cuda-12.9 it doesn't appear to make any difference to my docker setup.
1. NVIDIA GPU Accelerated Computing on WSL 2 — CUDA on WSL 12.9 d...
The guide for using NVIDIA CUDA on Windows Subsystem for Linux.
mertalev
mertalev5mo ago
You’d probably want to look at the instructions for ubuntu. Just don’t install any nvidia drivers inside wsl2 (also you don’t need to install cuda, that’s inside the container)
nigels
nigelsOP5mo ago
Ah, I wonder if I've install the Nvidia Cuda toolkit, which may not be the same as the Nvidia container toolkit ? I will check and report back. Thanks for this support, it's helping me figure this out 😄 Yes, that was it. I was missing the Nvidia container toolkit. Following the instructions to add it from here fixed the issue on both machines and now the container starts up without errors. https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html#installing-the-nvidia-container-toolkit Thanks again.
mertalev
mertalev5mo ago
Awesome, glad it’s working now!

Did you find this page helpful?