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

update getGpuUsage() to only refresh metrics for one gpu #22

Open
smedegaard opened this issue Nov 14, 2024 · 0 comments
Open

update getGpuUsage() to only refresh metrics for one gpu #22

smedegaard opened this issue Nov 14, 2024 · 0 comments

Comments

@smedegaard
Copy link
Collaborator

WorkerThread.getGpuUsage() updates the metrics of all available GPUs. That's redundant since one worker thread is assigned to one GPU.

Pass the array list holding the relevnat GPU id.

Blocked by #21

    public String getGpuUsage() {
        StringBuffer gpuUsage = new StringBuffer();
        if (gpuId >= 0) {
            try {
                configManager.systemInfo.updateAcceleratorMetrics();  // <--- pass [gpuid] here
                Accelerator accelerator =
                        this.configManager.systemInfo.getAccelerators().get(gpuId);
                return accelerator.utilizationToString();
            } catch (Exception e) {
                gpuUsage.append("failed to obtained gpu usage");
                logger.error("Exception Raised : " + e.toString());
            }
        } else {
            gpuUsage.append("N/A");
        }

        return gpuUsage.toString();
    }
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