.. _video-cards: Multiple Video Cards Usage ======================================== Should you have several video cards installed on a physical server, you can create additional ``findface-extraction-api-gpu`` or ``findface-video-worker-gpu`` instances and distribute them across the video cards, one instance per card. .. rubric:: In this section: .. contents:: :local: Allocate ``findface-video-worker-gpu`` to Additional Video Card ----------------------------------------------------------------------------- To create an additional ``findface-video-worker-gpu`` instance and allocate it to a different video card, do the following: #. Display the ``findface-video-worker-gpu`` primary service status by executing: .. code:: sudo systemctl status findface-video-worker-gpu.service #. Find the full path to the service in the line ``Loaded: loaded (/lib/systemd/system/findface-video-worker-gpu.service; enabled; vendor preset: enabled``. It is ``findface-video-worker-gpu.service`` in our example (name may vary). Create a copy of the service under a new name. .. code:: sudo cp /lib/systemd/system/findface-video-worker-gpu.service /lib/systemd/system/findface-video-worker-gpu2.service` #. In the same manner, create a copy of the primary service configuration file under a new name. .. code:: sudo cp /etc/findface-video-worker-gpu.ini /etc/findface-video-worker-gpu2.ini #. Open the just created configuration file and actualize the video card number to use. .. code:: sudo vim /etc/findface-video-worker-gpu2.ini ## cuda device number device_number = 1 #. Open the new service and actualize the configuration file to use by specifying the just created one. .. code:: sudo vim /lib/systemd/system/findface-video-worker-gpu2.service ExecStart=/usr/bin/findface-video-worker-gpu --config /etc/findface-video-worker-gpu2.ini #. Reload the ``systemd`` daemon to apply the changes. .. code:: sudo systemctl daemon-reload #. Enable the new service autostart. .. code:: sudo systemctl enable findface-video-worker-gpu2.service Created symlink from /etc/systemd/system/multi-user.target.wants/findface-video-worker-gpu2.service to /lib/systemd/system/findface-video-worker-gpu2.service #. Launch the new service. .. code:: sudo systemctl start findface-video-worker-gpu2.service #. Check the both ``findface-video-worker-gpu`` services status. .. code:: sudo systemctl status findface-video-worker-* | grep -i 'Active:' -B 3 ● findface-video-worker-gpu2.service - findface-video-worker-gpu daemon Loaded: loaded (/lib/systemd/system/findface-video-worker-gpu2.service; enabled; vendor preset: enabled) Active: active (running) since Thu 2019-07-18 10:32:02 MSK; 1min 11s ago ... ● findface-video-worker-gpu.service - findface-video-worker-gpu daemon Loaded: loaded (/lib/systemd/system/findface-video-worker-gpu.service; enabled; vendor preset: enabled) Active: active (running) since Mon 2019-07-15 15:18:33 MSK; 2 days ago