# Reference materials (Driver/library) To use MANUFACIA GPU version on a server with GPU board, both CUDA and NVIDIA Driver should be installed there. Some drivers and libraries are hardware dependent and may not properly work with some specific version combinations. It is, therefore, not fully guaranteed to work by following the description below. Folllowing capters are samples of commands which may necessary to install/uninstall drivers and libraries. ## How to install drivers/libraries ### Updating MANUFACIA from v2.0/v2.1/v2.1.2 If CUDA10.x is already installed, follow [the instruction below](#uninstall-drivers) to uninstall them and then update NVIDIA Driver/CUDA. Refer to [this capter](#check-driver-version) to see how to check the versions. Follow the steps below to check if versions of CUDA and NVIDIA Driver are the ones recommended. ```console # docker exec -it manufacia_app_1 bash :~/rb#cat public/docker-build-conf.txt [Output example] BASE_IMAGE: nvidia/cuda:11.0.3-base-ubuntu18.04-sha256:286bf9986338ef4270411c8608db9b20333d6206bbc2a26808ab78d6af2a1efe COMPOSE_FILE: /nix/store/fx3wiq56nnxwxcajvwbfcwanjpkyjipy-docker-compose.gpu.yaml CUDA_VERSION: 11.0.3 DOCKER_IMAGE: manufacia:2.3.0-gpu RAILS_ENV: production USE_GPU: true :~/rb# nvidia-smi [Output example] (The CUDA version below is not necessarily the same as the one above.) Wed Jun 22 06:42:12 2022 +-----------------------------------------------------------------------------+ | NVIDIA-SMI 460.91.03 Driver Version: 460.91.03 CUDA Version: 11.2 | |-------------------------------+----------------------+----------------------+ ``` After installation of drivers, restart the system and then check if NVIDIA Docker is working. ``` $ sudo reboot ``` ``` $ service docker start  ``` ### Using MANUFACIA for the first time #### Docker related - Docker stable version ``` $ sudo curl https://get.docker.com | sh ``` - Docker Compose 1.26.0 ``` $ sudo curl -L "https://github.com/docker/compose/releases/download/1.26.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose $ sudo chmod +x /usr/local/bin/docker-compose ``` - NVIDIA Driver 460.91.03 Go to official NVIDIA download site (https://www.nvidia.com/download/driverResults.aspx/177149/en-us/) to make sure if your hardware is supported in the `SUPPORTED PRODUCTS` tab, then press `DOWNLOAD` button above to download the driver of version 460.91.03. Before installing the driver, follow the steps below to deactivate default OSS driver (nouveau). ``` $ sudo vi /etc/modprobe.d/blacklist-nouveau.conf ``` Add following two lines at the bottom of `blacklist-nouveau.conf` ``` blacklist nouveau options nouveau modeset=0 ``` Update the system with the modification, then reboot. ``` $ sudo update-initramfs -u $ reboot ``` Execute the file just downloaded (NVIDIA-Linux-x86_64-460.91.03.run) to install drivers and other necessary applications. ``` $ chmod +x NVIDIA-Linux-x86_64-460.91.03.run $ sudo ./NVIDIA-Linux-x86_64-460.91.03.run ``` After installation, restart the system again. - NVIDIA Docker 2.3.0-1 ``` $ distribution=$(. /etc/os-release;echo $ID$VERSION_ID) $ curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add - $ curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list $ sudo apt update $ sudo apt install -y nvidia-docker2=2.3.0-1 ``` After installing NVIDIA Dorker, restart the system and execute following command to check versions of drivers installed. ``` $ sudo docker run --runtime=nvidia --rm nvidia/cuda:11.1-base nvidia-smi ``` (check-driver-version)= ## How to check versions Please refer to [Recommended system requirements](./index_1.html#recommended-system-requirements) to confirm if the version of driver/library are supported. - Docker ``` $ docker version ``` ->If it fails, >(1) start docker. ``` $ service docker start ``` >(2) install the supported version, if you have the one with different version. - docker-compose ``` $ docker-compose --version ``` >->If it fails, ``` $ systemctl enable docker ``` - NVIDIA-Driver ``` $ nvidia-smi ``` >->GPU card of your MANUFACIA server may not be supported by the recommended CUDA version. - CUDA ``` $ ls -l /usr/local | grep cuda ``` - nvidia-docker ``` $ nvidia-docker -v ``` If the versions of drivers or libraries that are installed are not as same as the supported environment, follow [the instruction below](#uninstall-drivers) to uninstall them first and then install the version recommended. (uninstall-drivers)= ## How to uninstall drivers/libraries - NVIDIA Driver/CUDA ``` $ sudo apt purge cuda* $ sudo apt purge nvidia-* $ sudo apt purge libcuda* $ sudo apt-get purge libnvidia* $ sudo apt autoremove $ reboot ``` - Docker ``` $ sudo yum remove docker-ce $ sudo apt-get remove docker docker-engine docker.io containerd runc $ sudo rm -rf /var/lib/docker $ sudo apt autoremove ``` - Docker Compose ``` $ sudo rm /usr/local/bin/docker-compose ```