Commit Graph

14 Commits

Author SHA1 Message Date
peterjc123
20a5aa9670 Sync FindCUDA/select_computer_arch.cmake from upstream (#19392)
Summary:
1. Fixes auto detection for Turing cards.
2. Adds Turing Support
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19392

Differential Revision: D14996142

Pulled By: soumith

fbshipit-source-id: 3cd45c58212cf3db96e5fa19b07d9f1b59a1666a
2019-04-18 07:03:19 -07:00
SsnL
13422fca32 Add torch.backends.openmp.is_available(); fix some cmake messages (#16425)
Summary:
1. add `torch.backends.openmp.is_available()`
2. Improve various `cmake` outputs
3. Fix LDFLAGS not respected by `caffe2_pybind11_state_*` targets
4. Fix `MKL` warning message, and QUIET flag.
5. Fix various typos
Pull Request resolved: https://github.com/pytorch/pytorch/pull/16425

Differential Revision: D13903395

Pulled By: soumith

fbshipit-source-id: d15c5d46f53e1ff1c27fca2887b9d23d0bd85b4d
2019-01-31 16:15:46 -08:00
peter
a7afd133f5 Sync FindCUDA.cmake with upstream cmake repo (#11880)
Summary:
Upstream PR: https://gitlab.kitware.com/cmake/cmake/merge_requests/2391/diffs
Pull Request resolved: https://github.com/pytorch/pytorch/pull/11880

Differential Revision: D9989119

Pulled By: soumith

fbshipit-source-id: 66e87367127975a5f1619fe447f74e76f101b503
2018-09-21 06:58:17 -07:00
Soumith Chintala
0927386890 Workaround CUDA logging on some embedded platforms (#11851)
Summary:
Fixes #11518
Upstream PR submitted at https://gitlab.kitware.com/cmake/cmake/merge_requests/2400

On some embedded platforms, the NVIDIA driver is verbose logging unexpected output to stdout.
One example is Drive PX2, where we see something like this whenever a CUDA program is run:

```
nvrm_gpu: Bug 200215060 workaround enabled.
```

This patch does a regex on the output of the architecture detection program to only capture architecture patterns.
It's more robust than before, but not fool-proof.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/11851

Differential Revision: D9968362

Pulled By: soumith

fbshipit-source-id: b7952a87132ab05c724b287b76de263f1f671a0e
2018-09-20 09:26:00 -07:00
peter
10c29c8970 Fix CUDA 8 build on Windows (#11729)
Summary:
Tested via https://github.com/pytorch/pytorch/pull/11374.
Upstream PR: https://gitlab.kitware.com/cmake/cmake/merge_requests/2391
Pull Request resolved: https://github.com/pytorch/pytorch/pull/11729

Differential Revision: D9847807

Pulled By: orionr

fbshipit-source-id: 69af3e6c5bba0abcbc8830495e867a0b1b399c22
2018-09-16 08:09:24 -07:00
Syed Tousif Ahmed
b7ecf035dc Updates FindCUDA.cmake to 3.12.2 upstream version (#11406)
Summary:
This PR is just a copy-paste of the upstream FindCUDA.cmake. Since, cublas_device is deprecated in CUDA >= 9.2, this change is necessary for build.

Related: https://gitlab.kitware.com/cmake/cmake/merge_requests/2298
Pull Request resolved: https://github.com/pytorch/pytorch/pull/11406

Differential Revision: D9735563

Pulled By: ezyang

fbshipit-source-id: c74d86ced7cc485cb2233f9066ce23e921832c30
2018-09-08 23:10:32 -07:00
Tongzhou Wang
73b92472d2 [README.md] Use GitLab URL for CMake (#8799)
* update to GitLab url

* use GitLab url for upstream CMake
2018-06-22 16:51:35 -04:00
Tongzhou Wang
675b579bf9
cmake wrapper (#8797) 2018-06-22 15:29:25 -04:00
Tongzhou Wang
a4bd4f6c6f
Fix -g not passed to nvcc when DEBUG=1 (#8407)
* Fix -g not passed to nvcc when DEBUG=1

* blacklist -Werror

* filter CMAKE_CXX_FLAGS too

* restore to space-delimited string before ending macro
2018-06-14 12:36:50 -04:00
Will Feng
2fdc00e41c
Use sccache for Windows build (#7331) 2018-05-07 14:42:59 -04:00
Edward Z. Yang
73ab15d388
Change ATen to use Caffe2/cmake upstream FindCUDA (#6240)
* Remove ATen's copy of FindCUDA

Signed-off-by: Edward Z. Yang <ezyang@fb.com>

* Minor bugfix for updated FindCUDA.

Signed-off-by: Edward Z. Yang <ezyang@fb.com>

* Use cl.exe as the host compiler even when clcache.exe is set.

Upstream merge request at https://gitlab.kitware.com/cmake/cmake/merge_requests/1933

H/t peterjc123 who contributed the original version of this patch.

Signed-off-by: Edward Z. Yang <ezyang@fb.com>

* Include CMakeInitializeConfigs polyfill from ATen.

Signed-off-by: Edward Z. Yang <ezyang@fb.com>

* Tweak the regex so it actually works on Windows.

Signed-off-by: Edward Z. Yang <ezyang@fb.com>
2018-04-04 23:26:57 -04:00
Edward Z. Yang
ed9952dd25
Update FindCUDA to cmake master as of 561238bb6f07a5ab31293928bd98f6f… (#6241)
* Update FindCUDA to cmake master as of 561238bb6f07a5ab31293928bd98f6f8911d8bc1

NB: I DID have to apply one local patch; it's the `include_guard` change. Should
be obvious next time you do an update.

Relevant commits:

    commit 23119366e9d4e56e13c1fdec9dbff5e8f8c55ee5
    Author: Edward Z. Yang <ezyang@fb.com>
    Date:   Wed Mar 28 11:33:56 2018 -0400

        FindCUDA: Make nvcc configurable via CUDA_NVCC_EXECUTABLE env var

        This is useful if, for example, you want ccache to be used
        for nvcc.  With the current behavior, cmake always picks up
        /usr/local/cuda/bin/nvcc, even if there is a ccache nvcc
        stub in the PATH.  Allowing for CUDA_NVCC_EXECUTABLE lets
        us work around the problem.

        Signed-off-by: Edward Z. Yang <ezyang@fb.com>

    commit e743fc8e9137692232f0220ac901f5a15cbd62cf
    Author: Henry Fredrick Schreiner <henry.fredrick.schreiner@cern.ch>
    Date:   Thu Mar 15 15:30:50 2018 +0100

        FindCUDA/select_compute_arch: Add support for CUDA as a language

        Even though this is an internal module, we can still prepare it to
        be used in another public-facing module outside of `FindCUDA`.

        Issue: #16586

    commit 193082a3c803a6418f0f1b5976dc34a91cf30805
    Author: luz.paz <luzpaz@users.noreply.github.com>
    Date:   Thu Feb 8 06:27:21 2018 -0500

        MAINT: Misc. typos

        Found via `codespell -q 3 -I ../cmake-whitelist.txt`.

    commit 9f74aaeb7d6649241c4a478410e87d092c462960
    Author: Brad King <brad.king@kitware.com>
    Date:   Tue Jan 30 08:18:11 2018 -0500

        FindCUDA: Fix regression in per-config flags

        Changes in commit 48f7e2d300 (Unhardcode the CMAKE_CONFIGURATION_TYPES
        values, 2017-11-27) accidentally left `CUDA_configuration_types`
        undefined, but this is used in a few places to handle per-config flags.
        Restore it.

        Fixes: #17671

    commit d91b2d9158cbe5d65bfcc8f7512503d7f226ad91
    Author: luz.paz <luzpaz@users.noreply.github.com>
    Date:   Wed Jan 10 12:34:14 2018 -0500

        MAINT: Misc. typos

        Found via `codespell`

    commit d08f3f551fa94b13a1d43338eaed68bcecb95cff
    Merge: 1be22978e 1f4d7a071
    Author: Brad King <brad.king@kitware.com>
    Date:   Wed Jan 10 15:34:57 2018 +0000

        Merge topic 'unhardcode-configuration-types'

        1f4d7a07 Help: Add references and backticks in LINK_FLAGS prop_tgt
        48f7e2d3 Unhardcode the CMAKE_CONFIGURATION_TYPES values

        Acked-by: Kitware Robot <kwrobot@kitware.com>
        Merge-request: !1345

    commit 5fbfa18fadf945963687cd95627c1bc62b68948a
    Merge: bc88329e5 ff41a4b81
    Author: Brad King <brad.king@kitware.com>
    Date:   Tue Jan 9 14:26:35 2018 +0000

        Merge topic 'FindCUDA-deduplicate-c+std-host-flags'

        ff41a4b8 FindCUDA: de-duplicates C++11 flag when propagating host flags.

        Acked-by: Kitware Robot <kwrobot@kitware.com>
        Merge-request: !1628

    commit bc88329e5ba7b1a14538f23f4fa223ac8d6d5895
    Merge: 89d127463 fab1b432e
    Author: Brad King <brad.king@kitware.com>
    Date:   Tue Jan 9 14:26:16 2018 +0000

        Merge topic 'msvc2017-findcuda'

        fab1b432 FindCUDA: Update to properly find MSVC 2017 compiler tools

        Acked-by: Kitware Robot <kwrobot@kitware.com>
        Acked-by: Robert Maynard <robert.maynard@kitware.com>
        Merge-request: !1631

    commit 48f7e2d30000dc57c31d3e3ab81077950704a587
    Author: Beren Minor <beren.minor+git@gmail.com>
    Date:   Mon Nov 27 19:22:11 2017 +0100

        Unhardcode the CMAKE_CONFIGURATION_TYPES values

        This removes duplicated code for per-config variable initialization by
        providing a `cmake_initialize_per_config_variable(<PREFIX> <DOCSTRING>)`
        function.

        This function initializes a `<PREFIX>` cache variable from `<PREFIX>_INIT`
        and unless the `CMAKE_NOT_USING_CONFIG_FLAGS` variable is defined, does
        the same with `<PREFIX>_<CONFIG>` from `<PREFIX>_<CONFIG>_INIT` for every
        `<CONFIG>` in `CMAKE_CONFIGURATION_TYPES` for multi-config generators or
        `CMAKE_BUILD_TYPE` for single-config generators.

Signed-off-by: Edward Z. Yang <ezyang@fb.com>

* Polyfill CMakeInitializeConfigs

Signed-off-by: Edward Z. Yang <ezyang@fb.com>

* Tweak condition for when to use bundled FindCUDA support.

Signed-off-by: Edward Z. Yang <ezyang@fb.com>

* Comment out include_guard.

Signed-off-by: Edward Z. Yang <ezyang@fb.com>
2018-04-04 17:04:21 -04:00
Marat Dukhan
c9cc514df4 Bump minimum CMake version to 3.2
CMake 3.2 is required to properly track dependencies in projects imported as ExternalProject_Add (BUILD_BYPRODUCTS parameter).
Users on Ubuntu 14.04 LTS would need to install and use cmake3 package for configurations. Users of other popular distributions generally have a recent enough CMake package.
2018-03-06 19:57:48 -08:00
Yangqing Jia
ab638020f8 Backport FindCUDA functionalities from CMake
Summary:
This is in principle similar to #1612 and is tested on Windows 2017. CMake passes, although there are still bugs in the MSVC compiler that prevents cuda to compile properly.

The difference between this and #1612 is that this diff explicitly puts the CMake files into a separate folder and uses a MiscCheck.cmake chunk of code to test whether we need to include them. See README.txt for more details.
Closes https://github.com/caffe2/caffe2/pull/1727

Reviewed By: pietern

Differential Revision: D6693656

Pulled By: Yangqing

fbshipit-source-id: a74b0a1fde436d7bb2002a56affbc7bbb41ec621
2018-01-10 16:36:03 -08:00