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

adds flag to disable gpu #2067

Merged
merged 1 commit into from
Oct 3, 2023
Merged

adds flag to disable gpu #2067

merged 1 commit into from
Oct 3, 2023

Conversation

ashraffouda
Copy link
Collaborator

No description provided.

@@ -41,6 +42,11 @@ func (k Params) IsDebug() bool {
return k.Exists(Debug)
}

// GPUDisabled checks if gpu is diabled
Copy link
Collaborator

@xmonader xmonader Oct 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it says GPUDisabled while the function is called GPUEnabled?

@@ -71,6 +73,9 @@ func setupGPURmb(router rmb.Router, store provision.Storage) {
return gpus, nil
}
gpus.WithHandler("list", func(ctx context.Context, payload []byte) (interface{}, error) {
if kernel.GetParams().IsGPUDisabled() {
return nil, fmt.Errorf("gpu is disabled on this node")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why return an error? this can just return an empty list. (no gpus)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The client doesn't need to know if the farmer disable the GPU feature, all what he needs to know is that the node has no GPUs for renting

Signed-off-by: Ashraf Fouda <[email protected]>
@muhamadazmy muhamadazmy merged commit 9e65c15 into main Oct 3, 2023
2 checks passed
@muhamadazmy muhamadazmy deleted the main-disbale-gpu branch October 3, 2023 11:27
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

Successfully merging this pull request may close these issues.

3 participants