File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -261,7 +261,8 @@ def get_rocm_gpu_arch():
261261 rocm_info = Path ("rocminfo" )
262262 rocm_gpu_arch_cmd = str (rocm_info ) + " | grep -o -m 1 'gfx.*'"
263263 try :
264- result = subprocess .check_output (rocm_gpu_arch_cmd , shell = True )
264+ safe_cmd = shlex .split (rocm_gpu_arch_cmd )
265+ result = subprocess .check_output (safe_cmd )
265266 rocm_gpu_arch = result .decode ('utf-8' ).strip ()
266267 except subprocess .CalledProcessError :
267268 rocm_gpu_arch = ""
@@ -279,7 +280,8 @@ def get_rocm_wavefront_size():
279280 rocm_wavefront_size_cmd = str (
280281 rocm_info ) + " | grep -Eo -m1 'Wavefront Size:[[:space:]]+[0-9]+' | grep -Eo '[0-9]+'"
281282 try :
282- result = subprocess .check_output (rocm_wavefront_size_cmd , shell = True )
283+ safe_cmd = shlex .split (rocm_wavefront_size_cmd )
284+ result = subprocess .check_output (rocm_wavefront_size_cmd )
283285 rocm_wavefront_size = result .decode ('utf-8' ).strip ()
284286 except subprocess .CalledProcessError :
285287 rocm_wavefront_size = "32"
You can’t perform that action at this time.
0 commit comments