Skip to content

Commit

Permalink
fix cudnn path
Browse files Browse the repository at this point in the history
Make sure the temporary path to cudnn is added correctly.
  • Loading branch information
BBC-Esq authored Jul 1, 2024
1 parent cef3a7a commit 2bc2a17
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,21 @@
def set_cuda_paths():
venv_base = Path(sys.executable).parent
nvidia_base_path = venv_base / 'Lib' / 'site-packages' / 'nvidia'
cudnn_bin_path = nvidia_base_path / 'cudnn' / 'bin'

# Set CUDA_PATH and CUDA_PATH_V12_2
for env_var in ['CUDA_PATH', 'CUDA_PATH_V12_2']:
current_path = os.environ.get(env_var, '')
os.environ[env_var] = os.pathsep.join(filter(None, [str(nvidia_base_path), current_path]))

# Add nvidia folder and cudnn bin folder to system PATH
current_path = os.environ.get('PATH', '')
new_path = os.pathsep.join(filter(None, [str(cudnn_bin_path), str(nvidia_base_path), current_path]))
os.environ['PATH'] = new_path

set_cuda_paths()


class DocQA_GUI(QWidget):
def __init__(self):
super().__init__()
Expand Down

0 comments on commit 2bc2a17

Please sign in to comment.