|
13 | 13 | print("Error: version of setuptools is too old (<42)!")
|
14 | 14 | sys.exit(1)
|
15 | 15 |
|
| 16 | +def get_cupy() -> str: |
| 17 | + CUDA_VERSION = os.environ.get("CUDA_VERSION", None) |
| 18 | + if CUDA_VERSION>="11.2": # after 11.2 use |
| 19 | + cupy_pack = f"cupy-cuda{CUDA_VERSION[:2]}x" |
| 20 | + else: |
| 21 | + cupy_pack = f"cupy-cuda{CUDA_VERSION[:4].replace('.','')}" |
| 22 | + return cupy_pack |
16 | 23 |
|
17 | 24 | if __name__ == "__main__":
|
18 | 25 | import skbuild
|
19 | 26 |
|
| 27 | + cupy = get_cupy() |
20 | 28 | PytorchNvCodec = "PytorchNvCodec @ git+https://github.com/NVIDIA/VideoProcessingFramework.git#subdirectory=src/PytorchNvCodec/"
|
21 | 29 | skbuild.setup(
|
22 | 30 | name="PyNvCodec",
|
|
28 | 36 | extras_require={
|
29 | 37 | # , "PyOpenGL-accelerate" # does not compile on 3.10
|
30 | 38 | "dev": ["pycuda", "pyopengl", "torch", "torchvision", "opencv-python", "onnx", "tensorrt", f"PytorchNvCodec @ file://{os.getcwd()}/src/PytorchNvCodec/"],
|
31 |
| - "samples": ["pycuda", "pyopengl", "torch", "torchvision", "opencv-python", "onnx", "tensorrt", "tqdm", PytorchNvCodec], |
| 39 | + "samples": ["pycuda", "pyopengl", "torch", "torchvision", "opencv-python", "onnx", "tensorrt", "tqdm", cupy, PytorchNvCodec], |
32 | 40 | "tests": ["pycuda", "pyopengl", "torch", "torchvision", "opencv-python", PytorchNvCodec],
|
33 | 41 | "torch": ["torch", "torchvision", "opencv-python", PytorchNvCodec],
|
34 | 42 | "tensorrt": ["torch", "torchvision", PytorchNvCodec],
|
|
0 commit comments