naeural-core 7.7.239__py3-none-any.whl → 7.7.240__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -136,6 +136,28 @@ class _GPUMixin(object):
136
136
 
137
137
  return processes_by_uuid
138
138
 
139
+ def _get_uuid_by_index(self, timeout=1.5):
140
+ import subprocess, shutil
141
+ smi = shutil.which("nvidia-smi")
142
+ if not smi:
143
+ return {}
144
+
145
+ out = subprocess.run(
146
+ [smi, "--query-gpu=index,uuid", "--format=csv,noheader,nounits"],
147
+ capture_output=True, text=True, timeout=timeout
148
+ )
149
+ if out.returncode != 0:
150
+ return {}
151
+
152
+ d = {}
153
+ for line in out.stdout.splitlines():
154
+ line = line.strip()
155
+ if not line:
156
+ continue
157
+ idx_s, uuid = [p.strip() for p in line.split(",", 1)]
158
+ d[int(idx_s)] = uuid
159
+ return d
160
+
139
161
  def gpu_info(self, show=False, mb=False, current_pid=False):
140
162
  """
141
163
  Collects GPU info. Must have torch installed & non-mandatory nvidia-smi
@@ -215,20 +237,12 @@ class _GPUMixin(object):
215
237
  fan_speed, fan_speed_unit = -1, "N/A"
216
238
  if pynvml_avail:
217
239
  # --- get an NVML handle that matches torch's CUDA device ordering when possible ---
218
- handle = None
219
- try:
220
- # This helps when CUDA_VISIBLE_DEVICES remaps indices:
221
- # torch device 0 may not be NVML index 0.
222
- pci_bus_id = getattr(device_props, "pci_bus_id", None)
223
- if pci_bus_id:
224
- if hasattr(pynvml, "nvmlDeviceGetHandleByPciBusId_v2"):
225
- handle = pynvml.nvmlDeviceGetHandleByPciBusId_v2(pci_bus_id)
226
- elif hasattr(pynvml, "nvmlDeviceGetHandleByPciBusId"):
227
- handle = pynvml.nvmlDeviceGetHandleByPciBusId(pci_bus_id)
228
- except Exception:
229
- handle = None
230
-
231
- if handle is None:
240
+ uuid_by_index = self._get_uuid_by_index()
241
+ # inside your for device_id in range(n_gpus):
242
+ uuid = uuid_by_index.get(device_id)
243
+ if uuid:
244
+ handle = pynvml.nvmlDeviceGetHandleByUUID(uuid)
245
+ else:
232
246
  handle = pynvml.nvmlDeviceGetHandleByIndex(device_id)
233
247
 
234
248
  # --- memory (NVML returns bytes) ---
naeural_core/main/ver.py CHANGED
@@ -1,4 +1,4 @@
1
- __VER__ = '7.7.239'
1
+ __VER__ = '7.7.240'
2
2
 
3
3
 
4
4
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: naeural_core
3
- Version: 7.7.239
3
+ Version: 7.7.240
4
4
  Summary: Ratio1 Core is the backbone of the Ratio1 Edge Protocol.
5
5
  Project-URL: Homepage, https://github.com/Ratio1/naeural_core
6
6
  Project-URL: Bug Tracker, https://github.com/Ratio1/naeural_core/issues
@@ -137,7 +137,7 @@ naeural_core/core_logging/logger_mixins/confusion_matrix_mixin.py,sha256=fLJOeyp
137
137
  naeural_core/core_logging/logger_mixins/dataframe_mixin.py,sha256=hkOtoTzoBDacpagdFYp2kawsw7rzbgLw2-_pzXLBU6Q,11491
138
138
  naeural_core/core_logging/logger_mixins/deploy_models_in_production_mixin.py,sha256=J2j1tnt0Cd2qD31rL8Sov0sz9_T5-h6Ukd-4sl1ITcQ,5986
139
139
  naeural_core/core_logging/logger_mixins/fit_debug_tfkeras_mixin.py,sha256=6efE5W59a3VWWR1UbPd9iNfQl0nuse7SW3IV0RFpHOc,9344
140
- naeural_core/core_logging/logger_mixins/gpu_mixin.py,sha256=sgtEfuROphSL03Id8n4Wd8SbxGoSuBMVx_v-N_cKvXc,14023
140
+ naeural_core/core_logging/logger_mixins/gpu_mixin.py,sha256=1gh83RB8ziZJG-UdF1BnOPJWWFAq4xbbhGuQvUPUn1E,14193
141
141
  naeural_core/core_logging/logger_mixins/grid_search_mixin.py,sha256=lo3bTyEmcsk03ttTLs0lC_N0beAC1eTiGI9kZX2ib-A,5961
142
142
  naeural_core/core_logging/logger_mixins/histogram_mixin.py,sha256=ro5q99VXdcLSBi6XMZK4fJIXNX8n4wBzay-0SXuj7qc,6413
143
143
  naeural_core/core_logging/logger_mixins/keras_callbacks_mixin.py,sha256=ELlTb8TycdFnuO2dMDAherlzRd1rfHWogIDq-svnZ7w,3940
@@ -345,7 +345,7 @@ naeural_core/main/geoloc.py,sha256=TEqyuNzpVqZSBCo0OOrpHYncIsHSClvRt28hgvxJ35o,2
345
345
  naeural_core/main/main_loop_data_handler.py,sha256=hABB65OUBhtur3rd2mYsEhdAc54jVILzybrvxml5h0s,13815
346
346
  naeural_core/main/net_mon.py,sha256=qlyo1fqTeQy_M9VfJOxon_PBbQat0QO9Zbu_93FMbLc,88144
347
347
  naeural_core/main/orchestrator.py,sha256=SKnW5jWksBm2-fZcfeT5dddDmFSTSyA-CcODKX664KI,69657
348
- naeural_core/main/ver.py,sha256=NCXuXm5fEgpFjFfI3Rlr_co4S3oap5g9XZOHDtGhUPM,335
348
+ naeural_core/main/ver.py,sha256=PyxIMv29XFE2KQRDl_o3fut65G_P9i8u849nGECYtVQ,335
349
349
  naeural_core/main/orchestrator_mixins/__init__.py,sha256=MNleg48vdlqsyAR8Vamjl4ahG2jwCH5kLbQN5CfU57E,149
350
350
  naeural_core/main/orchestrator_mixins/managers_init.py,sha256=sQVqpr99a5WP9HCloYCyaWDW5J3IypEImlf703bqTF4,6692
351
351
  naeural_core/main/orchestrator_mixins/utils.py,sha256=jMa0uStVNLQmp0VhNMRvfBDjo387ORLlUVLthRNBKqc,1866
@@ -555,7 +555,7 @@ naeural_core/utils/tracing/onnx/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm
555
555
  naeural_core/utils/tracing/onnx/base_trt_scripter.py,sha256=1FelEBo7JGsc8hbJ3sevzxnM-J61nvBHz6L1VLpZrVc,2043
556
556
  naeural_core/utils/tracing/onnx/utils.py,sha256=IKmqUWakrMWn34uJvbRjNLacdszD8jkkQBFPUhgJtOQ,5618
557
557
  naeural_core/utils/web_app/favicon.ico,sha256=zU6-Jxx4ol1A9FJvcQELYV9DiqwqyvjPS89xQybZE74,15406
558
- naeural_core-7.7.239.dist-info/METADATA,sha256=jWc9x_Znx1X-FNdp69ujFdvVHKIH5uiEqsS55f673E0,6522
559
- naeural_core-7.7.239.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
560
- naeural_core-7.7.239.dist-info/licenses/LICENSE,sha256=SPHPWjOdAUUUUI020nI5VNCtFjmTOlJpi1cZxyB3gKo,11339
561
- naeural_core-7.7.239.dist-info/RECORD,,
558
+ naeural_core-7.7.240.dist-info/METADATA,sha256=qjN4dhGCJ6yfpUtaJ5rX-XOF3-zeS9PurV7WHEGK3ws,6522
559
+ naeural_core-7.7.240.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
560
+ naeural_core-7.7.240.dist-info/licenses/LICENSE,sha256=SPHPWjOdAUUUUI020nI5VNCtFjmTOlJpi1cZxyB3gKo,11339
561
+ naeural_core-7.7.240.dist-info/RECORD,,