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

move to cuda 11.8 with install script #2009

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ install:
- cmd: IF DEFINED CUDNN_INSTALL cuda_10.0.130_win10_network -s nvcc_10.0 cublas_dev_10.0 cublas_10.0 cudart_10.0
- cmd: IF DEFINED CUDNN_INSTALL appveyor DownloadFile http://developer.download.nvidia.com/compute/redist/cudnn/v7.4.2/cudnn-10.0-windows10-x64-v7.4.2.24.zip
- cmd: IF DEFINED CUDNN_INSTALL 7z x cudnn-10.0-windows10-x64-v7.4.2.24.zip -o"%CUDA_PATH%"
- cmd: IF %CUDNN%==false set "CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1"
- cmd: IF %CUDNN%==false set "CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8"
- cmd: IF %CUDA%==true IF NOT EXIST "%CUDA_PATH%" set CUDA_INSTALL=1
- cmd: IF DEFINED CUDA_INSTALL appveyor DownloadFile https://developer.download.nvidia.com/compute/cuda/11.1.0/network_installers/cuda_11.1.0_win10_network.exe
- cmd: IF DEFINED CUDA_INSTALL cuda_11.1.0_win10_network.exe -s nvcc_11.1 cublas_dev_11.1 cublas_11.1 cudart_11.1 documentation_11.1
- cmd: IF DEFINED CUDA_INSTALL appveyor DownloadFile https://developer.download.nvidia.com/compute/cuda/11.8.0/network_installers/cuda_11.8.0_windows_network.exe
- cmd: IF DEFINED CUDA_INSTALL cuda_11.8.0_windows_network.exe -s nvcc_11.8 cublas_dev_11.8 cublas_11.8 cudart_11.8 documentation_11.8
- cmd: IF %CUDA%==true set PATH=%CUDA_PATH%\bin;%PATH%
- cmd: set PATH=C:\Python36;C:\Python36\scripts;%PATH%
- cmd: pip3 install --upgrade meson==0.55.3
Expand Down Expand Up @@ -104,7 +104,7 @@ install:
cache:
- C:\cache
- 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0'
- 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1'
- 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8'
- C:\projects\lc0\subprojects\packagecache
- C:\ndk\android-ndk-r19c\toolchains\llvm\prebuilt\windows-x86_64
before_build:
Expand Down
17 changes: 10 additions & 7 deletions dist/README-cuda.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ Lc0 is a UCI-compliant chess engine designed to play chess via
neural network, specifically those of the LeelaChessZero project
(https://lczero.org).

This binary uses CUDA and cuDNN dynamic link libraries copyrighted
by Nvidia corporation (http://www.nvidia.com), and redistributed as
permitted by the respective license file (see CUDA.txt section 2.2
and CUDNN.txt section "CUDNN DISTRIBUTION" for details). You are
authorized to redistribute these libraries together with this
package as a whole but not individually.

This binary uses CUDA dynamic link libraries copyrighted by Nvidia
corporation (http://www.nvidia.com), that can be redistributed as
permitted by the respective license file (see CUDA.txt section 2.2).
For size reasons you will have to get the required files by running
the included `install.cmd` script. If this fails you can get them by
downloading
<https://developer.download.nvidia.com/compute/cuda/redist/cuda_cudart/windows-x86_64/cuda_cudart-windows-x86_64-11.8.89-archive.zip> and
<https://developer.download.nvidia.com/compute/cuda/redist/libcublas/windows-x86_64/libcublas-windows-x86_64-11.11.3.6-archive.zip>, the required dynamic link libraries are in the respective `bin`
directories. You are authorized to redistribute these libraries
together with this package as a whole but not individually.

License

Expand Down
38 changes: 38 additions & 0 deletions dist/README-cudnn.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Lc0

Lc0 is a UCI-compliant chess engine designed to play chess via
neural network, specifically those of the LeelaChessZero project
(https://lczero.org).

This binary uses CUDA and cuDNN dynamic link libraries copyrighted
by Nvidia corporation (http://www.nvidia.com), and redistributed as
permitted by the respective license file (see CUDA.txt section 2.2
and CUDNN.txt section "CUDNN DISTRIBUTION" for details). You are
authorized to redistribute these libraries together with this
package as a whole but not individually.


License

Leela Chess is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Leela Chess is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Leela Chess. If not, see <http://www.gnu.org/licenses/>.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or
combining it with NVIDIA Corporation's libraries from the NVIDIA CUDA
Toolkit and the NVIDIA CUDA Deep Neural Network library (or a
modified version of those libraries), containing parts covered by the
terms of the respective license agreement, the licensors of this
Program grant you additional permission to convey the resulting work.

41 changes: 41 additions & 0 deletions dist/install-cuda_11_8.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
@echo off
where /q tar
if errorlevel 1 goto error

cd /d %~dp0

cls
echo Installing the CUDA dlls required by the Lc0 cuda backend.

echo 1/4. Downloading cudart.
curl -# --ssl-no-revoke -o tmp_cudart.zip https://developer.download.nvidia.com/compute/cuda/redist/cuda_cudart/windows-x86_64/cuda_cudart-windows-x86_64-11.8.89-archive.zip"
if errorlevel 1 goto error

echo 2/4. Extracting files.
tar -xzOf tmp_cudart.zip cuda_cudart-windows-x86_64-11.8.89-archive/bin/cudart64_110.dll >cudart64_110.dll
if errorlevel 1 goto error

del /q tmp_cudart.zip

echo 3/4. Downloading cublas.
curl -# --ssl-no-revoke -o tmp_cublas.zip https://developer.download.nvidia.com/compute/cuda/redist/libcublas/windows-x86_64/libcublas-windows-x86_64-11.11.3.6-archive.zip"
if errorlevel 1 goto error

echo 4/4. Extracting files.
tar -xzOf tmp_cublas.zip libcublas-windows-x86_64-11.11.3.6-archive/bin/cublas64_11.dll >cublas64_11.dll
if errorlevel 1 goto error

tar -xzOf tmp_cublas.zip libcublas-windows-x86_64-11.11.3.6-archive/bin/cublasLt64_11.dll >cublasLt64_11.dll
if errorlevel 1 goto error

del /q tmp_cublas.zip

echo Installation successful.
pause
exit /b

:error
cls
echo Installation failed - see the README for an alternative approach.
pause

8 changes: 5 additions & 3 deletions scripts/appveyor_win_package.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@ type "%MIMALLOC_PATH%"\LICENSE |more /P > dist\mimalloc-LICENSE
7z a lc0-%APPVEYOR_REPO_TAG_NAME%-windows-%NAME%.zip "%MIMALLOC_PATH%"\out\msvc-x64\Release\mimalloc-redirect.dll
7z a lc0-%APPVEYOR_REPO_TAG_NAME%-windows-%NAME%.zip .\dist\mimalloc-readme.md
7z a lc0-%APPVEYOR_REPO_TAG_NAME%-windows-%NAME%.zip .\dist\mimalloc-LICENSE
IF %CUDA%==true copy lc0-%APPVEYOR_REPO_TAG_NAME%-windows-%NAME%.zip lc0-%APPVEYOR_REPO_TAG_NAME%-windows-%NAME%-nodll.zip
IF %CUDNN%==true copy lc0-%APPVEYOR_REPO_TAG_NAME%-windows-%NAME%.zip lc0-%APPVEYOR_REPO_TAG_NAME%-windows-%NAME%-nodll.zip
IF %NAME%==cpu-openblas 7z a lc0-%APPVEYOR_REPO_TAG_NAME%-windows-%NAME%.zip C:\cache\OpenBLAS\dist64\bin\libopenblas.dll
IF %NAME%==cpu-dnnl 7z a lc0-%APPVEYOR_REPO_TAG_NAME%-windows-%NAME%.zip C:\cache\%DNNL_NAME%\bin\dnnl.dll
IF %NAME%==onednn 7z a lc0-%APPVEYOR_REPO_TAG_NAME%-windows-%NAME%.zip C:\cache\%DNNL_NAME%\bin\dnnl.dll
IF %OPENCL%==true 7z a lc0-%APPVEYOR_REPO_TAG_NAME%-windows-%NAME%.zip C:\cache\opencl-nug.0.777.77\build\native\bin\OpenCL.dll
IF %CUDNN%==true 7z a lc0-%APPVEYOR_REPO_TAG_NAME%-windows-%NAME%.zip "%CUDA_PATH%\bin\cudart64_100.dll" "%CUDA_PATH%\bin\cublas64_100.dll"
IF %CUDNN%==true 7z a lc0-%APPVEYOR_REPO_TAG_NAME%-windows-%NAME%.zip "%CUDA_PATH%\cuda\bin\cudnn64_7.dll"
IF %CUDA%==true 7z a lc0-%APPVEYOR_REPO_TAG_NAME%-windows-%NAME%.zip "%CUDA_PATH%\bin\cudart64_110.dll" "%CUDA_PATH%\bin\cublas64_11.dll" "%CUDA_PATH%\bin\cublasLt64_11.dll"
IF %NAME%==cpu-dnnl copy "%PKG_FOLDER%\%DNNL_NAME%\LICENSE" dist\DNNL-LICENSE
IF %NAME%==cpu-dnnl copy "%PKG_FOLDER%\%DNNL_NAME%\THIRD-PARTY-PROGRAMS" dist\DNNL-THIRD-PARTY-PROGRAMS
IF %NAME%==cpu-dnnl 7z a lc0-%APPVEYOR_REPO_TAG_NAME%-windows-%NAME%.zip .\dist\DNNL-LICENSE
Expand All @@ -39,8 +38,11 @@ IF %OPENCL%==true type scripts\check_opencl.bat |more /P > dist\check_opencl.bat
IF %OPENCL%==true 7z a lc0-%APPVEYOR_REPO_TAG_NAME%-windows-%NAME%.zip .\dist\check_opencl.bat
IF %DX%==true type scripts\check_dx.bat |more /P > dist\check_dx.bat
IF %DX%==true 7z a lc0-%APPVEYOR_REPO_TAG_NAME%-windows-%NAME%.zip .\dist\check_dx.bat
IF %CUDA%==true IF %CUDNN%==false type dist\install-cuda_11_8.cmd |more /P > dist\install.cmd
IF %CUDA%==true IF %CUDNN%==false 7z a lc0-%APPVEYOR_REPO_TAG_NAME%-windows-%NAME%.zip .\dist\install.cmd
IF %CUDA%==true copy "%CUDA_PATH%\EULA.txt" dist\CUDA.txt
IF %CUDA%==true type dist\README-cuda.txt |more /P > dist\README.txt
IF %CUDA%==true IF %CUDNN%==false type dist\README-cuda.txt |more /P > dist\README.txt
IF %CUDNN%==true type dist\README-cudnn.txt |more /P > dist\README.txt
IF %CUDA%==true 7z a lc0-%APPVEYOR_REPO_TAG_NAME%-windows-%NAME%.zip .\dist\README.txt .\dist\CUDA.txt
IF %CUDNN%==true copy "%CUDA_PATH%\cuda\NVIDIA_SLA_cuDNN_Support.txt" dist\CUDNN.txt
IF %CUDNN%==true 7z a lc0-%APPVEYOR_REPO_TAG_NAME%-windows-%NAME%.zip .\dist\CUDNN.txt
Expand Down