PaStiX4CalculiX does not use GPU

Hello everyone,
I was able to compile calculix with pastix solver on Centos7.
But Pastix does not use nor see any nvidia GPU. Output on solving is:

  • PaStiX : Parallel Sparse matriX package     +
    

±------------------------------------------------+
Version: 6.0.1
Schedulers:
sequential: Enabled
thread static: Started
thread dynamic: Disabled
PaRSEC: Started
StarPU: Disabled
Number of MPI processes: 1
Number of threads per process: 12
Number of GPUs: 0
MPI communication support: Disabled
Distribution level: 2D( 128)
Blocking size (min/max): 1024 / 2048

Matrix type: General
Arithmetic: Float
Format: CSC
N: 126300
nnz: 10132848

I compiled PaStiX4CalculiX with make_pastix.sh from the calculix source tarball and edited CMakeLists.txt at:

GPU engine parameters

option(PASTIX_WITH_CUDA
“Enable GPU support using CUDA kernels” ON)

Has anybody successfully used ccx+pastix on gpu?
How can I tell pastix to use the gpu?

Any help is appreciated.
Kind Regards, and thanks in advance

Maybe try changing the parameter for (in the console):
export PASTIX_GPU=1

pastix.c (line 790):

const char* pastix_gpu = getenv("PASTIX_GPU");
if(pastix_gpu)
	gpu = (*pastix_gpu == '1') ? 1 : 0;

I didn’t recognize there was an environment variable PASTIX_GPU
It works, thank you very much!

But it works for real or just changed value: “Number of GPUs:”?

Yes it works because I’m getting a

[1] 29649 segmentation fault (core dumped) ./ccx_2.17_i8
at runtime (second increment) due to
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x0000000000e3381e in performLightLsMV ()

so I think it works (and I made a mistake while compiling…)

I have the same problem. If I am using PrePoMax v2.1.0 where to I insert the “export PASTIX_GPU=1” command?

In your command line and run from there

I was able to compile CalculiX with the PaStiX solver with cuda. I set correctly the PASTIX_GPU = 1
I wonder how is possible to increase the number of GPU used? In the log I sow: Not reusing csc.
±------------------------------------------------+

  • PaStiX : Parallel Sparse matriX package     +
    

±------------------------------------------------+
Version: 6.0.1
Schedulers:
sequential: Enabled
thread static: Started
thread dynamic: Disabled
PaRSEC: Disabled
StarPU: Disabled
Number of MPI processes: 1
Number of threads per process: 2
Number of GPUs: 1
MPI communication support: Disabled
Distribution level: 2D( 128)
Blocking size (min/max): 1024 / 2048

Matrix type: General
Arithmetic: Float
Format: CSC
N: 514302
nnz: 31369950

±------------------------------------------------+
it it right to obtain Number of GPUs: 1?

Alex

1 Like

Try running with and without setting PASTIX_GPU = 1, and see if this makes a difference in runtime.

Don’t worry about that. It has nothing to do with the GPU.

if I set PASTIX_GPU = 1 the nvidia-smi show me the correct usage of the GPU card, but only 15W on 65W are used. If I put PASTIX_GPU = 0 the CPU are used , no nvidia-smi are displayed but the execution time is nearly the same.
I compiled PaStiX4CalculiX without PaRSEC nor starPU because of Threads::Threads error. Without runtime system environment scheduler like PaRSEC or starPU the GPU are not parallized? How could I set the number of GPU?

I’m not sure. PaRSEC is is set in one of the data structures in the source code file pastix.c. But I can’t see there how it’s used.

Looking at pastix.c in the CalculiX source code, it does use OpenMP quite a bit. So I would suggest setting the environment variable OMP_NUM_THREADS to the number of physical cores that your CPU has (not counting hyperthreading).

1 Like