Skip to content

Commit 43b96fc

Browse files
author
Piotr Stankiewicz
committed
gpuinfo: Make building without cgo possible on Linux
Signed-off-by: Piotr Stankiewicz <piotr.stankiewicz@docker.com>
1 parent fc9b2a7 commit 43b96fc

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//go:build linux && cgo
2+
13
package gpuinfo
24

35
/*

pkg/gpuinfo/memory_linux_nocgo.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//go:build linux && !cgo
2+
3+
package gpuinfo
4+
5+
import "errors"
6+
7+
// getVRAMSize returns total system GPU memory in bytes
8+
func getVRAMSize(_ string) (uint64, error) {
9+
return 0, errors.New("unimplemented without cgo")
10+
}

0 commit comments

Comments
 (0)