2018-09-01 00:08:36 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2020-05-26 13:44:26 +00:00
|
|
|
"context"
|
|
|
|
|
2018-09-01 00:08:36 +00:00
|
|
|
log "github.com/hashicorp/go-hclog"
|
|
|
|
|
2018-10-05 20:50:18 +00:00
|
|
|
"github.com/hashicorp/nomad/devices/gpu/nvidia"
|
2018-09-01 00:08:36 +00:00
|
|
|
"github.com/hashicorp/nomad/plugins"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
// Serve the plugin
|
2020-05-26 13:44:26 +00:00
|
|
|
plugins.ServeCtx(factory)
|
2018-09-01 00:08:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// factory returns a new instance of the Nvidia GPU plugin
|
2020-05-26 13:44:26 +00:00
|
|
|
func factory(ctx context.Context, log log.Logger) interface{} {
|
|
|
|
return nvidia.NewNvidiaDevice(ctx, log)
|
2018-09-01 00:08:36 +00:00
|
|
|
}
|