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
Assignees
Labels
enhancement New feature or request

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();
    }
@jakki-amd jakki-amd added this to the Week 47 milestone Nov 18, 2024
@smedegaard smedegaard added the enhancement New feature or request label Nov 20, 2024
@jakki-amd jakki-amd removed this from the Week 47 milestone Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants