I. Ubuntu server
change to root: sudo su -
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get update && sudo apt-get upgrade -y
1a. Create user
https://askubuntu.com/questions/410244/a-command-to-list-all-users-and-how-to-add-delete-modify-usershttps://www.cyberciti.biz/faq/create-a-user-account-on-ubuntu-linux/
## add user
- -s /bin/bash – Set /bin/bash as login shell of the new account
- -d /home/vivek/ – Set /home/vivek/ as home directory of the new Ubuntu account
- -m – Create the user’s home directory
- -G sudo – Make sure vivek user can sudo i.e. give admin access to the new account
sudo passwd hung
## add group
sudo groupadd sgeadmin
## add user to a group
sudo usermod -a -G sgeadmin sgeadmin
kill -15 1358 # kill process
sudo deluser --remove-home sgeadmin
sudo userdel -r hung
##Delete folder/file
sudo rm -r -f /path/
1b. Unistall app
https://howtoinstall.co/en/ubuntu/xenial/gridengine-master?action=removesudo apt-get autoremove --purge environment-modules
1c. Install gcc
sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update
sudo apt install gcc-10 g++-10 gfortran
## copy folder contain modulefiles to a public folder (use root)
cp -R <source_folder> <destination_folder>
1. Insall Modules
./configure --prefix=/opt/app/Modules --modulefilesdir=/etc/modulefiles
./configure --prefix=/opt/app/Modules --modulefilesdir=/etc/modulefiles
# or use sudo apt, defaut path is: /usr/share/modules/modulefiles.
# https://modules.readthedocs.io/en/latest/INSTALL.html#requirements
sudo apt-get install tcl environment-modules
sudo reboot
sudo reboot
## copy folder contain modulefiles to a public folder (use root)
cp -R <source_folder> <destination_folder>
sudo cp -R /home/canlab/wSourceCode/1moduleFiles/lammps /usr/share/modules/modulefiles
sudo cp -R /home/canlab/wSourceCode/1moduleFiles/ompi /usr/share/modules/modulefiles
2. install cuda
https://medium.com/@exesse/cuda-10-1-installation-on-ubuntu-18-04-lts-d04f89287130https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html
(defaul path when install with sudo apt: usr/local)
export LD_LIBRARY_PATH=/usr/local/cuda-10.2/lib64:$LD_LIBRARY_PATH
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt install cuda-10-2
# use
export PATH=/usr/local/cuda-10.2/bin:$PATHexport LD_LIBRARY_PATH=/usr/local/cuda-10.2/lib64:$LD_LIBRARY_PATH
#test
nvcc --version # cuda version
nvidia -smi # nvidia driver
2. OpenMPI + gcc +gpu
#GCCsudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt install gcc-10 g++-10 gfortran
##
tar xvf openmpi-4.1.0rc3.tar.gz
cd openmpi-4.1.0rc3
mkdir buildGCC-cuda && cd buildGCC-cuda
##
export myCUDA=/usr/local/cuda-10.2
../configure CC=gcc CXX=g++ FC=gfortran F77=gfortran \
--with-sge --without-verbs --without-ucx --with-cuda=${myCUDA} \
--prefix=/opt/app/openmpi/4.1.0-gcc7.5-cuda10.2
sudo make install
## use
export PATH=/opt/app/openmpi/4.1.0-gcc7.5-cuda10.2/bin:$PATH
export LD_LIBRARY_PATH=/opt/app/openmpi/4.1.0-gcc7.5-cuda10.2/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/opt/app/openmpi/4.1.0-gcc7.5-cuda10.2/lib:$LD_LIBRARY_PATH
4. install cmake (cannot install with sudo, only 3.10)
sudo apt-get install libssl-devwget https://cmake.org/files/v3.18/cmake-3.18.3.tar.gz
tar zxvf cmake-3.18.3.tar.gz
cd cmake-3.18.3
tar zxvf cmake-3.18.3.tar.gz
cd cmake-3.18.3
./configure --prefix=/opt/app/cmake-3.18.3
make
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/anaconda3/lib
sudo make install
5. Compile lammps
## GPU arch: https://en.wikipedia.org/wiki/CUDA#GPUs_supported### we have TITAN RTX with Turing architecture: https://www.nvidia.com/en-us/deep-learning-ai/products/titan-rtx/
## Libs
sudo apt install zlib1g-dev ocl-icd-opencl-dev pkg-config
sudo apt-get install libblas-dev liblapack-dev libgsl-dev #for plumed
sudo apt-get install libblas-dev liblapack-dev libgsl-dev #for plumed
##
tar -xvf lammps-patch_18Sep2020.tar.gz
cd lammps-patch_18Sep2020
mkdir build-cuda && cd build-cuda
##
module load cmake-3.18.3
module load ompi/4.1.0-gcc7.5-cuda10.2
module load cuda-10.2
#--
export PATH=$PATH:/opt/app/openmpi/4.1.0-gcc7.5-cuda10.2/bin
export PATH=$PATH:/opt/app/openmpi/4.1.0-gcc7.5-cuda10.2/bin
export CC=mpicc
export CXX=mpic++
export FORTRAN=mpifort
export CXX=mpic++
export FORTRAN=mpifort
cmake ../cmake -C ../cmake/presets/all_on.cmake \ -DLAMMPS_EXCEPTIONS=yes -DBUILD_MPI=yes -DBUILD_OMP=yes -DLAMMPS_MACHINE=mpi \ -DPKG_USER-OMP=yes -DPKG_USER-INTEL=no -DPKG_KOKKOS=yes \ -DPKG_GPU=yes -DGPU_API=cuda -D GPU_ARCH=sm_75 \ -DPKG_USER-SMD=yes -DDOWNLOAD_EIGEN3=yes -DDOWNLOAD_VORO=yes \ -DPKG_KIM=no -DDOWNLOAD_KIM=no -DPKG_LATTE=no -DPKG_MSCG=no -DPKG_USER-ATC=no -DPKG_USER-MESONT=no \ -DPKG_USER-ADIOS=no -DPKG_USER-NETCDF=no -DPKG_USER-QUIP=no -DPKG_USER-SCAFACOS=no \ -DPKG_USER-VTK=no -DPKG_USER-H5MD=no \ -DPKG_USER-PLUMED=yes -DDOWNLOAD_PLUMED=yes \ -DCMAKE_C_COMPILER=mpicc -DCMAKE_CXX_COMPILER=mpic++ -DCMAKE_Fortran_COMPILER=mpifort \ -DCMAKE_INSTALL_PREFIX=/opt/app/lammps/master-gpu
sudo make install
No comments:
Post a Comment