-
Notifications
You must be signed in to change notification settings - Fork 178
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
Implement -nvidia=all #1205
Comments
(I kind of think that doing just EDIT: It does not. It tries to transcode on the card, then comes back with an "invalid ordinal" error. |
Thinking about this more, I think I'm more in favor of |
@ya7ya came up with this which works quite well, perhaps we could do something like this?:
|
That being said, device enumeration seems to be implemented directly using the CUDA API in other programs like ethminer and ffmpeg. I think I've also noticed that the default behavior for other programs that use Nvidia GPUs like ethminer and t-rex is to enumerate all devices by default if no device IDs are specified. Instead of requiring
|
Directly using cuda api like
Good news: Nvidia Management Library (NVML), the underlying lib for A Cgo wrapper for NVML can be used directly to iterate over available devices. The wrapper links with
👍 |
There also seems to be official NVML Go bindings from Nvidia, but that is Linux only and Windows support has not been added yet (sounds like it was supported in an older version of the bindings based on the comments). |
I think that Windows machines with more than one GPU will be rare and certainly Windows will not be used on mining farms - so I think we can support |
Summarizing the above discussion around NVML. There are 3 go wrappers - For now implementing this with (2), sticking to linux support only. If we see demand for this on Windows (or if I have spare time) we can probably add it ourselves and send a PR on the upstream issue. |
@jailuthra What about this? Looks like it can list GPUs in a cross-platform kind of way. https://github.com/jaypipes/ghw#gpu Edit: Tested it on Windows (mingw64) and this example script seemed to work: package main
import (
"fmt"
"github.com/jaypipes/ghw"
)
func main() {
gpu, err := ghw.GPU()
if err != nil {
fmt.Printf("Error getting GPU info: %v", err)
}
fmt.Printf("%v\n", gpu)
for _, card := range gpu.GraphicsCards {
fmt.Printf(" %v\n", card)
}
} Produced this output:
Testing on the same machine booted into Linux now... |
Neat find! I had already implemented a fix using If an easy fix for that isn't possible I'll switch to edit: ahh but we could use the number of chipsets returned on windows ^ and create our own array of ids like we're already doing with go-nvml. |
Right on, that'd probably work. My Ubuntu installation on that machine seems to be broken, but here's the same script on a 8-GPU rig in BER:
Windows says |
@iameli Perfect, I've switched to ghw and it's working great on my linux machine too!
Yeah somehow I did exactly that without having that info :P Line 424 in 7fb3f3c
|
cc @yondonfu
Golang's Something like |
"Please run this transcoder on all nvidia GPUs available" I think is going to be a pretty common case — it'd be nice if Kubernetes manifests and whatnot could contain a line like
-nvidia=all
so that I can have the same command work across a variety of hardware.The text was updated successfully, but these errors were encountered: