File tree Expand file tree Collapse file tree 1 file changed +24
-2
lines changed Expand file tree Collapse file tree 1 file changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -322,9 +322,31 @@ def dockerfile_for_linux(output_file):
322322 ep_flags += (
323323 " --skip_tests --cmake_extra_defines 'onnxruntime_BUILD_UNIT_TESTS=OFF'"
324324 )
325- cuda_archs = "87;101"
325+ if os .getenv ("CUDA_ARCH_LIST" ) is not None :
326+ print (f"[INFO] Defined CUDA_ARCH_LIST: { os .getenv ('CUDA_ARCH_LIST' )} " )
327+ cuda_archs = (
328+ os .getenv ("CUDA_ARCH_LIST" )
329+ .replace ("PTX" , "" )
330+ .replace (" " , "-real;" )
331+ .replace ("." , "" )
332+ )
333+ cuda_archs = re .sub (r"-real;$" , "" , cuda_archs )
334+ print (f"[INFO] Set ONNX Runtime to use CUDA architectures to: { cuda_archs } " )
335+ else :
336+ cuda_archs = "87"
326337 else :
327- cuda_archs = "75;80;86;89;90;100;120"
338+ if os .getenv ("CUDA_ARCH_LIST" ) is not None :
339+ print (f"[INFO] Defined CUDA_ARCH_LIST: { os .getenv ('CUDA_ARCH_LIST' )} " )
340+ cuda_archs = (
341+ os .getenv ("CUDA_ARCH_LIST" )
342+ .replace ("PTX" , "" )
343+ .replace (" " , "-real;" )
344+ .replace ("." , "" )
345+ )
346+ cuda_archs = re .sub (r"-real;$" , "" , cuda_archs )
347+ print (f"[INFO] Set ONNX Runtime to use CUDA architectures to: { cuda_archs } " )
348+ else :
349+ cuda_archs = "75;80;86;90;100;120"
328350
329351 df += """
330352WORKDIR /workspace/onnxruntime
You can’t perform that action at this time.
0 commit comments