class_docstr: A class holding OpenGL machinery used by MeshRasterizerOpenGL.
class_docstr_tok: ["A","class","holding","OpenGL","machinery","used","by","MeshRasterizerOpenGL","."]
docstr: Release CUDA and OpenGL resources.
docstr_tok: ["Release","CUDA","and","OpenGL","resources","."]
code: def release(self) -> None:
      """
      Release CUDA and OpenGL resources.
      """
      # Finish all current operations.
      torch.cuda.synchronize()
      self.cuda_context.synchronize()
  
      # Free pycuda resources.
      self.cuda_context.push()
      self.cuda_buffer.unregister()
      self.cuda_context.pop()
  
      # Free GL resources.
      gl.glBindFramebuffer(gl.GL_FRAMEBUFFER, self.fbo)
      gl.glDeleteFramebuffers(1, [self.fbo])
      gl.glBindFramebuffer(gl.GL_FRAMEBUFFER, 0)
      del self.fbo
  
      gl.glBindBufferBase(
          gl.GL_SHADER_STORAGE_BUFFER, 0, self.mesh_buffer_object
      )
      gl.glDeleteBuffers(1, [self.mesh_buffer_object])
      gl.glBindBufferBase(gl.GL_SHADER_STORAGE_BUFFER, 0, 0)
      del self.mesh_buffer_object
  
      gl.glDeleteProgram(self.program)
      self.egl_context.release()
  
imports: import warnings
  from typing import Optional, Tuple, Union
  import numpy
  import OpenGL.GL
  import pycuda.gl
  import torch
  import torch.nn
  from pytorch3d.structures.meshes import Meshes
  from ..cameras import FoVOrthographicCameras, FoVPerspectiveCameras
  from ..mesh.rasterizer import Fragments, RasterizationSettings
  from ..utils import parse_image_size
  from .opengl_utils import _torch_to_opengl, global_device_context_store
label_desc: Use image node_id 4 for calling the _OpenGLMachinery obj's underlying member method code with example usage: obj.release() without return types