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

Show OpenCL VRAM usage in statistics #83

Closed
Theverat opened this issue Feb 22, 2018 · 0 comments
Closed

Show OpenCL VRAM usage in statistics #83

Theverat opened this issue Feb 22, 2018 · 0 comments
Labels
enhancement Additional feature

Comments

@Theverat
Copy link
Member

Theverat commented Feb 22, 2018

Old LuxBlend code:

# Memory usage (only available for OpenCL engines)
if str.endswith(engine, 'OCL') and rendering_controls.stats_memory:
    device_stats = stats.Get("stats.renderengine.devices")

    max_memory = float('inf')
    used_memory = 0

    for i in range(device_stats.GetSize()):
        device_name = device_stats.GetString(i)

        # Max memory available is limited by the device with least amount of memory
        device_max_memory = stats.Get("stats.renderengine.devices." + device_name + ".memory.total").GetFloat()
        device_max_memory = int(device_max_memory / (1024 * 1024))
        if device_max_memory < max_memory:
            max_memory = device_max_memory

        device_used_memory = stats.Get("stats.renderengine.devices." + device_name + ".memory.used").GetFloat()
        device_used_memory = int(device_used_memory / (1024 * 1024))
        if device_used_memory > used_memory:
            used_memory = device_used_memory

    if used_memory > self.mem_peak:
        self.mem_peak = used_memory

    stats_list.append('Memory: %d MB/%d MB' % (used_memory, max_memory))

When implementing this, check if stats.renderengine.devices really only returns the enabled devices (important for max. available memory calculation).

@Theverat Theverat added the enhancement Additional feature label Feb 22, 2018
@Theverat Theverat added this to To Do in BlendLuxCore v2.0 via automation Feb 22, 2018
@Theverat Theverat removed this from To Do in BlendLuxCore v2.0 May 5, 2018
@Theverat Theverat closed this as completed Apr 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Additional feature
Projects
None yet
Development

No branches or pull requests

1 participant