mirror of
https://github.com/blender/blender
synced 2026-09-26 16:15:47 +03:00
Fix: CUDA module memory leak since using primary context
Previously the CUDA context was always destroyed and the module along with it. Now that this no longer happens, the missing module free became a memory leak. Also fix the same issue for HIP, though this is destroying the context so it's not a problem yet. Fix part of #119035 Co-authored-by: Brecht Van Lommel <brecht@blender.org>
This commit is contained in:
parent
e480b6a50c
commit
60e8b56bcd
2 changed files with 6 additions and 2 deletions
|
|
@ -135,7 +135,9 @@ CUDADevice::CUDADevice(const DeviceInfo &info, Stats &stats, Profiler &profiler)
|
|||
CUDADevice::~CUDADevice()
|
||||
{
|
||||
texture_info.free();
|
||||
|
||||
if (cuModule) {
|
||||
cuda_assert(cuModuleUnload(cuModule));
|
||||
}
|
||||
cuda_assert(cuDevicePrimaryCtxRelease(cuDevice));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -126,7 +126,9 @@ HIPDevice::HIPDevice(const DeviceInfo &info, Stats &stats, Profiler &profiler)
|
|||
HIPDevice::~HIPDevice()
|
||||
{
|
||||
texture_info.free();
|
||||
|
||||
if (hipModule) {
|
||||
hip_assert(hipModuleUnload(hipModule));
|
||||
}
|
||||
hip_assert(hipCtxDestroy(hipContext));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue