@@ -90,25 +90,20 @@ func (i *propertyExtractor) HasTegraFiles() (bool, string) {
9090 return false , fmt .Sprintf ("%v has no 'tegra' prefix" , tegraFamilyFile )
9191}
9292
93- // UsesOnlyNVGPUModule checks whether the only the nvgpu module is used.
94- //
95- // Deprecated: UsesOnlyNVGPUModule is deprecated, use HasOnlyIntegratedGPUs instead.
96- func (i * propertyExtractor ) UsesOnlyNVGPUModule () (uses bool , reason string ) {
97- return i .HasOnlyIntegratedGPUs ()
98- }
99-
100- // HasOnlyIntegratedGPUs checks whether all GPUs are iGPUs that use NVML.
93+ // HasAnIntegratedGPU checks whether any of the GPUs reported by NVML is an
94+ // integrated GPU.
10195//
10296// As of Orin-based systems iGPUs also support limited NVML queries.
103- // In the absence of a robust API, we rely on heuristics to make this decision.
97+ // In the absence of a robust API, we rely on heuristics based on the device
98+ // name to make this decision.
10499//
105- // The following device names are checked :
100+ // Devices with the following names are considered integrated GPUs :
106101//
107102// GPU 0: Orin (nvgpu) (UUID: 54d0709b-558d-5a59-9c65-0c5fc14a21a4)
108103// GPU 0: NVIDIA Thor (UUID: 54d0709b-558d-5a59-9c65-0c5fc14a21a4)
109104//
110- // This function returns true if ALL devices are detected as iGPUs .
111- func (i * propertyExtractor ) HasOnlyIntegratedGPUs () (uses bool , reason string ) {
105+ // (Where this shows the nvidia-smi -L output on these systems) .
106+ func (i * propertyExtractor ) HasAnIntegratedGPU () (uses bool , reason string ) {
112107 // We ensure that this function never panics
113108 defer func () {
114109 if err := recover (); err != nil {
@@ -144,14 +139,23 @@ func (i *propertyExtractor) HasOnlyIntegratedGPUs() (uses bool, reason string) {
144139 }
145140
146141 for _ , name := range names {
147- if ! isIntegratedGPUName (name ) {
148- return false , fmt .Sprintf ("device %q does not use nvgpu module " , name )
142+ if IsIntegratedGPUName (name ) {
143+ return true , fmt .Sprintf ("device %q is an integrated GPU " , name )
149144 }
150145 }
151- return true , "all devices use nvgpu module "
146+ return false , "no integrated GPUs found "
152147}
153148
154- func isIntegratedGPUName (name string ) bool {
149+ // IsIntegratedGPUName checks whether the specified device name is associated
150+ // with a known integrated GPU.
151+ //
152+ // Devices with the following names are considered integrated GPUs:
153+ //
154+ // GPU 0: Orin (nvgpu) (UUID: 54d0709b-558d-5a59-9c65-0c5fc14a21a4)
155+ // GPU 0: NVIDIA Thor (UUID: 54d0709b-558d-5a59-9c65-0c5fc14a21a4)
156+ //
157+ // (Where this shows the nvidia-smi -L output on these systems).
158+ func IsIntegratedGPUName (name string ) bool {
155159 if strings .Contains (name , "(nvgpu)" ) {
156160 return true
157161 }
0 commit comments