Skip to content

Commit c59bcaa

Browse files
committed
Attempt to fix cuda build and prefix query via pkg-config
Signed-off-by: Dmitry Rogozhkin <[email protected]>
1 parent 9689f43 commit c59bcaa

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

.github/workflows/linux_cuda_wheel.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ jobs:
102102
${CONDA_RUN} nvidia-smi
103103
${CONDA_RUN} conda list
104104
echo LD_LIBRARY_PATH=$CONDA_PREFIX/lib:/usr/local/cuda/lib64/:${LD_LIBRARY_PATH} >> $GITHUB_ENV
105+
echo PATH=/usr/local/cuda/bin:${PATH} >> $GITHUB_ENV
105106
- name: Assert ffmpeg exists
106107
run: |
107108
${CONDA_RUN} ffmpeg -buildconf

test/test_cppapi.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,13 @@ def test_cppapi_with_prefix(tmp_path):
5959
# of its libavcodec.pc file. Potentially, on the custom ffmpeg install with custom layout
6060
# our calculation can be wrong and test might fail.
6161
result = subprocess.run(
62-
["pkg-config", "--path", "libavcodec"], capture_output=True, text=True
62+
["pkg-config", "--variable=prefix", "libavcodec"], capture_output=True, text=True
6363
)
6464
assert result.returncode == 0
6565

6666
ver = f"{torchcodec.ffmpeg_major_version}"
6767
my_env = os.environ.copy()
68-
my_env[f"TORCHCODEC_FFMPEG{ver}_INSTALL_PREFIX"] = Path(
69-
f"{result.stdout}"
70-
).parent.parent.parent
68+
my_env[f"TORCHCODEC_FFMPEG{ver}_INSTALL_PREFIX"] = Path(f"{result.stdout.strip()}")
7169

7270
result = subprocess.run(cmake_args, cwd=tmp_path, env=my_env)
7371
assert result.returncode == 0

0 commit comments

Comments
 (0)