mirror of
https://github.com/facefusion/facefusion.git
synced 2026-08-07 09:38:39 +02:00
* use find_library from cytypes, enable rtc tests again * install libvpx and libopus for unix on CI * bug found when sending audio first * no need for source path guard * add more tests for libraries * add more tests for libraries * fix testing * disable tests to see what happens * disable tests to see what happens * debug ci * debug ci * debug ci * debug ci * debug ci * debug ci * debug ci * debug ci * debug ci * debug ci * debug ci * hope to solve everything via ENV * hope to solve everything via ENV * hope to solve everything via ENV * hope to solve everything via ENV * hope to solve everything via ENV * hope to solve everything via ENV * hope to solve everything via ENV * hope to solve everything via ENV * fix testing * fix testing * fix testing * fix testing * fix testing * fix testing * switch to self hosted libraries * fixes for macos * switch to self hosted libraries * switch to self hosted libraries * switch to self hosted libraries * switch to self hosted libraries * switch to self hosted libraries * switch to self hosted libraries * switch to self hosted libraries * switch to self hosted libraries
25 lines
583 B
Python
25 lines
583 B
Python
import ctypes
|
|
import ctypes.util
|
|
from functools import lru_cache
|
|
from typing import Optional
|
|
|
|
|
|
@lru_cache
|
|
def create_static_library() -> Optional[ctypes.CDLL]:
|
|
library_path = ctypes.util.find_library('rocm-core')
|
|
|
|
if library_path:
|
|
library = ctypes.CDLL(library_path)
|
|
|
|
if library:
|
|
return init_ctypes(library)
|
|
|
|
return None
|
|
|
|
|
|
def init_ctypes(library : ctypes.CDLL) -> ctypes.CDLL:
|
|
library.getROCmVersion.argtypes = [ ctypes.POINTER(ctypes.c_uint), ctypes.POINTER(ctypes.c_uint), ctypes.POINTER(ctypes.c_uint) ]
|
|
library.getROCmVersion.restype = ctypes.c_int
|
|
|
|
return library
|