.. _linux-rpms:

Linux RPMs
----------

For Linux machines that will not use the Docker image or DEB, an RPM installation is available for the following environments:

- x86_64 RHEL 7, CentOS 7, or SLES 12
- ppc64le RHEL 7

The installation steps assume that you have a license key for Driverless AI. For information on how to obtain a license key for Driverless AI, visit https://www.h2o.ai/products/h2o-driverless-ai/. Once obtained, you will be promted to paste the license key into the Driverless AI UI when you first log in, or you can save it as a .sig file and place it in the \license folder that you will create during the installation process.

Environment
~~~~~~~~~~~

+-------------------------+---------+
| Operating System        | Min Mem |
+=========================+=========+
| RHEL with GPUs          | 64 GB   |
+-------------------------+---------+
| RHEL with CPUs          | 64 GB   |
+-------------------------+---------+
| CentOS 7 with GPUS      | 64 GB   |
+-------------------------+---------+
| CentOS 7 with CPUs      | 64 GB   |
+-------------------------+---------+
| SLES 12 with GPUs       | 64  GB  |
+-------------------------+---------+
| SLES 12 with CPUs       | 64  GB  |
+-------------------------+---------+

Requirements
~~~~~~~~~~~~

- RedHat 7/CentOS 7/SLES 12
- Cuda 9 or 9.2
- cuDNN >=7.2.1 (Required only if using TensorFlow.)
- Driverless AI RPM, available from https://www.h2o.ai/download/.

About the Install
~~~~~~~~~~~~~~~~~

.. include:: linux-rpmdeb-about.frag

Installing Driverless AI
~~~~~~~~~~~~~~~~~~~~~~~~

Run the following commands to install the Driverless AI RPM. Replace <VERSION> with your specific version.

::

    # Optionally install libraries to enable PDF documentation generation.
    sudo yum install -y cairo pango

    # Install Driverless AI.
    sudo rpm -i dai-VERSION.rpm

By default, the Driverless AI processes are owned by the 'dai' userand 'dai' group.  You can optionally specify a different service user and group as shown below.  Replace <myuser> and <mygroup> as appropriate.

::

    # Temporarily specify service user and group when installing Driverless AI.
    # rpm saves these for systemd in the /etc/dai/User.conf and /etc/dai/Group.conf files.
    sudo DAI_USER=myuser DAI_GROUP=mygroup rpm -i dai-VERSION.rpm

You may now optionally make changes to **/etc/dai/config.toml**.


Starting NVIDIA persistence Mode
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If you have NVIDIA GPUs, perform the following two NVIDIA commands to improve performance. For more information: http://docs.nvidia.com/deploy/driver-persistence/index.html.

::

    sudo nvidia-persistenced --user dai
    sudo nvidia-smi -pm 1

Starting Driverless AI
~~~~~~~~~~~~~~~~~~~~~~

If you have systemd (preferred):

::

    # Start Driverless AI.
    sudo systemctl start dai

If you do not have systemd:

::
    
    # Start Driverless AI.
    sudo -H -u dai /opt/h2oai/dai/run-dai.sh

Looking at Driverless AI log files
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If you have systemd (preferred):

::

    sudo systemctl status dai-dai
    sudo systemctl status dai-h2o
    sudo systemctl status dai-procsy
    sudo systemctl status dai-vis-server
    sudo journalctl -u dai-dai
    sudo journalctl -u dai-h2o
    sudo journalctl -u dai-procsy
    sudo journalctl -u dai-vis-server

If you do not have systemd:

::

    sudo less /opt/h2oai/dai/log/dai.out
    sudo less /opt/h2oai/dai/log/h2o.out
    sudo less /opt/h2oai/dai/log/procsy.out
    sudo less /opt/h2oai/dai/log/vis-server.out

Stopping Driverless AI
~~~~~~~~~~~~~~~~~~~~~~

If you have systemd (preferred):

::

    # Stop Driverless AI.
    sudo systemctl stop dai

    # The processes should now be stopped.  Verify.
    sudo ps -u dai

If you do not have systemd:

::

    # Stop Driverless AI.
    sudo pkill -U dai

    # The processes should now be stopped.  Verify.
    sudo ps -u dai

Upgrading Driverless AI
~~~~~~~~~~~~~~~~~~~~~~~

**WARNING**: This is currently alpha software status. Back up your data (especially the Driverless AI tmp directory) before attempting.

**WARNING**: Experiments, MLIs, and MOJOs are not automatically upgraded when Driverless AI is upgraded.

- Build MLI models before upgrading.
- Build MOJO pipelines before upgrading.

 If you did not build MLI on a model before upgrading Driverless AI, then you will not be able to view MLI on that model after upgrading. Before upgrading, be sure to run MLI jobs on models that you want to continue to interpret in future releases. If that MLI job appears in the list of Interpreted Models in your current version, then it will be retained after upgrading.

 If you did not build a MOJO pipeline on a model before upgrading Driverless AI, then you will not be able to build a MOJO pipeline on that model after upgrading.  Before upgrading, be sure to build MOJO pipelines on all desired models.  

The upgrade process inherits the service user and group from /etc/dai/User.conf and /etc/dai/Group.conf.  You do not need to manually specify the DAI_USER or DAI_GROUP environment variables during an upgrade.

If you have systemd (preferred):

::

    # Stop Driverless AI.
    sudo systemctl stop dai

    # The processes should now be stopped.  Verify.
    sudo ps -u dai

    # Back up your /opt/h2oai/dai/tmp directory at this time. If you do not, all previous data will be lost.

    # Upgrade and restart.
    sudo rpm -U dai-NEWVERSION.rpm
    sudo systemctl daemon-reload
    sudo systemctl start dai

If you do not have systemd:

::

    # Stop Driverless AI.
    sudo pkill -U dai

    # The processes should now be stopped.  Verify.
    sudo ps -u dai

    # Back up your /opt/h2oai/dai/tmp directory at this time. If you do not, all previous data will be lost.

    # Upgrade and restart.
    sudo rpm -U dai-NEWVERSION.rpm
    sudo -H -u dai /opt/h2oai/dai/run-dai.sh

Uninstalling Driverless AI
~~~~~~~~~~~~~~~~~~~~~~~~~~

If you have systemd (preferred):

::

    # Stop Driverless AI.
    sudo systemctl stop dai

    # The processes should now be stopped.  Verify.
    sudo ps -u dai

    # Uninstall.
    sudo rpm -e dai

If you do not have systemd:

::

    # Stop Driverless AI.
    sudo pkill -U dai

    # The processes should now be stopped.  Verify.
    sudo ps -u dai

    # Uninstall.
    sudo rpm -e dai

*CAUTION!* At this point you can optionally completely remove all remaining files, including the database. (This cannot be undone.)

::

    sudo rm -rf /opt/h2oai/dai
    sudo rm -rf /etc/dai
