Skip to content

GPU memory usage increases after creating new instances in different threads #1777

@ThiagoMateo

Description

@ThiagoMateo

Summary

Platform

OS:

Faiss version: 1.7.0

Installed from: pypip

Faiss compilation options:

Running on: I9 9900X - 32GB - RTX 2080ti

  • CPU
  • [ x ] GPU

Interface:

  • C++
  • [ x ] Python

Reproduction instructions

RuntimeError: Error in virtual void* faiss::gpu::StandardGpuResourcesImpl::allocMemory(const faiss::gpu::AllocRequest&) at /__w/faiss-wheels/faiss-wheels/faiss/faiss/gpu/StandardGpuResources.cpp:443: Error: 'err == cudaSuccess' failed: Failed to cudaMalloc 1610612736 bytes on device 0 (error 2 out of memory
Outstanding allocations

Each time I create a new instance, faiss-gpu is allocated a large amount of GPU memosy.
https://github.com/HoangTienDuc/github_issues/blob/faiss/subcrib_message.py#L34
So with 11gb GPU memory I can only create 5 threads on it.
How to solve this problem? I want to create more threads.
Can you please take a check at https://github.com/HoangTienDuc/github_issues/tree/faiss#issue-detail

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions