|
| 1 | +opam-version: "2.0" |
| 2 | +maintainer: "Lukasz Stafiniak < [email protected]>" |
| 3 | +authors: [ |
| 4 | + "NVidia" |
| 5 | +] |
| 6 | +homepage: "https://docs.nvidia.com/cuda/" |
| 7 | +license: "CUDA Toolkit End User License Agreement <https://docs.nvidia.com/cuda/eula/index.html>" |
| 8 | +# We do not restrict availability to let users install CUDA themselves. |
| 9 | +build: [ |
| 10 | + ["sh" "-exc" "cat <<EOF > test.c |
| 11 | + #include \"cuda.h\" |
| 12 | + #include \"nvrtc.h\" |
| 13 | + "] |
| 14 | + ["sh" "-exc" "cc -c $CFLAGS -I%{conf-cuda-config:cuda_path}%/include test.c"] |
| 15 | +] |
| 16 | +# Note: the minimal set of packages directly from NVidia repositories, e.g. for cudajit: |
| 17 | +# "cuda-cudart-X-Y" "cuda-cudart-dev-X-Y" "cuda-runtime-X-Y" "cuda-nvrtc-X-Y" "cuda-nvrtc-dev-X-Y" |
| 18 | +# where e.g. X=12, Y=4 is the CUDA version. |
| 19 | +depends: [ "conf-cuda-config" ] |
| 20 | +setenv: [ |
| 21 | + [ CUDA_PATH = "%{conf-cuda-config:cuda_path}%" ] |
| 22 | +] |
| 23 | +post-messages: [ |
| 24 | + "Make sure that CUDA is properly installed under the path %{conf-cuda-config:cuda_path}%; or properly set the CUDA_PATH environment variable and re-install opam package conf-cuda-config. See: https://docs.nvidia.com/cuda/ Failing configuration: CUDA_PATH=%{conf-cuda-config:cuda_path}%, is-WSL %{conf-cuda-config:is_wsl}%, OS family %{os-family}%" |
| 25 | + {failure & conf-cuda-config:cuda_preinstalled} |
| 26 | + "Execute: $ sudo add-apt-repository multiverse; sudo apt update; sudo apt-get install nvidia-cuda-dev nvidia-cuda-toolkit" |
| 27 | + {failure & !conf-cuda-config:cuda_preinstalled & !conf-cuda-config:is_wsl & os-family = "debian" & os-distribution != "ubuntu"} |
| 28 | + "Execute: $ sudo apt-get install nvidia-cuda-dev nvidia-cuda-toolkit" |
| 29 | + {failure & !conf-cuda-config:cuda_preinstalled & !conf-cuda-config:is_wsl & os-distribution = "ubuntu"} |
| 30 | + "Under WSL, manually install CUDA. See https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#network-repo-installation-for-wsl" |
| 31 | + {failure & !conf-cuda-config:cuda_preinstalled & conf-cuda-config:is_wsl} |
| 32 | + "Execute: $ sudo zypper in CUDA CUDA-tools" |
| 33 | + {failure & !conf-cuda-config:is_wsl & !conf-cuda-config:cuda_preinstalled & |
| 34 | + (os-family = "opensuse" | os-distribution = "opensuse-leap" | os-distribution = "opensuse-tumbleweed")} |
| 35 | + "Execute: $ sudo pacman -Sy cuda" |
| 36 | + {failure & !conf-cuda-config:is_wsl & !conf-cuda-config:cuda_preinstalled & os-family = "arch"} |
| 37 | + "Alternatively: manually install CUDA or verify that CUDA_PATH is set properly, and re-install opam package conf-cuda-config. See: https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html" |
| 38 | + {failure & !conf-cuda-config:is_wsl & !conf-cuda-config:cuda_preinstalled & os = "linux"} |
| 39 | + "Manually install CUDA or verify that CUDA_PATH is set properly, and re-install opam package conf-cuda-config. See: https://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/index.html" |
| 40 | + {failure & !conf-cuda-config:is_wsl & !conf-cuda-config:cuda_preinstalled & os = "windows"} |
| 41 | + "If CUDA is supported on your system, manually install CUDA or verify that CUDA_PATH is set properly, and re-install opam package conf-cuda-config. See: https://docs.nvidia.com/cuda/" |
| 42 | + {failure & !conf-cuda-config:is_wsl & !conf-cuda-config:cuda_preinstalled & os != "linux" & os != "windows"} |
| 43 | +] |
| 44 | +synopsis: "Virtual package relying on a CUDA system installation" |
| 45 | +description: |
| 46 | + "This package can only install if CUDA is installed on the system." |
| 47 | +bug-reports: "https://github.com/ocaml/opam-repository/issues" |
| 48 | +flags: conf |
0 commit comments