The following python code causes a segfault on exit:
from ctypes import c_int, CDLL
cudartlib = CDLL(‘libcudart.so’)
err = cudartlib.cudaSetDevice(c_int(0))
The command works as desired (err=0 and can verify elsewhere that it sets the device correctly), and things go fine until I exit python, and which point the segfault occurs.
This is on 64-bit ubuntu. It work without a segfault on a mac (changing .so to .dylib), but I don’t know if that’s the OS or the fact that it only has one GPU.
Thanks for any insights.