-
Notifications
You must be signed in to change notification settings - Fork 16
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
adds flag to disable gpu #2067
Conversation
@@ -41,6 +42,11 @@ func (k Params) IsDebug() bool { | |||
return k.Exists(Debug) | |||
} | |||
|
|||
// GPUDisabled checks if gpu is diabled |
There was a problem hiding this comment.
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?
a1da26f
to
0ebacdb
Compare
cmds/modules/provisiond/api.go
Outdated
@@ -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") |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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]>
0ebacdb
to
4ded16c
Compare
No description provided.