nvidia/cuda/context: Don't try to destroy device contexts
This commit is contained in:
parent
6ba51efceb
commit
0f56f822c3
|
@ -55,8 +55,9 @@ streamfx::nvidia::cuda::context::~context()
|
||||||
|
|
||||||
if (_has_device) {
|
if (_has_device) {
|
||||||
_cuda->cuDevicePrimaryCtxRelease(_device);
|
_cuda->cuDevicePrimaryCtxRelease(_device);
|
||||||
|
} else {
|
||||||
|
_cuda->cuCtxDestroy(_ctx);
|
||||||
}
|
}
|
||||||
_cuda->cuCtxDestroy(_ctx);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
streamfx::nvidia::cuda::context::context()
|
streamfx::nvidia::cuda::context::context()
|
||||||
|
@ -85,6 +86,8 @@ streamfx::nvidia::cuda::context::context(ID3D11Device* device) : context()
|
||||||
throw std::runtime_error("Failed to get device index for device.");
|
throw std::runtime_error("Failed to get device index for device.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_cuda->cuDevicePrimaryCtxSetFlags(_device, context_flags::SCHEDULER_BLOCKING_SYNC);
|
||||||
|
|
||||||
// Acquire Context
|
// Acquire Context
|
||||||
if (result res = _cuda->cuDevicePrimaryCtxRetain(&_ctx, _device); res != result::SUCCESS) {
|
if (result res = _cuda->cuDevicePrimaryCtxRetain(&_ctx, _device); res != result::SUCCESS) {
|
||||||
throw std::runtime_error("Failed to acquire primary device context.");
|
throw std::runtime_error("Failed to acquire primary device context.");
|
||||||
|
|
Loading…
Reference in New Issue