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

Test building Linux CUDA miner on CI #66

Closed
wants to merge 1 commit into from

Conversation

lucafavatella
Copy link
Contributor

No description provided.

Copy link
Owner

@tromp tromp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automatically downloading and installing CUDA seems a bit over the top.
Could you rewrite the test to just check if CUDA is already available, and if not, skip the test?

lucafavatella pushed a commit to aeternity/cuckoo that referenced this pull request Dec 12, 2018
lucafavatella pushed a commit to aeternity/cuckoo that referenced this pull request Dec 12, 2018
... at the expense of losing control of toolkit version.

References:
* [Travis CI apt addon doc](https://docs.travis-ci.com/user/installing-dependencies/#adding-apt-packages)
* Package name [nvidia-cuda-toolkit](https://github.com/travis-ci/apt-package-safelist/blob/139a20ccd62a9578ede0597de1f5d1f7d16f470c/ubuntu-trusty#L11030)

If only package `nvidia-cuda-toolkit` installed, CI failes with
following error:
```
The following packages have unmet dependencies:
 nvidia-cuda-toolkit : Depends: nvidia-profiler (= 5.5.22-3ubuntu1) but it is not going to be installed
                       Depends: nvidia-cuda-dev (= 5.5.22-3ubuntu1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
apt-get install failed
```

Addresses tromp#66 (review)
lucafavatella pushed a commit to aeternity/cuckoo that referenced this pull request Dec 12, 2018
... at the expense of losing control of toolkit version.

References:
* [Travis CI apt addon doc](https://docs.travis-ci.com/user/installing-dependencies/#adding-apt-packages)
* Package name [nvidia-cuda-toolkit](https://github.com/travis-ci/apt-package-safelist/blob/139a20ccd62a9578ede0597de1f5d1f7d16f470c/ubuntu-trusty#L11030)

If only package `nvidia-cuda-toolkit` installed, CI failes with
following error:
```
The following packages have unmet dependencies:
 nvidia-cuda-toolkit : Depends: nvidia-profiler (= 5.5.22-3ubuntu1) but it is not going to be installed
                       Depends: nvidia-cuda-dev (= 5.5.22-3ubuntu1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
apt-get install failed
```

Addresses tromp#66 (review)
@lucafavatella
Copy link
Contributor Author

Could you rewrite the test to just check if CUDA is already available, and if not, skip the test?

@tromp I am not sure I get what you suggest. This is the CI configuration, so we know that CUDA toolkit is absent (no CUDA hardware or driver is needed in order to build the miner). So, if we want to have CI test building the CUDA miner, we need to configure CI to automatically download and install CUDA. There are two options:

  • (A) Download and install step by step as a user would. This is what this PR does.
  • (B) Download and install relying on Travis CI apt addon.

I tried option B without success still getting nvcc fatal : Unknown option 'std'. If I read the CI logs correctly, with apt addon CI installs nvidia-cuda-toolkit_5.5.22-3ubuntu1_amd64.deb that seems old. Maybe there is better way (other apt repo?) though I am unable to spend further time on this now. Draft patch below.

Simplify CUDA toolkit installation

... at the expense of losing control of toolkit version.

References:

If only package nvidia-cuda-toolkit installed, CI fails with
following error:

The following packages have unmet dependencies:
 nvidia-cuda-toolkit : Depends: nvidia-profiler (= 5.5.22-3ubuntu1) but it is not going to be installed
                       Depends: nvidia-cuda-dev (= 5.5.22-3ubuntu1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
apt-get install failed

Addresses #66 (review)

@@ -3,8 +3,8 @@ sudo: false
 language: cpp
 env:
   - JOB=cuckoo
-  - JOB=cuckoo-cuda MINER=cuda29  CUDA_DISTRO=ubuntu1404 CUDA_VSN_MAJOR=10 CUDA_VSN_MINOR=0 CUDA_VSN_PATCH=130-1 CUDA_ARCH=amd64 CUDA_PKG=cuda-toolkit
-  - JOB=cuckoo-cuda MINER=lcuda29 CUDA_DISTRO=ubuntu1404 CUDA_VSN_MAJOR=10 CUDA_VSN_MINOR=0 CUDA_VSN_PATCH=130-1 CUDA_ARCH=amd64 CUDA_PKG=cuda-toolkit
+  - JOB=cuckoo-cuda MINER=cuda29
+  - JOB=cuckoo-cuda MINER=lcuda29
   - JOB=cuckatoo
   - JOB=java
   - JOB=doc
@@ -16,26 +16,14 @@ matrix:
       env: JOB=java
 addons:
   apt:
+    update: true # For preventing error `nvcc fatal   : Unknown option 'std'`
     packages:
+      - nvidia-cuda-toolkit
+      - nvidia-cuda-dev # Needed by nvidia-cuda-toolkit
+      - nvidia-profiler # Needed by nvidia-cuda-toolkit
       - texlive-latex-base
       - texlive-pictures
       - pgf
-before_install:
-  - |
-    if test linux = "${TRAVIS_OS_NAME:?}" -a cuckoo-cuda = "${JOB:?}"; then
-      # Refs:
-      # * https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#ubuntu-installation
-      # * https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#package-manager-metas
-      # * https://developer.nvidia.com/cuda-downloads
-      CUDA_VSN=${CUDA_VSN_MAJOR:?}.${CUDA_VSN_MINOR:?}.${CUDA_VSN_PATCH:?}
-      curl -OfsS https://developer.download.nvidia.com/compute/cuda/repos/${CUDA_DISTRO:?}/x86_64/cuda-repo-${CUDA_DISTRO:?}_${CUDA_VSN:?}_${CUDA_ARCH:?}.deb \
-      && sudo dpkg -i cuda-repo-${CUDA_DISTRO:?}_${CUDA_VSN:?}_${CUDA_ARCH:?}.deb \
-      && rm cuda-repo-${CUDA_DISTRO:?}_${CUDA_VSN:?}_${CUDA_ARCH:?}.deb \
-      && sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/${CUDA_DISTRO:?}/x86_64/7fa2af80.pub \
-      && sudo apt-get update \
-      && sudo apt-get install cuda-toolkit-${CUDA_VSN_MAJOR:?}-${CUDA_VSN_MINOR:?} \
-      && export PATH=/usr/local/cuda-${CUDA_VSN_MAJOR:?}.${CUDA_VSN_MINOR}/bin${PATH:+:${PATH}}
-    fi
 before_script:
   - case "${TRAVIS_OS_NAME:?}" in linux) LIBV=LD_LIBRARY_PATH;; osx) LIBV=DYLD_LIBRARY_PATH;; esac
   - echo "The library path variable name is ${LIBV:?}"

@tromp
Copy link
Owner

tromp commented Dec 12, 2018 via email

lucafavatella pushed a commit to aeternity/cuckoo that referenced this pull request Dec 12, 2018
... at the expense of losing control of toolkit version.

References:
* [Travis CI apt addon doc](https://docs.travis-ci.com/user/installing-dependencies/#adding-apt-packages)
* Package name [nvidia-cuda-toolkit](https://github.com/travis-ci/apt-package-safelist/blob/139a20ccd62a9578ede0597de1f5d1f7d16f470c/ubuntu-trusty#L11030)

If only package `nvidia-cuda-toolkit` installed, CI fails with
following error:
```
The following packages have unmet dependencies:
 nvidia-cuda-toolkit : Depends: nvidia-profiler (= 5.5.22-3ubuntu1) but it is not going to be installed
                       Depends: nvidia-cuda-dev (= 5.5.22-3ubuntu1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
apt-get install failed
```

If macro `NVCC=nvcc` not passed to `make`, CI fails with `nvcc fatal :
Unknown option 'std'`
([ref](tromp#66 (comment))).

Addresses tromp#66 (review)
@lucafavatella
Copy link
Contributor Author

I'd prefer to try to get option (B) working.

This means that if you first define NVCC=nvcc it will avoid the -std option.

Could you try to get that to work?

Attempt.

CI job failure:

$ if test cuckoo-cuda = "${JOB:?}"; then make -C src/cuckoo NVCC=nvcc ${MINER:?}; fi
make: Entering directory `/home/travis/build/aeternity/cuckoo/src/cuckoo'
nvcc -o cuda29 -DEDGEBITS=29 -arch sm_35 mean.cu ../crypto/blake2b-ref.c
In file included from /usr/include/c++/4.8/chrono:35:0,
                 from cuckoo.h:8,
                 from mean.cu:10:
/usr/include/c++/4.8/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
 #error This file requires compiler and library support for the \
  ^
make: *** [cuda29] Error 1
make: Leaving directory `/home/travis/build/aeternity/cuckoo/src/cuckoo'

@tromp
Copy link
Owner

tromp commented Dec 12, 2018

How can it complain about both

nvcc fatal : Unknown option 'std'

and

must be enabled with the -std=c++11 option

? I'm very confused...

@tolbrino
Copy link
Contributor

@lucafavatella You could cache the CUDA folders for later builds, see https://docs.travis-ci.com/user/caching/

So if the folder doesn't exist, run through the full installation once. Then if it exists, skip the installation.

@lucafavatella
Copy link
Contributor Author

I do not plan to update this PR so closing. Things missing:

  • Decision of installation approach for CUDA toolkit, if different from the one proposed in PR. Maybe checking if Travis, as preferred by @tromp , offers newer CUDA toolkit. Maybe Travis cache as suggested by @tolbrino
  • Merge conflicts need resolution.

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

Successfully merging this pull request may close these issues.

3 participants