Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

memory was not free. nvcomp python api #206

Open
Eutenacity opened this issue Aug 8, 2024 · 1 comment
Open

memory was not free. nvcomp python api #206

Eutenacity opened this issue Aug 8, 2024 · 1 comment

Comments

@Eutenacity
Copy link

how to free gpu memory allocated by nvcomp? The code will allocate 24GB GPU memory and free until code end.

import numpy as np
from nvidia import nvcomp
import torch
import gc
alogs = ['lz4','ANS', "Cascaded"]
codec = nvcomp.Codec(algorithm=alogs[0])
data_gpu = torch.randn(4096*14336,dtype=torch.float16,device = "cuda:0")
nvarr_d = nvcomp.as_array(data_gpu)
com_arr = codec.encode(nvarr_d)
a = torch.tensor(com_arr.cpu(),dtype=torch.int8).cuda()
for i in range(32*8):
    
    
    b = nvcomp.as_array(a)
    dec_arr = codec.decode(b,data_type="<f2")
    
    del dec_arr
    
    torch.cuda.empty_cache()
    gc.collect()

@naveenaero
Copy link

Hi @Eutenacity
Thank you for reporting this memory leak issue. We are actively working to fix this and will include the fix in the next release of nvCOMP.

@rsdubtso rsdubtso assigned rsdubtso and unassigned rsdubtso Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants