Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with python torch dependency #355

Open
themw123 opened this issue Jun 30, 2024 · 1 comment
Open

Problems with python torch dependency #355

themw123 opened this issue Jun 30, 2024 · 1 comment

Comments

@themw123
Copy link

themw123 commented Jun 30, 2024

When I execute main.exe which I have built with github actions and cx_Freeze i am getting the following error:

Could not locate cudnn_ops_infer64_8.dll. Please make sure it is in your library path!

When i look at build/lib/torch/lib, i see that some cuda and cuddn dll's are missing. When I build it locally with cx_Freeze, I see that the required dll's are there. I think it's because it doesn't recognize the cuda installation correctly and therefore doesn't copy the dll's into the build

here is my action.yml:

 windows-backend-build:
    runs-on: windows-2019
    steps:
      - name: Install CUDA
        uses: Jimver/[email protected]
        id: cuda-toolkit
        with:
          cuda: "12.4.0"

      - name: Set environment variables
        run: |
          setx CUDA_PATH "%CUDA_PATH%"
          setx CUDA_PATH_V12_4 "%CUDA_PATH%"

        env:
          CUDA_PATH: ${{ env.CUDA_PATH }}

      - name: Display CUDA Version
        run: |
          echo "Installed cuda version is: ${{steps.cuda-toolkit.outputs.cuda}}"
          echo "Cuda install location: ${{steps.cuda-toolkit.outputs.CUDA_PATH}}"

      - name: Checkout repository
        uses: actions/checkout@v2
        with:
          submodules: true
          fetch-depth: 0

      - name: Set up Python
        uses: actions/setup-python@v2
        with:
          python-version: "3.11.4"

      - name: Install dependencies
        run: |
          cd backend
          python -m pip install --upgrade pip
          pip install -r requirements.txt
          pip install transformers==4.40.1
        shell: bash

      - name: Build application
        run: |
          cd backend
          python setup.py build
        shell: cmd

      - name: Archive build output
        uses: actions/upload-artifact@v2
        with:
          name: build-output-windows-backend
          path: backend/build/

these are some of my requirements of requirements.txt:

torch==2.2.1 --index-url https://download.pytorch.org/whl/cu121
torchvision --index-url https://download.pytorch.org/whl/cu121
torchaudio==2.2.1
faster-whisper==1.0.2
@themw123
Copy link
Author

themw123 commented Jul 3, 2024

update: tried a lot of more things like setting CUDA_PATH and CUDA_PATH_V12_4 as windows environment variables and pathes in github action windows-2019 image. I checked it in my cx_Freeze setup.py script and have made sure that the windows environment variables can be recognized. Nothing helpes.

cx_Freeze still wants not to move the cuda and cudnn ddl's in build/lib/torch/lib. For now as a workarround i uploaded the dll's to google drive and my python programm is downloading and moving it to the directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant