CUDA not available in nightly, but is for 2.0.1

lucascolley: <h1><a name="how-to-reproduce-1" class="anchor" href="#how-to-reproduce-1"></a>How to reproduce</h1>
<pre><code class="lang-auto">&gt; mamba create --name pytorch-test python=3.9
&gt; mamba activate pytorch-test
&gt; mamba install -c "nvidia/label/cuda-11.8.0" cuda-toolkit
&gt; mamba install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia
&gt; python
&gt;&gt;&gt; import torch
&gt;&gt;&gt; torch.cuda.is_available()
True

&gt; mamba create --name pytorch-test-2 python=3.9
&gt; mamba activate pytorch-test-2
&gt; mamba install -c "nvidia/label/cuda-11.8.0" cuda-toolkit
&gt; mamba install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch-nightly -c nvidia
&gt; python
&gt;&gt;&gt; import torch
&gt;&gt;&gt; torch.cuda.is_available()
False # should be True, no??
</code></pre>
<h1><a name="output-from-python-collect_envpy-2" class="anchor" href="#output-from-python-collect_envpy-2"></a>Output from <code>python collect_env.py</code></h1>
<details>
<pre><code class="lang-auto">Collecting environment information...
PyTorch version: 2.1.0.dev20230905
Is debug build: False
CUDA used to build PyTorch: Could not collect
ROCM used to build PyTorch: N/A

OS: Ubuntu 22.04.3 LTS (x86_64)
GCC version: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Clang version: Could not collect
CMake version: Could not collect
Libc version: glibc-2.35

Python version: 3.9.18 | packaged by conda-forge | (main, Aug 30 2023, 03:49:32)  [GCC 12.3.0] (64-bit runtime)
Python platform: Linux-6.2.0-32-generic-x86_64-with-glibc2.35
Is CUDA available: False
CUDA runtime version: 11.8.89
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: GPU 0: NVIDIA GeForce GTX 1060 6GB
Nvidia driver version: 525.125.06
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
Architecture:                       x86_64
CPU op-mode(s):                     32-bit, 64-bit
Address sizes:                      43 bits physical, 48 bits virtual
Byte Order:                         Little Endian
CPU(s):                             12
On-line CPU(s) list:                0-11
Vendor ID:                          AuthenticAMD
Model name:                         AMD Ryzen 5 2600 Six-Core Processor
CPU family:                         23
Model:                              8
Thread(s) per core:                 2
Core(s) per socket:                 6
Socket(s):                          1
Stepping:                           2
Frequency boost:                    enabled
CPU max MHz:                        3400.0000
CPU min MHz:                        1550.0000
BogoMIPS:                           6786.17
Flags:                              fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf rapl pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb hw_pstate ssbd ibpb vmmcall fsgsbase bmi1 avx2 smep bmi2 rdseed adx smap clflushopt sha_ni xsaveopt xsavec xgetbv1 clzero irperf xsaveerptr arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif overflow_recov succor smca sev sev_es
Virtualisation:                     AMD-V
L1d cache:                          192 KiB (6 instances)
L1i cache:                          384 KiB (6 instances)
L2 cache:                           3 MiB (6 instances)
L3 cache:                           16 MiB (2 instances)
NUMA node(s):                       1
NUMA node0 CPU(s):                  0-11
Vulnerability Gather data sampling: Not affected
Vulnerability Itlb multihit:        Not affected
Vulnerability L1tf:                 Not affected
Vulnerability Mds:                  Not affected
Vulnerability Meltdown:             Not affected
Vulnerability Mmio stale data:      Not affected
Vulnerability Retbleed:             Mitigation; untrained return thunk; SMT vulnerable
Vulnerability Spec store bypass:    Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:           Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:           Mitigation; Retpolines, IBPB conditional, STIBP disabled, RSB filling, PBRSB-eIBRS Not affected
Vulnerability Srbds:                Not affected
Vulnerability Tsx async abort:      Not affected

Versions of relevant libraries:
[pip3] numpy==1.25.2
[pip3] torch==2.1.0.dev20230905
[pip3] torchaudio==2.2.0.dev20230905
[pip3] torchvision==0.16.0.dev20230905
[conda] blas                      2.116                       mkl    conda-forge
[conda] blas-devel                3.9.0            16_linux64_mkl    conda-forge
[conda] libblas                   3.9.0            16_linux64_mkl    conda-forge
[conda] libcblas                  3.9.0            16_linux64_mkl    conda-forge
[conda] liblapack                 3.9.0            16_linux64_mkl    conda-forge
[conda] liblapacke                3.9.0            16_linux64_mkl    conda-forge
[conda] mkl                       2022.1.0           h84fe81f_915    conda-forge
[conda] mkl-devel                 2022.1.0           ha770c72_916    conda-forge
[conda] mkl-include               2022.1.0           h84fe81f_915    conda-forge
[conda] numpy                     1.25.2           py39h6183b62_0    conda-forge
[conda] pytorch                   2.1.0.dev20230905     py3.9_cpu_0    pytorch-nightly
[conda] pytorch-cuda              11.8                 h7e8668a_5    pytorch-nightly
[conda] pytorch-mutex             1.0                         cpu    pytorch-nightly
[conda] torchaudio                2.2.0.dev20230905        py39_cpu    pytorch-nightly
[conda] torchvision               0.16.0.dev20230905        py39_cpu    pytorch-nightly
</code></pre>
</details>
<h1><a name="context-3" class="anchor" href="#context-3"></a>Context</h1>
<p>I’m trying to test whether <a href="https://github.com/pytorch/pytorch/issues/106773" class="inline-onebox" rel="noopener nofollow ugc">`torch.asarray` does not respect `set_default_device` · Issue #106773 · pytorch/pytorch · GitHub</a> has affected behaviour when the input to <code>torch.asarray</code> is a <code>numpy</code> array.</p>

KFrank: <p>Hi Lucas!</p>
<aside class="quote no-group" data-username="lucascolley" data-post="1" data-topic="187767" data-full="true">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/lucascolley/48/63722_2.png" class="avatar"> lucascolley:</div>
<blockquote>
<pre><code class="lang-auto">&gt;&gt;&gt; import torch
&gt;&gt;&gt; torch.cuda.is_available()
False # should be True, no??
</code></pre>
</blockquote>
</aside>
<p>I can reproduce this (using conda on linux):</p>
<pre><code class="lang-plaintext">&gt;&gt;&gt; import torch
&gt;&gt;&gt; torch.__version__
'2.1.0.dev20230905'
&gt;&gt;&gt; torch.version.cuda
&gt;&gt;&gt; torch.cuda.is_available()
False
</code></pre>
<p>I get this with the install command copied from the <a href="http://python.org" rel="noopener nofollow ugc">python.org</a> home page:</p>
<pre><code class="lang-plaintext">conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch-nightly -c nvidia
</code></pre>
<p>and also with cuda 12.1:</p>
<pre><code class="lang-plaintext">conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch-nightly -c nvidia
</code></pre>
<p>In both cases no part of <code>conda install</code> seems to fail and various cuda stuff<br>
does seem to be getting installed.  (2.0.1 does work with cuda for me.)</p>
<p>(It’s been months since I’ve installed a nightly, so I have no idea when this broke.)</p>
<p>Best.</p>
<p>K. Frank</p>

lucascolley: <p>Thanks for reproducing <a class="mention" href="/u/kfrank">@KFrank</a> ! Should I open an issue on the repo?</p>

KFrank: <p>Hi Lucas!</p>
<aside class="quote no-group" data-username="lucascolley" data-post="3" data-topic="187767" data-full="true">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/lucascolley/48/63722_2.png" class="avatar"> lucascolley:</div>
<blockquote>
<p>Should I open an issue on the repo?</p>
</blockquote>
</aside>
<p>I would think so – can’t hurt.</p>
<p>I’m pretty sure that the nightlies are built automatically.  They do get broken<br>
from time to time and letting a human know would likely be appreciated.</p>
<p>Best.</p>
<p>K. Frank</p>

ptrblck: <p>Thanks for reporting this issue <a class="mention" href="/u/lucascolley">@lucascolley</a>!<br>
I can also reproduce it and indeed it seems no CUDA builds were uploaded in the last few days as seen <a href="https://anaconda.org/pytorch-nightly/pytorch/files">here</a>. You could work around this issue by either installing the last successful build from <code>conda</code> via:</p>
<pre><code class="lang-auto">conda install pytorch==2.1.0.dev20230901 pytorch-cuda=11.8 -c pytorch-nightly -c nvidia
</code></pre>
<p>which should then show:</p>
<pre><code class="lang-auto">The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    pytorch-2.1.0.dev20230901  |py3.10_cuda11.8_cudnn8.7.0_0        1.46 GB  pytorch-nightly
    pytorch-mutex-1.0          |             cuda           3 KB  pytorch-nightly
    ...
</code></pre>
<p>or you could also use the nightly <code>pip</code> wheels. I’ll forward it, but you can also create an issue in the <code>pytorch/pytorch</code> or <code>pytorch/builder</code> repository.</p>
<p>Also, thanks <a class="mention" href="/u/kfrank">@KFrank</a> for checking it so quickly and verifying!</p>

lucascolley: <p>Thanks <a class="mention" href="/u/ptrblck">@ptrblck</a> ! I’ll let you know if I have any problems with using the latest available version. I’ve opened <a href="https://github.com/pytorch/pytorch/issues/108607" class="inline-onebox" rel="noopener nofollow ugc">CUDA not available in nightly · Issue #108607 · pytorch/pytorch · GitHub</a>.</p>

atalman: <p>Thank you <a class="mention" href="/u/lucascolley">@lucascolley</a> we are looking into this issue now. We will try to resolve this asap.</p>