Skip to content

Commit

Permalink
use arch specific pkg-config for cuda, if found
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Nov 18, 2024
1 parent 03f6306 commit 423e9d3
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2607,9 +2607,16 @@ def bundle_tests() -> None:
tace(spng_decoder_ENABLED, "xpra.codecs.spng.decoder", "spng")
tace(spng_encoder_ENABLED, "xpra.codecs.spng.encoder", "spng")
toggle_packages(nvjpeg_encoder_ENABLED or nvjpeg_decoder_ENABLED, "xpra.codecs.nvidia.nvjpeg")
tace(nvjpeg_encoder_ENABLED or nvjpeg_decoder_ENABLED, "xpra.codecs.nvidia.nvjpeg.common", "cuda,nvjpeg")
tace(nvjpeg_encoder_ENABLED, "xpra.codecs.nvidia.nvjpeg.encoder", "cuda,nvjpeg")
tace(nvjpeg_decoder_ENABLED, "xpra.codecs.nvidia.nvjpeg.decoder","cuda,nvjpeg")
cuda = "cuda"
if nvjpeg_decoder_ENABLED or nvjpeg_decoder_ENABLED:
# try to find a platform specific pkg-config file for cuda:
cuda_arch = f"cuda-{ARCH}"
for pcdir in os.environ.get("PKG_CONFIG_PATH", "/usr/lib/pkgconfig:/usr/lib64/pkgconfig").split(":"):
if os.path.exists(f"{pcdir}/cuda-{ARCH}.pc"):
cuda = cuda_arch
tace(nvjpeg_encoder_ENABLED or nvjpeg_decoder_ENABLED, "xpra.codecs.nvidia.nvjpeg.common", f"{cuda},nvjpeg")
tace(nvjpeg_encoder_ENABLED, "xpra.codecs.nvidia.nvjpeg.encoder", f"{cuda},nvjpeg")
tace(nvjpeg_decoder_ENABLED, "xpra.codecs.nvidia.nvjpeg.decoder",f"{cuda},nvjpeg")
toggle_packages(jpeg_decoder_ENABLED or jpeg_encoder_ENABLED, "xpra.codecs.jpeg")
tace(jpeg_encoder_ENABLED, "xpra.codecs.jpeg.encoder", "libturbojpeg")
tace(jpeg_decoder_ENABLED, "xpra.codecs.jpeg.decoder", "libturbojpeg")
Expand Down

0 comments on commit 423e9d3

Please sign in to comment.