magma-2.7 2.0/example/example_f.F90 fails with GPU id set to 1

Issue #64 resolved
Timothy Kaiser created an issue

Running the Fortran and C++ examples magma-2.7 2.0/example/[example_f.F90,example_v1.cpp]
I note that the Fortran example fails if I try to run GPU 1 instead of GPU 0. The C++
example works fine on either GPU. These examples call the Fortran and C++ versions of
magma_zgesv_gpu.

These were run on a machine that has two V100 cards, Intel compilers, gcc 10.x, Cuda 7.x.

I was able to see that the Fortran version started a process on each of the GPUs but the
C++ version only started a process on either 0 or 1. It looks like something in this
routine has GPU 0 hard coded.

I modified the two codes to read the GPU id and then call the Fortran and C++ versions of
magma_setdevice(id). Can someone try to replicate this?

Here are the mods and results:

**** example_f.F90 ****
integer id
call magmaf_init()

read(*,*)id
write(*,*)"setting gpu to ",id
call magmaf_setdevice(id)

[tkaiser2@r103u21 example]$ ./example_f
0
setting gpu to 0
using MAGMA CPU interface
using MAGMA GPU interface
[tkaiser2@r103u21 example]$ ./example_f
1
setting gpu to 1
using MAGMA CPU interface
using MAGMA GPU interface
magma_zgesv_gpu failed with info= -112
Error: magmaf_free( dA ) failed: -115
Error: magmaf_free( dX ) failed: -115
[tkaiser2@r103u21 example]$

**** example_v1.cpp ****

magma_device_t id;
id=1;
scanf("%d",&id);
printf("setting gpu to %d\n",id);
magma_setdevice(id);

[tkaiser2@r103u21 example]$ ./example_v1
1
setting gpu to 1
using MAGMA CPU interface
using MAGMA GPU interface
[tkaiser2@r103u21 example]$ ./example_f
0
setting gpu to 0
using MAGMA CPU interface
using MAGMA GPU interface
[tkaiser2@r103u21 example]$

Comments (1)

  1. Timothy Kaiser reporter

    The Fortran version of the code has a "call magmaf_queue_create( 0, queue )" "hard coding" to gpu 0 and the C++ version does not.

  2. Log in to comment