• Arnaud Bergeron's avatar
    Fix random segfault on exit when the new backend is in use. · bb170f4f
    Arnaud Bergeron 提交于
    The problem is that the old backend assumes it is alone in the
    universe and even when not in use will interact with the gpu.  Most
    notably in this case it will forcibly destroy any primary context on
    exit.  The only problem is that we are also using the primary context
    and our cleanup handlers run after those of the old backend.
    
    This is a major problem because cublas uses the runtime api which will
    create a context whenever it thinks it needs one (like for cudaFree).
    However all the allocations are from the old context that the old
    backend destroyed.  So when it tries to clean up its resources the
    low-level handlers get confused and we end up in a segmentation fault.
    
    As to why it doesn't always happen, I figure it's because sometimes we
    get lucky and addresses line up or something.
    
    Anyway, if we stop the old backend from calling cudaThreadExit() the
    segfaults go away.  This may cause a very small leakage of resources
    for the few seconds we are running until we exit, but I don't think
    this will be a problem.
    bb170f4f
名称
最后提交
最后更新
.jenkins 正在载入提交数据...
benchmark 正在载入提交数据...
bin 正在载入提交数据...
doc 正在载入提交数据...
theano 正在载入提交数据...
.gitignore 正在载入提交数据...
.mailmap 正在载入提交数据...
.travis.yml 正在载入提交数据...
CONTRIBUTING.md 正在载入提交数据...
DESCRIPTION.txt 正在载入提交数据...
EMAIL.txt 正在载入提交数据...
HISTORY.txt 正在载入提交数据...
ISSUE_TEMPLATE.md 正在载入提交数据...
LICENSE.txt 正在载入提交数据...
MANIFEST.in 正在载入提交数据...
NEWS.txt 正在载入提交数据...
NEWS_DEV.txt 正在载入提交数据...
PULL_REQUEST_TEMPLATE.md 正在载入提交数据...
README.txt 正在载入提交数据...
Theano.pyproj 正在载入提交数据...
Theano.sln 正在载入提交数据...
requirement-rtd.txt 正在载入提交数据...
setup.cfg 正在载入提交数据...
setup.py 正在载入提交数据...