Thanks for looking at this.
I built from source with the PR you linked.
I still got the “Illegal instruction (core dumped)” error, but it’s different this time:

Thread 1 "python" received signal SIGSEGV, Segmentation fault.
THCPModule_initExtension (self=<optimized out>) at torch/csrc/cuda/Module.cpp:354
354       auto _state_cdata = THPObjectPtr(PyLong_FromVoidPtr(state));

GDB complete output: https://pastebin.com/f4kSG5ve 3
Is still the same problem or did I mess up while building from source?