balbasty / nitorch

Neuroimaging in PyTorch
Other
83 stars 14 forks source link

Store PyTorch version somewhere in libnitorch #19

Open balbasty opened 3 years ago

balbasty commented 3 years ago

NiTorch's c++/cuda library (libnitorch) is compiled against pytorch's c++/cuda library (libtorch). From one version of pytorch to the next, changes in libtorch can cause symbols to disappear, leading to errors when the library that's loaded at runtime differs from the one used at build time (say if nitorch is compiled against pytorch 1.5 but pytorch 1.6 is used at run time).

We should at least have a way to check, when nitorch is loaded, that it is compatible with the current pytorch version. To do that, we need to store pytorch's version somewhere in libnitorch at build time and have a python binding so that it can be inspected at run time.