mirror of
https://github.com/fumiama/gozel.git
synced 2026-06-11 03:40:24 +08:00
fix: ci
This commit is contained in:
9
.github/workflows/ci.yml
vendored
9
.github/workflows/ci.yml
vendored
@@ -73,12 +73,7 @@ jobs:
|
|||||||
sudo tee /etc/apt/sources.list.d/intel-gpu.list
|
sudo tee /etc/apt/sources.list.d/intel-gpu.list
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y intel-level-zero-gpu level-zero
|
sudo apt-get install -y intel-level-zero-gpu level-zero
|
||||||
|
sudo ldconfig
|
||||||
# Discover the actual install path of libze_loader.so and expose it
|
|
||||||
# to subsequent steps so the Go runtime can find it at process startup.
|
|
||||||
LIB_PATH=$(dirname "$(find /usr -name 'libze_loader.so*' -print -quit 2>/dev/null)")
|
|
||||||
echo "Found libze_loader at: ${LIB_PATH}"
|
|
||||||
echo "LD_LIBRARY_PATH=${LIB_PATH}${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}" >> "$GITHUB_ENV"
|
|
||||||
|
|
||||||
- name: Install Intel Level Zero (Windows)
|
- name: Install Intel Level Zero (Windows)
|
||||||
if: runner.os == 'Windows'
|
if: runner.os == 'Windows'
|
||||||
@@ -111,7 +106,7 @@ jobs:
|
|||||||
for dir in examples/*/; do
|
for dir in examples/*/; do
|
||||||
if [ -f "${dir}/main.go" ]; then
|
if [ -f "${dir}/main.go" ]; then
|
||||||
echo "==> Running ${dir}..."
|
echo "==> Running ${dir}..."
|
||||||
go run "./${dir}/main.go" || true
|
go run "./${dir}/main.go"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/fumiama/gozel/ze"
|
"github.com/fumiama/gozel/ze"
|
||||||
)
|
)
|
||||||
@@ -17,7 +18,8 @@ func main() {
|
|||||||
devs, _ := gpus[0].DeviceGet()
|
devs, _ := gpus[0].DeviceGet()
|
||||||
for _, d := range devs {
|
for _, d := range devs {
|
||||||
prop, _ := d.DeviceGetProperties()
|
prop, _ := d.DeviceGetProperties()
|
||||||
fmt.Printf(" Device: %s\n", string(prop.Name[:]))
|
name, _, _ := strings.Cut(string(prop.Name[:]), "\x00")
|
||||||
|
fmt.Printf(" Device: %s\n", name)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Found 1 GPU driver(s)
|
// Found 1 GPU driver(s)
|
||||||
|
|||||||
@@ -54,9 +54,9 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println("=============== Device Basic Properties ===============")
|
fmt.Println("=============== Device Basic Properties ===============")
|
||||||
|
name, _, _ := strings.Cut(string(prop.Name[:]), "\x00")
|
||||||
fmt.Println(
|
fmt.Println(
|
||||||
"Running on device: ID =", prop.Deviceid, ", Name =",
|
"Running on device: ID =", prop.Deviceid, ", Name =", name,
|
||||||
strings.TrimSpace(string(prop.Name[:])),
|
|
||||||
"@", strconv.FormatFloat(float64(prop.Coreclockrate)/1024/1024/1024, 'f', 2, 64), "GHz.",
|
"@", strconv.FormatFloat(float64(prop.Coreclockrate)/1024/1024/1024, 'f', 2, 64), "GHz.",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
zeLibraryName = "libze_loader.so"
|
zeLibraryName = "libze_loader.so.1"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|||||||
Reference in New Issue
Block a user