Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

agnos.is Forums

  1. Home
  2. Selfhosted
  3. PSA: If the first Smart Search in Immich takes a while

PSA: If the first Smart Search in Immich takes a while

Scheduled Pinned Locked Moved Selfhosted
selfhosted
40 Posts 17 Posters 0 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • avidamoeba@lemmy.caA This user is from outside of this forum
    avidamoeba@lemmy.caA This user is from outside of this forum
    [email protected]
    wrote last edited by [email protected]
    #1

    Your ML model cache volume is getting blown up during restart and the model is being re-downloaded during the first search post-restart. Either set it to a path somewhere on your storage, or ensure you're not blowing up the dynamic volume upon restart.

    In my case I changed this:

      immich-machine-learning:
        ...
        volumes:
          - model-cache:/cache
    

    To that:

      immich-machine-learning:
        ...
        volumes:
          - ./cache:/cache
    

    I no longer have to wait uncomfortably long when I'm trying to show off Smart Search to a friend, or just need a meme pronto.

    That'll be all.

    W avidamoeba@lemmy.caA I mangopenguin@lemmy.blahaj.zoneM 4 Replies Last reply
    41
    • avidamoeba@lemmy.caA [email protected]

      Your ML model cache volume is getting blown up during restart and the model is being re-downloaded during the first search post-restart. Either set it to a path somewhere on your storage, or ensure you're not blowing up the dynamic volume upon restart.

      In my case I changed this:

        immich-machine-learning:
          ...
          volumes:
            - model-cache:/cache
      

      To that:

        immich-machine-learning:
          ...
          volumes:
            - ./cache:/cache
      

      I no longer have to wait uncomfortably long when I'm trying to show off Smart Search to a friend, or just need a meme pronto.

      That'll be all.

      W This user is from outside of this forum
      W This user is from outside of this forum
      [email protected]
      wrote last edited by
      #2

      Ok I should know this by now, but what actually is the current “./“ directory when you use that? Is it the docker daemons start dir like /var/docker ?

      S mhzawadi@lemmy.horwood.cloudM 2 Replies Last reply
      1
      • W [email protected]

        Ok I should know this by now, but what actually is the current “./“ directory when you use that? Is it the docker daemons start dir like /var/docker ?

        S This user is from outside of this forum
        S This user is from outside of this forum
        [email protected]
        wrote last edited by
        #3

        It usually is the directory where you execute the docker compose command.

        1 Reply Last reply
        0
        • W [email protected]

          Ok I should know this by now, but what actually is the current “./“ directory when you use that? Is it the docker daemons start dir like /var/docker ?

          mhzawadi@lemmy.horwood.cloudM This user is from outside of this forum
          mhzawadi@lemmy.horwood.cloudM This user is from outside of this forum
          [email protected]
          wrote last edited by
          #4

          ./ will be the directory you run your compose from

          S E 2 Replies Last reply
          2
          • avidamoeba@lemmy.caA [email protected]

            Your ML model cache volume is getting blown up during restart and the model is being re-downloaded during the first search post-restart. Either set it to a path somewhere on your storage, or ensure you're not blowing up the dynamic volume upon restart.

            In my case I changed this:

              immich-machine-learning:
                ...
                volumes:
                  - model-cache:/cache
            

            To that:

              immich-machine-learning:
                ...
                volumes:
                  - ./cache:/cache
            

            I no longer have to wait uncomfortably long when I'm trying to show off Smart Search to a friend, or just need a meme pronto.

            That'll be all.

            avidamoeba@lemmy.caA This user is from outside of this forum
            avidamoeba@lemmy.caA This user is from outside of this forum
            [email protected]
            wrote last edited by [email protected]
            #5

            Oh, and if you haven't changed from the default ML model, please do. The results are phenomenal. The default is nice but only really needed on really low power hardware. If you have a notebook/desktop class CPU and/or GPU with 6GB+ of RAM, you should try a larger model. I used the best model they have and it consumes around 4GB VRAM.

            A S 2 Replies Last reply
            6
            • avidamoeba@lemmy.caA [email protected]

              Oh, and if you haven't changed from the default ML model, please do. The results are phenomenal. The default is nice but only really needed on really low power hardware. If you have a notebook/desktop class CPU and/or GPU with 6GB+ of RAM, you should try a larger model. I used the best model they have and it consumes around 4GB VRAM.

              A This user is from outside of this forum
              A This user is from outside of this forum
              [email protected]
              wrote last edited by
              #6

              Which model would you recommend? I just switched from ViT-B/32 to ViT-SO400M-16-SigLIP2-384__webli since it seemed to be the most popular.

              avidamoeba@lemmy.caA 1 Reply Last reply
              2
              • A [email protected]

                Which model would you recommend? I just switched from ViT-B/32 to ViT-SO400M-16-SigLIP2-384__webli since it seemed to be the most popular.

                avidamoeba@lemmy.caA This user is from outside of this forum
                avidamoeba@lemmy.caA This user is from outside of this forum
                [email protected]
                wrote last edited by
                #7

                I switched to the same model. It's absolutely spectacular. The only extra thing I did was to increase the concurrent job count for Smart Search and to give the model access to my GPU which sped up the initial scan at least an order of magnitude.

                A 1 Reply Last reply
                1
                • avidamoeba@lemmy.caA [email protected]

                  Oh, and if you haven't changed from the default ML model, please do. The results are phenomenal. The default is nice but only really needed on really low power hardware. If you have a notebook/desktop class CPU and/or GPU with 6GB+ of RAM, you should try a larger model. I used the best model they have and it consumes around 4GB VRAM.

                  S This user is from outside of this forum
                  S This user is from outside of this forum
                  [email protected]
                  wrote last edited by
                  #8

                  Is this something that would be recommended if self-hosting off a Synology 920+ NAS?

                  My NAS does have extra ram to spare because I upgraded it, and has NVME cache 🤗

                  avidamoeba@lemmy.caA 1 Reply Last reply
                  0
                  • mhzawadi@lemmy.horwood.cloudM [email protected]

                    ./ will be the directory you run your compose from

                    S This user is from outside of this forum
                    S This user is from outside of this forum
                    [email protected]
                    wrote last edited by
                    #9

                    That seems like a bad idea

                    M N ohshit604@sh.itjust.worksO 3 Replies Last reply
                    3
                    • S [email protected]

                      That seems like a bad idea

                      M This user is from outside of this forum
                      M This user is from outside of this forum
                      [email protected]
                      wrote last edited by
                      #10

                      Its convenient because your data is stored in the same folder that your docker-compose.yaml file is in, making backups or migrations simpler.

                      avidamoeba@lemmy.caA 1 Reply Last reply
                      1
                      • avidamoeba@lemmy.caA [email protected]

                        Your ML model cache volume is getting blown up during restart and the model is being re-downloaded during the first search post-restart. Either set it to a path somewhere on your storage, or ensure you're not blowing up the dynamic volume upon restart.

                        In my case I changed this:

                          immich-machine-learning:
                            ...
                            volumes:
                              - model-cache:/cache
                        

                        To that:

                          immich-machine-learning:
                            ...
                            volumes:
                              - ./cache:/cache
                        

                        I no longer have to wait uncomfortably long when I'm trying to show off Smart Search to a friend, or just need a meme pronto.

                        That'll be all.

                        I This user is from outside of this forum
                        I This user is from outside of this forum
                        [email protected]
                        wrote last edited by
                        #11

                        It's not normal for - model-cache:/cache to be deleted on restart or even upgrade. You shouldn't need to do this.

                        avidamoeba@lemmy.caA 1 Reply Last reply
                        12
                        • I [email protected]

                          It's not normal for - model-cache:/cache to be deleted on restart or even upgrade. You shouldn't need to do this.

                          avidamoeba@lemmy.caA This user is from outside of this forum
                          avidamoeba@lemmy.caA This user is from outside of this forum
                          [email protected]
                          wrote last edited by [email protected]
                          #12

                          Yes, it depends on how you're managing the service. If you're using one of the common patterns via systemd, you may be cleaning up everything, including old volumes, like I do.

                          E: Also if you have any sort of lazy prune op running on a timer, it could blow it up at some point.

                          1 Reply Last reply
                          0
                          • S [email protected]

                            Is this something that would be recommended if self-hosting off a Synology 920+ NAS?

                            My NAS does have extra ram to spare because I upgraded it, and has NVME cache 🤗

                            avidamoeba@lemmy.caA This user is from outside of this forum
                            avidamoeba@lemmy.caA This user is from outside of this forum
                            [email protected]
                            wrote last edited by [email protected]
                            #13

                            That's a Celeron right? I'd try a better AI model. Check this page for the list. You could try the heaviest one. It'll take a long time to process your library but inference is faster. I don't know how much faster it is. Maybe it would be fast enough to be usable. If not usable, choose a lighter model. There's execution times in the table that I assume tell us how heavy the models are. Once you change a model, you have to let it rescan the library.

                            S 1 Reply Last reply
                            0
                            • avidamoeba@lemmy.caA [email protected]

                              That's a Celeron right? I'd try a better AI model. Check this page for the list. You could try the heaviest one. It'll take a long time to process your library but inference is faster. I don't know how much faster it is. Maybe it would be fast enough to be usable. If not usable, choose a lighter model. There's execution times in the table that I assume tell us how heavy the models are. Once you change a model, you have to let it rescan the library.

                              S This user is from outside of this forum
                              S This user is from outside of this forum
                              [email protected]
                              wrote last edited by
                              #14

                              That’s a Celeron right?

                              Yup, the Intel J4125 Celeron 4-Core CPU, 2.0-2.7Ghz.

                              I switched to the ViT-SO400M-16-SigLIP2-384__webli model, same as what you use. I don't worry about processing time, but it looks like a more capable model, and I really only use immich for contextual search anyway, so that might be a nice upgrade.

                              avidamoeba@lemmy.caA I 2 Replies Last reply
                              0
                              • avidamoeba@lemmy.caA [email protected]

                                Your ML model cache volume is getting blown up during restart and the model is being re-downloaded during the first search post-restart. Either set it to a path somewhere on your storage, or ensure you're not blowing up the dynamic volume upon restart.

                                In my case I changed this:

                                  immich-machine-learning:
                                    ...
                                    volumes:
                                      - model-cache:/cache
                                

                                To that:

                                  immich-machine-learning:
                                    ...
                                    volumes:
                                      - ./cache:/cache
                                

                                I no longer have to wait uncomfortably long when I'm trying to show off Smart Search to a friend, or just need a meme pronto.

                                That'll be all.

                                mangopenguin@lemmy.blahaj.zoneM This user is from outside of this forum
                                mangopenguin@lemmy.blahaj.zoneM This user is from outside of this forum
                                [email protected]
                                wrote last edited by [email protected]
                                #15

                                Doing a volume like the default Immich docker-compose uses should work fine, even through restarts. I'm not sure why your setup is blowing up the volume.

                                Normally volumes are only removed if there is no running container associated with it, and you manually run docker volume prune

                                avidamoeba@lemmy.caA 1 Reply Last reply
                                5
                                • S [email protected]

                                  That’s a Celeron right?

                                  Yup, the Intel J4125 Celeron 4-Core CPU, 2.0-2.7Ghz.

                                  I switched to the ViT-SO400M-16-SigLIP2-384__webli model, same as what you use. I don't worry about processing time, but it looks like a more capable model, and I really only use immich for contextual search anyway, so that might be a nice upgrade.

                                  avidamoeba@lemmy.caA This user is from outside of this forum
                                  avidamoeba@lemmy.caA This user is from outside of this forum
                                  [email protected]
                                  wrote last edited by
                                  #16

                                  Did you run the Smart Search job?

                                  S 1 Reply Last reply
                                  0
                                  • S [email protected]

                                    That seems like a bad idea

                                    N This user is from outside of this forum
                                    N This user is from outside of this forum
                                    [email protected]
                                    wrote last edited by
                                    #17

                                    It's not.

                                    1 Reply Last reply
                                    0
                                    • mangopenguin@lemmy.blahaj.zoneM [email protected]

                                      Doing a volume like the default Immich docker-compose uses should work fine, even through restarts. I'm not sure why your setup is blowing up the volume.

                                      Normally volumes are only removed if there is no running container associated with it, and you manually run docker volume prune

                                      avidamoeba@lemmy.caA This user is from outside of this forum
                                      avidamoeba@lemmy.caA This user is from outside of this forum
                                      [email protected]
                                      wrote last edited by
                                      #18

                                      Because I clean everything up that's not explicitly on disk on restart:

                                      [Unit]
                                      Description=Immich in Docker
                                      After=docker.service 
                                      Requires=docker.service
                                      
                                      [Service]
                                      TimeoutStartSec=0
                                      
                                      WorkingDirectory=/opt/immich-docker
                                      
                                      ExecStartPre=-/usr/bin/docker compose kill --remove-orphans
                                      ExecStartPre=-/usr/bin/docker compose down --remove-orphans
                                      ExecStartPre=-/usr/bin/docker compose rm -f -s -v
                                      ExecStartPre=-/usr/bin/docker compose pull
                                      ExecStart=/usr/bin/docker compose up
                                      
                                      Restart=always
                                      RestartSec=30
                                      
                                      [Install]
                                      WantedBy=multi-user.target
                                      
                                      W P mangopenguin@lemmy.blahaj.zoneM 3 Replies Last reply
                                      1
                                      • M [email protected]

                                        Its convenient because your data is stored in the same folder that your docker-compose.yaml file is in, making backups or migrations simpler.

                                        avidamoeba@lemmy.caA This user is from outside of this forum
                                        avidamoeba@lemmy.caA This user is from outside of this forum
                                        [email protected]
                                        wrote last edited by
                                        #19

                                        Yup. Everything is in one place and there's no hardcoded paths outside of the work dir making it trivial to move across storage or even machines.

                                        1 Reply Last reply
                                        0
                                        • avidamoeba@lemmy.caA [email protected]

                                          Because I clean everything up that's not explicitly on disk on restart:

                                          [Unit]
                                          Description=Immich in Docker
                                          After=docker.service 
                                          Requires=docker.service
                                          
                                          [Service]
                                          TimeoutStartSec=0
                                          
                                          WorkingDirectory=/opt/immich-docker
                                          
                                          ExecStartPre=-/usr/bin/docker compose kill --remove-orphans
                                          ExecStartPre=-/usr/bin/docker compose down --remove-orphans
                                          ExecStartPre=-/usr/bin/docker compose rm -f -s -v
                                          ExecStartPre=-/usr/bin/docker compose pull
                                          ExecStart=/usr/bin/docker compose up
                                          
                                          Restart=always
                                          RestartSec=30
                                          
                                          [Install]
                                          WantedBy=multi-user.target
                                          
                                          W This user is from outside of this forum
                                          W This user is from outside of this forum
                                          [email protected]
                                          wrote last edited by
                                          #20

                                          But why?

                                          why not just down up normally and have a cleanup job on a schedule to get rid of any orphans?

                                          C 1 Reply Last reply
                                          7
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups