mirror of
				https://github.com/blakeblackshear/frigate.git
				synced 2025-10-27 10:52:11 +01:00 
			
		
		
		
	docker/rocm: compile onnx files into mxr files at startup
This commit is contained in:
		
							parent
							
								
									b151bcca09
								
							
						
					
					
						commit
						8a14703d26
					
				@ -60,6 +60,7 @@ RUN apt-get -y install libnuma1
 | 
			
		||||
 | 
			
		||||
WORKDIR /opt/frigate/
 | 
			
		||||
COPY --from=rootfs / /
 | 
			
		||||
COPY docker/rocm/rootfs/ /
 | 
			
		||||
 | 
			
		||||
#######################################################################
 | 
			
		||||
FROM deps-prelim AS rocm-prelim-hsa-override0
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										13
									
								
								docker/rocm/rootfs/etc/s6-overlay/s6-rc.d/compile-rocm-models/run
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										13
									
								
								docker/rocm/rootfs/etc/s6-overlay/s6-rc.d/compile-rocm-models/run
									
									
									
									
									
										Executable file
									
								
							@ -0,0 +1,13 @@
 | 
			
		||||
#!/command/with-contenv bash
 | 
			
		||||
# shellcheck shell=bash
 | 
			
		||||
# Compile YoloV8 ONNX files into ROCm MIGraphX files
 | 
			
		||||
 | 
			
		||||
for onnx in /config/model_cache/yolov8/*.onnx
 | 
			
		||||
do
 | 
			
		||||
  mxr="${onnx%.onnx}.mxr"
 | 
			
		||||
  if ! test -f $mxr; then
 | 
			
		||||
    echo "processing $onnx into $mxr"
 | 
			
		||||
    /opt/rocm/bin/migraphx-driver compile $onnx --optimize --gpu --enable-offload-copy --binary -o $mxr
 | 
			
		||||
  fi
 | 
			
		||||
done
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1 @@
 | 
			
		||||
0
 | 
			
		||||
@ -0,0 +1 @@
 | 
			
		||||
oneshot
 | 
			
		||||
@ -0,0 +1 @@
 | 
			
		||||
/etc/s6-overlay/s6-rc.d/compile-rocm-models/run
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user