mirror of
				https://github.com/clearml/clearml-agent
				synced 2025-06-26 18:16:15 +00:00 
			
		
		
		
	Fix docker CUDA support
This commit is contained in:
		
							parent
							
								
									3a301b0b6c
								
							
						
					
					
						commit
						24329a21fe
					
				| @ -99,10 +99,12 @@ class Session(_Session): | |||||||
|         if not self.config.get('api.host', None) and self.config.get('api.api_server', None): |         if not self.config.get('api.host', None) and self.config.get('api.api_server', None): | ||||||
|             self.config['api']['host'] = self.config.get('api.api_server') |             self.config['api']['host'] = self.config.get('api.api_server') | ||||||
| 
 | 
 | ||||||
|         # initialize nvidia visibility variable |         # initialize nvidia visibility variables | ||||||
|         os.environ['CUDA_DEVICE_ORDER'] = "PCI_BUS_ID" |         os.environ['CUDA_DEVICE_ORDER'] = "PCI_BUS_ID" | ||||||
|         if os.environ.get('NVIDIA_VISIBLE_DEVICES') and not os.environ.get('CUDA_VISIBLE_DEVICES'): |         if os.environ.get('NVIDIA_VISIBLE_DEVICES') and not os.environ.get('CUDA_VISIBLE_DEVICES'): | ||||||
|             os.environ['CUDA_VISIBLE_DEVICES'] = os.environ.get('NVIDIA_VISIBLE_DEVICES') |             # do not create CUDA_VISIBLE_DEVICES if it doesn't exist, it breaks TF/PyTotch CUDA detection | ||||||
|  |             # os.environ['CUDA_VISIBLE_DEVICES'] = os.environ.get('NVIDIA_VISIBLE_DEVICES') | ||||||
|  |             pass | ||||||
|         elif os.environ.get('CUDA_VISIBLE_DEVICES') and not os.environ.get('NVIDIA_VISIBLE_DEVICES'): |         elif os.environ.get('CUDA_VISIBLE_DEVICES') and not os.environ.get('NVIDIA_VISIBLE_DEVICES'): | ||||||
|             os.environ['NVIDIA_VISIBLE_DEVICES'] = os.environ.get('CUDA_VISIBLE_DEVICES') |             os.environ['NVIDIA_VISIBLE_DEVICES'] = os.environ.get('CUDA_VISIBLE_DEVICES') | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 allegroai
						allegroai