← Back to team overview

yade-users team mailing list archive

Re: [Question #703335]: Setting Up GPU

 

Question #703335 on Yade changed:
https://answers.launchpad.net/yade/+question/703335

Nima Goudarzi posted a new comment:
Hi Robert,

Thanks. I had been able to check the Cuda capability (Cuda 11.7) and
compile SuitSparse (5.13.0). I even compiled YADE with GPU enabled.

(1) I guess, there is an inconsistency in the Cuda installation
instruction (YADE manual) for adding CUDA library to the path:

Yade manual:

# Add the CUDA library to your path
export PATH=/usr/local/cuda/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda/lib64\ ${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

After installation of Cuda, three different Cuda folders are generated in my usr/local directory 
1- Cuda
2- Cuda 11.7
3-Cuda 11

Original instruction manual:

The PATH variable needs to include export
PATH=/usr/local/cuda-11.8/bin${PATH:+:${PATH}}. Nsight Compute has moved
to /opt/nvidia/nsight-compute/ only in rpm/deb installation method. When
using .run installer it is still located under /usr/local/cuda-11.8/.

To add this path to the PATH variable:

export PATH=/usr/local/cuda-11.8/bin${PATH:+:${PATH}}
In addition, when using the runfile installation method, the LD_LIBRARY_PATH variable needs to contain /usr/local/cuda-11.8/lib64 on a 64-bit system, or /usr/local/cuda-11.8/lib on a 32-bit system

To change the environment variables for 64-bit operating systems:

export LD_LIBRARY_PATH=/usr/local/cuda-11.8/lib64\
                         ${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

This is different from Yade manual. Which one to use?
However neither resolve the blank path issue unless the CUDAPATH is introduced (in the terminal)

For example if Cuda 11.7 is installed:

CUDAPATH=/usr/local/cuda- 11.7
export PATH=/usr/local/cuda- 11.7/bin${PATH: + ${PATH}}
export_LD_LIBRARY_PATH=/usr/local/cuda- 11.7/lib64\ ${LD_LIBRARY_PATH: + :${LD_LIBRARY_PATH}}

and make config within  cd '/usr/local/SuiteSparse-5.13.0'

gives

CUDA root directory:   CUDA PATH=/usr/local/cuda-11.7
.
.
.
Cuda library:        CUDART_LIB=/usr/local/cuda-11.7/lib64/libcudart.so
CUBLAS library:  CUBLAS_LIB=/usr/local/cuda-11.7/lib64/libcublas.so


I am able to compile SuiteSparse-5.13.0 by make after this but am not sure if the provided paths are correct.

(2) Regarding manual entry of CUDA_PATH in SuitSparse_Config.mk if this
is the first few lines for #NVIDIA CUDA configuration for CHOLMOD and
SPQR

CUDA=auto

if fneq ($(CUDA), no)
           CUDA_PATH= $(shell which nvcc 2>/dev/null | sed "s/ \ /bin\ /nvcc//")
else
          CUDA_PATH= 


Manual entry of the CUDA_PATH (enforcing all conditions to point to the location of installed Cuda)
CUDA=auto

if fneq ($(CUDA), no)
           CUDA_PATH= /usr/local/cuda-11.7
else
          CUDA_PATH=/usr/local/cuda-11.7

Leads to the similar result as (1)
Is this the appropriate approach for manual change of  SuitSparse_Config.mk or I need to point to another directory (for example cuda itself-- not cuda 11.7? Please advise

I have been able to verify the accuracy of compilation by executing sh
gpu.sh within SuiteSparse/CHOLMOD/Demo.

3- Here is the cmake command I use for compiling yade:
cmake -DCMAKE_INSTALL_PREFIX=../install ../trunk   -DCHOLMOD_GPU=ON  -DSUITESPARSEPATH=/usr/local/SuiteSparse-5.13.0 

Cmake finds the paths as recommended in YADE manual but the paths are
not the ones I introduce either in SuitSparse_Config.mk  or in the
terminal. Also, multiple identical paths are reported for the same
CHOLMOD (and dependencies such as AMD), SuiteSparse, CuBlas, and Metis.
I feel something is wrong here.

BTW, I can compile YADE with this approach but when I run YADE executable, I get segmentation fault (core dumped).
Similar deployment on an Azure VM gives another error.


 
3- I'm now working on your comment for Cuda 9.0 but need to know which trunk version (for YADE compilation) is compatible with this installation. Also, how important is finding  Nvidia 384.11 GPU drivers? Basically, how can I enforce to install this specific version? 

Thanks so much

Nima

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.