@@ -531,10 +531,13 @@ def prepare_environment():
531531 print (f'ROCm agent enumerator failed: { e } ' )
532532
533533 if len (amd_gpus ) == 0 :
534- if args .use_rocm or args .use_zluda :
535- print ('No ROCm agent was found. Please make sure that graphics driver is installed and up to date.' )
536- backend = "cpu"
537- args .skip_torch_cuda_test = True
534+ if args .use_zluda :
535+ print ('WARNING: No ROCm agent was found. Please make sure that graphics driver is installed and up to date.' )
536+ backend = "zluda"
537+ else :
538+ print ('FATAL: No ROCm agent was found. Please make sure that graphics driver is installed and up to date.' )
539+ backend = "cpu"
540+ args .skip_torch_cuda_test = True
538541 else :
539542 print (f'ROCm: agents={ [gpu .name for gpu in amd_gpus ]} ' )
540543 if args .device_id is None :
@@ -556,9 +559,8 @@ def prepare_environment():
556559 backend = "rocm"
557560
558561 if backend in ("rocm" , "zluda" ):
559- assert device is not None
560-
561562 if sys .platform == "win32" and backend == "rocm" :
563+ assert device is not None
562564 if device .therock is None :
563565 backend = "zluda"
564566 else :
@@ -571,10 +573,13 @@ def prepare_environment():
571573 print (msg )
572574
573575 if backend == "rocm" :
574- if isinstance (rocm .environment , rocm .PythonPackageEnvironment ):
575- torch_command = os .environ .get ('TORCH_COMMAND' , f'pip install torch torchvision --index-url https://rocm.nightlies.amd.com/v2-staging/{ device .therock } ' )
576+ if sys .platform == "win32" :
577+ if isinstance (rocm .environment , rocm .PythonPackageEnvironment ):
578+ torch_command = os .environ .get ('TORCH_COMMAND' , f'pip install torch torchvision --index-url https://rocm.nightlies.amd.com/v2-staging/{ device .therock } ' )
579+ else :
580+ torch_command = os .environ .get ('TORCH_COMMAND' , 'pip install --no-cache-dir https://repo.radeon.com/rocm/windows/rocm-rel-6.4.4/torch-2.8.0a0%2Bgitfc14c65-cp312-cp312-win_amd64.whl https://repo.radeon.com/rocm/windows/rocm-rel-6.4.4/torchvision-0.24.0a0%2Bc85f008-cp312-cp312-win_amd64.whl' )
576581 else :
577- torch_command = os . environ . get ( 'TORCH_COMMAND' , 'pip install --no-cache-dir https://repo.radeon.com/rocm/windows/rocm-rel-6.4.4/torch-2.8.0a0%2Bgitfc14c65-cp312-cp312-win_amd64.whl https://repo.radeon.com/rocm/windows/rocm-rel-6.4.4/torchvision-0.24.0a0%2Bc85f008-cp312-cp312-win_amd64.whl' )
582+ raise NotImplementedError ( "TODO" )
578583 else :
579584 if args .device_id is not None :
580585 if os .environ .get ('HIP_VISIBLE_DEVICES' , None ) is not None :
@@ -590,7 +595,8 @@ def prepare_environment():
590595 if zluda_installer .is_reinstall_needed ():
591596 zluda_installer .uninstall ()
592597 zluda_installer .install ()
593- zluda_installer .set_default_agent (device )
598+ if device is not None :
599+ zluda_installer .set_default_agent (device )
594600 except Exception as e :
595601 error = e
596602 print (f'Failed to install ZLUDA: { e } ' )
0 commit comments