Installing AMGX on Your Computer
Published:
This guide provides a step-by-step approach to installing AMGX on your system. The installation has been tested on:
- Ubuntu 20.04.5 LTS
- CentOS Linux 7 (Core)
Ensure you have an NVIDIA driver installed and can run nvidia-smi
to check details about the driver and GPU. For example:
nvidia-smi
Output:
Sun Jun 19 16:52:32 2022
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 515.76 Driver Version: 515.76 CUDA Version: 11.7 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 NVIDIA RTX A5000 Off | 00000000:C1:00.0 Off | Off |
| 30% 56C P0 72W / 230W | 0MiB / 24564MiB | 2% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| No running processes found |
+-----------------------------------------------------------------------------+
Choosing the Correct CUDA Toolkit Version
Check the CUDA version supported by your driver (shown in the nvidia-smi
output). Install a CUDA Toolkit version equal to or lower than the one mentioned—in this case, 11.7. Although NVIDIA supports forward compatibility for minor versions (reference), issues may arise with unsupported versions. For instance, I encountered problems using CUDA 11.8 despite forward compatibility claims.
To avoid issues, select a CUDA Toolkit version lower than or equal to the supported version.
Installing the CUDA Toolkit
Visit the CUDA Toolkit download page for the latest version. For older versions, search for “CUDA Toolkit
CUDA 11.0 Archive for CentOS 7
Installation with the Run File
I used the run file for installation. If you have sudo
access, the installation is straightforward. However, in most workstation environments where sudo
is unavailable (as in my case), you can:
- Run the file without
sudo
. - Select only the toolkit for installation.
- Use advanced options to change the installation path—I set mine to a directory in my home folder.
Make sure that you add installation path in your .bashrc
:
export CUDA_HOME=/path/to/user/cuda
export PATH=$CUDA_HOME/bin:$PATH
export LD_LIBRARY_PATH=$CUDA_HOME/lib64:$LD_LIBRARY_PATH
Verifying the Installation
Once the installation is complete, run one of the examples provided with the CUDA Toolkit to ensure everything works correctly.
Installing AMGX
To install AMGX, I compiled and built version 2.1.x from the 2.1.x branch of the AMGX GitHub repository.
Ensure you have GCC version 9.4 installed, as other versions may cause errors during the installation process.
After completing the installation, verify it by running the examples mentioned in the README file of the repository. This ensures the installation was successful and that the library is functioning as expected.
Leave a Comment