Calling torch.linalg.cholesky on a CPU tensor requires compiling PyTorch with LAPACK.
Labels: triaged, module: linear algebra

### 🐛 Describe the bug

I installed PyTorch from Source and it showes error when I try to run `python -m pytest test/distributions/test_distributions.py'.

============================= test session starts ==============================
platform linux -- Python 3.10.4, pytest-7.1.2, pluggy-1.0.0
rootdir: /home/nonconvexopt/research/__common_modules__/pytorch, configfile: pytest.ini
collected 0 items / 1 error                                                    

```
==================================== ERRORS ====================================
__________ ERROR collecting test/distributions/test_distributions.py ___________
Traceback (most recent call last):
  File "{DIR}/pytorch/test/distributions/test_distributions.py", line 542, in <module>
    'component_distribution': MultivariateNormal(
  File "{DIR}/pytorch/torch/distributions/multivariate_normal.py", line 148, in __init__
    super(MultivariateNormal, self).__init__(batch_shape, event_shape, validate_args=validate_args)
  File "{DIR}/pytorch/torch/distributions/distribution.py", line 54, in __init__
    valid = constraint.check(value)
  File "{DIR}/pytorch/torch/distributions/constraints.py", line 512, in check
    return torch.linalg.cholesky_ex(value).info.eq(0)
RuntimeError: Calling torch.linalg.cholesky on a CPU tensor requires compiling PyTorch with LAPACK. Please use PyTorch built with LAPACK support.
------------------------------- Captured stdout --------------------------------
Fail to import hypothesis in common_utils, tests are not derandomized
=========================== short test summary info ============================
ERROR test/distributions/test_distributions.py - RuntimeError: Calling torch....
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
========================= 2 warnings, 1 error in 1.66s =========================
```

I tried to build PyTorch with `python setup.py build` and `python setup.py develop`. Also I installed `magma-cuda11.7`. But it does not solve the problem.

### Versions

PyTorch version: 1.13.0a0+git65f7fa8
Is debug build: False
CUDA used to build PyTorch: 11.7
ROCM used to build PyTorch: N/A

OS: Ubuntu 22.04.1 LTS (x86_64)
GCC version: (Ubuntu 11.2.0-19ubuntu1) 11.2.0
Clang version: Could not collect
CMake version: version 3.24.0
Libc version: glibc-2.35

Python version: 3.10.4 (main, Mar 31 2022, 08:41:55) [GCC 7.5.0] (64-bit runtime)
Python platform: Linux-5.15.0-43-generic-x86_64-with-glibc2.35
Is CUDA available: True
CUDA runtime version: 11.7.99
GPU models and configuration: GPU 0: NVIDIA GeForce RTX 3090
Nvidia driver version: 515.65.01
cuDNN version: Probably one of the following:
/usr/local/cuda-11.7/targets/x86_64-linux/lib/libcudnn.so.8.4.1
/usr/local/cuda-11.7/targets/x86_64-linux/lib/libcudnn_adv_infer.so.8.4.1
/usr/local/cuda-11.7/targets/x86_64-linux/lib/libcudnn_adv_train.so.8.4.1
/usr/local/cuda-11.7/targets/x86_64-linux/lib/libcudnn_cnn_infer.so.8.4.1
/usr/local/cuda-11.7/targets/x86_64-linux/lib/libcudnn_cnn_train.so.8.4.1
/usr/local/cuda-11.7/targets/x86_64-linux/lib/libcudnn_ops_infer.so.8.4.1
/usr/local/cuda-11.7/targets/x86_64-linux/lib/libcudnn_ops_train.so.8.4.1
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

Versions of relevant libraries:
[pip3] numpy==1.23.2
[pip3] torch==1.13.0a0+git65f7fa8
[conda] magma-cuda110             2.5.2                         1    pytorch
[conda] magma-cuda117             2.6.1                         0    pytorch
[conda] numpy                     1.23.2                   pypi_0    pypi
[conda] torch                     1.13.0a0+git65f7fa8           dev_0    <develop>

cc @jianyuh @nikitaved @pearu @mruberry @walterddr @IvanYashchuk @xwang233 @Lezcano