|
16 | 16 |
|
17 | 17 | package rm |
18 | 18 |
|
19 | | -type wslDevice nvmlDevice |
| 19 | +type wslAllGPUsDevice struct{} |
20 | 20 |
|
21 | | -var _ deviceInfo = (*wslDevice)(nil) |
| 21 | +var _ deviceInfo = (*wslAllGPUsDevice)(nil) |
22 | 22 |
|
23 | | -// GetUUID returns the UUID of the device |
24 | | -func (d wslDevice) GetUUID() (string, error) { |
25 | | - return nvmlDevice(d).GetUUID() |
| 23 | +// GetUUID returns "all" to represent all GPUs accessible via /dev/dxg on WSL. |
| 24 | +func (d wslAllGPUsDevice) GetUUID() (string, error) { |
| 25 | + return "all", nil |
26 | 26 | } |
27 | 27 |
|
28 | | -// GetPaths returns the paths for a tegra device. |
29 | | -func (d wslDevice) GetPaths() ([]string, error) { |
| 28 | +// GetPaths returns the WSL GPU device path. |
| 29 | +func (d wslAllGPUsDevice) GetPaths() ([]string, error) { |
30 | 30 | return []string{"/dev/dxg"}, nil |
31 | 31 | } |
32 | 32 |
|
33 | | -// GetNumaNode returns the NUMA node associated with the GPU device |
34 | | -func (d wslDevice) GetNumaNode() (bool, int, error) { |
35 | | - return nvmlDevice(d).GetNumaNode() |
| 33 | +// GetNumaNode returns no NUMA node association for WSL devices. |
| 34 | +func (d wslAllGPUsDevice) GetNumaNode() (bool, int, error) { |
| 35 | + return false, 0, nil |
36 | 36 | } |
37 | 37 |
|
38 | | -// GetTotalMemory returns the total memory available on the device. |
39 | | -func (d wslDevice) GetTotalMemory() (uint64, error) { |
40 | | - return nvmlDevice(d).GetTotalMemory() |
| 38 | +// GetTotalMemory returns 0 as memory info is not available for WSL devices. |
| 39 | +func (d wslAllGPUsDevice) GetTotalMemory() (uint64, error) { |
| 40 | + return 0, nil |
41 | 41 | } |
42 | 42 |
|
43 | | -// GetComputeCapability returns the CUDA compute capability for the device. |
44 | | -func (d wslDevice) GetComputeCapability() (string, error) { |
45 | | - return nvmlDevice(d).GetComputeCapability() |
| 43 | +// GetComputeCapability returns an empty string as compute capability is not available for WSL devices. |
| 44 | +func (d wslAllGPUsDevice) GetComputeCapability() (string, error) { |
| 45 | + return "", nil |
46 | 46 | } |
0 commit comments