Is there a way to create a completly static cuda binary?

Hey,

I’ve been trying to compile a small tool statically. However, when I specify the -static flag, and the --cudart static --cudadevrt static, turns out the libcudart_static.a static library is calling dlopen under the hood. This seems to make it impossible to compile with glibc statically too. (technically it compiles but segfaults directly)

/usr/bin/ld: /usr/local/cuda-12/bin/../targets/x86_64-linux/lib/libcudart_static.a(cudart_static.o): in function `libcudart_static_aa4a6bcb5fce58be20d542d9b467101e0a9360a5':
(.text+0x2453e): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking

NVIDIA’s Single GPU Jacobi implementation

Is there a path around it? Is it really the case that the “static” libcudart library is using dlopen behind the scenes? should I give up on building a completely static binary?

Details:

jacobi.cu.txt (9.8 KB)
Makefile.txt (948 Bytes)

Nevermind, I found this post here that described a similar issu: How to use the static option with g ++ used by nvcc? - #5 by callum.burns

So I’ll have to find a way around it (given the target system I’m trying to run on has a different libc version)