-
Notifications
You must be signed in to change notification settings - Fork 30
Description
I am trying to install spral with gpu support (for eventual use in Ipopt). My hardware (and goal) is the same as a previous issue. Feel free to close this issue if the near-term plan is to use meson entirely moving forward in a way that will reliably build for use in Ipopt. I also tried the current meson build method, setting the gpu option resulted in an error because it didn't know how to compile .cu files. I added cuda to the project languages, but it couldn't find nvcc to compile with (nvcc is available on the command line). I presume this approach is getting fixed up based on this issue. Anyway, here's my results with the configure/make instructions I could find.
My software setup is
fresh install of ubuntu 22.04 LTS
sudo apt-get install -y git build-essential gfortran pkg-config
sudo apt-get install -y libopenblas-dev
sudo apt-get install -y libudev-dev
sudo apt-get install -y autoconf libtool
Get cuda, from:
https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=18.04&target_type=deb_local
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-ubuntu2204.pin
sudo mv cuda-ubuntu2204.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget https://developer.download.nvidia.com/compute/cuda/12.3.1/local_installers/cuda-repo-ubuntu2204-12-3-local_12.3.1-545.23.08-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu2204-12-3-local_12.3.1-545.23.08-1_amd64.deb
sudo cp /var/cuda-repo-ubuntu2204-12-3-local/cuda-*-keyring.gpg /usr/share/keyrings/
sudo apt-get update
sudo apt-get -y install cuda-toolkit-12-3
export CUDA_HOME="/usr/local/cuda" # Change this to your system-specific path. (this should be good here)
export PATH="${PATH}:${CUDA_HOME}/bin"
export LIBRARY_PATH="${LIBRARY_PATH}:${CUDA_HOME}/lib64"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${CUDA_HOME}/lib64"
export C_INCLUDE_PATH="${CPLUS_INCLUDE_PATH}:${CUDA_HOME}/include"
export CPLUS_INCLUDE_PATH="${CPLUS_INCLUDE_PATH}:${CUDA_HOME}/include"
export NVCC_INCLUDE_FLAGS="${NVCC_INCLUDE_FLAGS}:-I${CUDA_HOME}/include"
sudo apt-get install -y nvidia-kernel-open-545
sudo apt-get install -y cuda-drivers-545
Not sure if this hwloc will let me have gpu support. Instructions suggest it must be installed from source but then I believe spral wouldn't even compile (using whatever the git clone of hwloc gave me)
sudo apt-get install -y hwloc libhwloc-dev
sudo reboot now
Redo the cuda exports above.
Going to try to install coin-or's metis to hopefully get compatibility with Ipopt down the road?
(from https://github.com/ralna/spral/blob/master/COMPILE.md)
rm -rf ${HOME}/Software
mkdir -p ${HOME}/Software
cd ${HOME}/Software
git clone https://github.com/coin-or-tools/ThirdParty-Metis.git
cd ThirdParty-Metis && ./get.Metis
mkdir build
cd build
../configure --prefix=${PWD}
make && make install
export METISDIR=${HOME}/Software/ThirdParty-Metis/build
then compile spral
cd ${HOME}/Software/
git clone https://github.com/ralna/spral.git
cd spral
git checkout 5e8b409
./autogen.sh # If compiling from fresh git checkout
mkdir build
cp nvcc_arch_sm.c build/ # If building for GPU
cd build
CFLAGS=-fPIC CPPFLAGS=-fPIC CXXFLAGS=-fPIC FFLAGS=-fPIC \
FCFLAGS=-fPIC NVCCFLAGS="-shared -Xcompiler -fPIC" \
../configure --prefix=${PWD}/build \
--with-blas="-lopenblas" --with-lapack="-llapack" \
--with-metis="-L${METISDIR}/lib -lcoinmetis" \
--with-metis-inc-dir="${METISDIR}/include/coin-or/metis"
make && make install
export OMP_CANCELLATION=TRUE
export OMP_PROC_BIND=TRUE
export SPRALDIR=${PWD}
make check
Compiles fine, make check results in:
PASS: lsmr_test
PASS: rutherford_boeing_test
PASS: scaling_test
PASS: random_test
PASS: random_matrix_test
../test-driver: line 112: 16120 Segmentation fault (core dumped) "$@" >> "$log_file" 2>&1
FAIL: ssids_test
PASS: ssids_kernel_test
PASS: ssmfe_test
PASS: ssmfe_ciface_test
============================================================================
Testsuite summary for spral 2023.07.04
============================================================================
# TOTAL: 9
# PASS: 8
# SKIP: 0
# XFAIL: 0
# FAIL: 1
# XPASS: 0
# ERROR: 0
============================================================================
See ./test-suite.log
Please report to hsl@stfc.ac.uk
============================================================================
make[2]: *** [Makefile:2613: test-suite.log] Error 1
make[2]: Leaving directory '/home/john/Software/spral/build'
make[1]: *** [Makefile:2721: check-TESTS] Error 2
make[1]: Leaving directory '/home/john/Software/spral/build'
make: *** [Makefile:2989: check-am] Error 2
Thanks!