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

GPU memory increased by 4GiB when running rasterizer #1107

Open
CHMimilanlan opened this issue Dec 14, 2024 · 0 comments
Open

GPU memory increased by 4GiB when running rasterizer #1107

CHMimilanlan opened this issue Dec 14, 2024 · 0 comments

Comments

@CHMimilanlan
Copy link

It's a wired problem, which bothered me for a whole day.
when i running code below:

self.raster_settings = GaussianRasterizationSettings(
    image_height=self.image_size,
    image_width=self.image_size,
    tanfovx=self.tanfov,
    tanfovy=self.tanfov,
    bg=self.bg,
    scale_modifier=1.0,
    viewmatrix=w2c,
    projmatrix=full_proj,
    sh_degree=0,
    campos=cam_center,
    prefiltered=False,
    debug=False,
    antialiasing=True
)
self.rasterizer = GaussianRasterizer(raster_settings=self.raster_settings)
rendered_image, _ ,_ = self.rasterizer( 
    means3D = means3D,
    means2D = screenspace_points,
    colors_precomp = colors_precomp,
    opacities = opacities,
    scales = scales,
    rotations = rotations,
    cov3D_precomp = None)

CUDA memory increased by 4GiB, which is unbearable. That code is supposed to run several times. Each time that code is run, CUDA memory grows by 4GB until the CUDA out of memory.
I check the shape of each variable, it seems that it wasn't the problem of the size of variables, every variables are in expected shape.

means3D.shape=torch.Size([50200, 3])
screenspace_points.shape=torch.Size([50200, 3])
colors_precomp.shape=torch.Size([50200, 3])
opacities.shape=torch.Size([50200, 1])
scales.shape=torch.Size([50200, 1])
rotations.shape=torch.Size([50200, 4])

And the output size is also in expected shape, rendered_image.shape=torch.Size([3, 1024, 1024])
I have tried reinstalled diff_gaussian_rasterization and it doesn't work.

Could you tell me some potential possible reasons which cause this problem and it's corresponding solutions?
I will be grateful for your timely response !

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

1 participant