GPUtil: Golang Implementation based on https://github.com/anderskm/gputil (Python Version)
This project is a Golang implementation of the functionality provided by https://github.com/anderskm/gputil in Python. It offers some useful features that can help you accomplish specific tasks.
- Feature 1: List GPU informations
- Feature 2: List processes having compute context on the device
To install and run this project, follow these steps:
$ go get -u github.com/lichunqiang/gputil
Here is an example code snippet demonstrating the usage of this project:
package main
import (
"context"
"fmt"
"github.com/lichunqiang/gputil"
)
func main() {
ctx := context.Background()
gpus, err := gputil.GetGPUs(ctx)
if err != nil {
panic(err)
}
for _, item := range gpus {
fmt.Println(item.String())
}
}
If you would like to contribute to this project, please follow these steps:
- Fork the project to your GitHub account.
- Clone the project to your local machine:
git clone https://github.com/lichunqiang/gputil.git
- Create a new branch:
git checkout -b feature/your-feature
- Make your modifications and improvements.
- Commit your changes:
git commit -m "Add your commit message"
- Push your changes to the remote repository:
git push origin feature/your-feature
- Create a Pull Request and wait for review and merge.
This project is licensed under the MIT License.