Skip to content
Snippets Groups Projects
Commit 53c49589 authored by Patrick Mours's avatar Patrick Mours Committed by Thomas Dinges
Browse files

Fix #119959: Enabling "Distribute memory between devices" for Cycles results in error

With the switch to using the primary CUDA context it became possible
for peer access between CUDA devices to already have been enabled for
that context, either by a previous Cycles session or third-party library,
thus causing the call to `cuCtxEnablePeerAccess` to return
`CUDA_ERROR_PEER_ACCESS_ALREADY_ENABLED`. This is not a failure
state however, so just needs to be handled like a success return value.

Pull Request: https://projects.blender.org/blender/blender/pulls/120255
parent 41d6f03f
No related branches found
Tags
No related merge requests found
...@@ -187,7 +187,7 @@ bool CUDADevice::check_peer_access(Device *peer_device) ...@@ -187,7 +187,7 @@ bool CUDADevice::check_peer_access(Device *peer_device)
{ {
const CUDAContextScope scope(this); const CUDAContextScope scope(this);
CUresult result = cuCtxEnablePeerAccess(peer_device_cuda->cuContext, 0); CUresult result = cuCtxEnablePeerAccess(peer_device_cuda->cuContext, 0);
if (result != CUDA_SUCCESS) { if (result != CUDA_SUCCESS && result != CUDA_ERROR_PEER_ACCESS_ALREADY_ENABLED) {
set_error(string_printf("Failed to enable peer access on CUDA context (%s)", set_error(string_printf("Failed to enable peer access on CUDA context (%s)",
cuewErrorString(result))); cuewErrorString(result)));
return false; return false;
...@@ -196,7 +196,7 @@ bool CUDADevice::check_peer_access(Device *peer_device) ...@@ -196,7 +196,7 @@ bool CUDADevice::check_peer_access(Device *peer_device)
{ {
const CUDAContextScope scope(peer_device_cuda); const CUDAContextScope scope(peer_device_cuda);
CUresult result = cuCtxEnablePeerAccess(cuContext, 0); CUresult result = cuCtxEnablePeerAccess(cuContext, 0);
if (result != CUDA_SUCCESS) { if (result != CUDA_SUCCESS && result != CUDA_ERROR_PEER_ACCESS_ALREADY_ENABLED) {
set_error(string_printf("Failed to enable peer access on CUDA context (%s)", set_error(string_printf("Failed to enable peer access on CUDA context (%s)",
cuewErrorString(result))); cuewErrorString(result)));
return false; return false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment