-static-nvidia causing runtime error

I have recently had to re-install cuda and pgf90, and since then Im getting a runtime error when compiling with -static-nvidia. I need to compile with -static in order to run on remote machine which has the GPUs that Im using. However it runs fine (locally) without the -static-nvidia flag.

nvfortran -static-nvidia -acc=multicore -O3 -o ufo-cartes-multi ufo-cartes-25.for

-bash: ./ufo-cartes-multi: cannot execute binary file: Exec format error

$ ldd ./ufo-cartes-multi
        linux-vdso.so.1 (0x00007fffc7743000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f7b74270000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f7b744b0000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f7b74250000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f7b74160000)

This error typically means that your running a binary on a system with a different architecture, like building an x86 binary and trying to run it on ARM, Though I don’t know if that’s what’s happening here.

What’s the output from the following commands:

uname -a
file ./ufo-cartes-multi
nvfortran -static-nvidia -acc=multicore -O3 -v -o ufo-cartes-multi ufo-cartes-25.for

For the verbose output (i.e. adding “-v” in the last command), you can post just the “acclnk” command so I can see which libraries are getting linked, and which directories they are getting pulled from.

Thanks for the suggestions. I ended up resolving the problem with a new installation of ubuntu 20.04 and nvidia compilers and cuda. There must have been some incompatibility introduced somewhere along the way, but it’s OK now.