Still don’t have a code example, but what I have it the following.
We are packaging an application with pytorch, and somehow there are some scenarios that cause the error in the JIT. One such scenario, though not sure it is reproducible, is running our app trought X11 forwarding inside a vm, though using the vm graphic environment, does not cause the error.
Plus on a host (no vm) we are also getting the error, though, trying to correlate that, seems difficult.
So, my hypothesis is that something on the graphic driver detection layer is causing the JIT to compile some different code, which is leading to the error. Though trying to follow on the code, I could not pinpoint which code is being selected to be compiled by the JIT.
Followed the register_aten_ops, that it seems, it is where the error happens, but I cannot find such file with a line 15758, not even find a file in such location
#14 0x00007f8d634c49d6 in __static_initialization_and_destruction_0 (__priority=<optimized out>, __initialize_p=<optimized out>) at torch/csrc/jit/generated/register_aten_ops.cpp:15758

The collect_env.py returns this:
Collecting environment information...
PyTorch version: 0.4.1
Is debug build: No
CUDA used to build PyTorch: 9.0.176

OS: Ubuntu 16.04.5 LTS
GCC version: (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609
CMake version: version 3.12.1

Python version: 3.6
Is CUDA available: No
CUDA runtime version: No CUDA
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA

Versions of relevant libraries:
[pip] Could not collect
[conda] Could not collect