Error in magma_getdevice_arch: MAGMA not initialized (call magma_init() first) or bad device

username: kashik00007
cooked: <p>Hello.</p>
<p>I’m having an error in my terminal whenever I try to run torch that says exactly <code>Error in magma_getdevice_arch: MAGMA not initialized (call magma_init() first) or bad device</code>. I’m not really sure this is similar to <a href="https://github.com/pytorch/pytorch/issues/18074" rel="noopener nofollow ugc">#18074</a> since I didn’t compile torch from source neither MAGMA. Also, it seems to work anyway, it gives me the warning about 6 times but it continues to generate stuff:</p>
<pre><code class="lang-auto">Error in magma_getdevice_arch: MAGMA not initialized (call magma_init() first) or bad device
Error in magma_getdevice_arch: MAGMA not initialized (call magma_init() first) or bad device
Error in magma_getdevice_arch: MAGMA not initialized (call magma_init() first) or bad device
Error in magma_getdevice_arch: MAGMA not initialized (call magma_init() first) or bad device
Error in magma_getdevice_arch: MAGMA not initialized (call magma_init() first) or bad device
generating:  22%|█████████▉                                   | 11/50 [00:05&lt;00:07,  5.55iteration/s]
Error in magma_getdevice_arch: MAGMA not initialized (call magma_init() first) or bad device
Error in magma_getdevice_arch: MAGMA not initialized (call magma_init() first) or bad device
Error in magma_getdevice_arch: MAGMA not initialized (call magma_init() first) or bad device
Error in magma_getdevice_arch: MAGMA not initialized (call magma_init() first) or bad device
Error in magma_getdevice_arch: MAGMA not initialized (call magma_init() first) or bad device
Error in magma_getdevice_arch: MAGMA not initialized (call magma_init() first) or bad device
generating:  24%|██████████▊                                  | 12/50 [00:05&lt;00:06,  5.92iteration
</code></pre>
<p>I’m using:</p>
<pre><code class="lang-auto">pytorch                   1.9.1           cuda112py39h4e14dd4_3    conda-forge
pytorch-gpu               1.9.1           cuda112py39h0bbbad9_3    conda-forge
</code></pre>
<pre><code>PyTorch Version: 1.9.1.post3
OS (e.g., Linux): Linux Ubuntu 20.04
conda
Python version: 3.9.0 | packaged by conda-forge | (default, Nov 26 2020, 07:57:39)
CUDA 11.2
NVCC 11.2
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Sun_Feb_14_21:12:58_PST_2021
Cuda compilation tools, release 11.2, V11.2.152
Build cuda_11.2.r11.2/compiler.29618528_0
GPU models and configuration: RTX 3070
</code></pre>
<p>Any idea on how to solve this? Or just hide this from the terminal without grep buffer change.<br>
Thank you.</p>

username: ptrblck
cooked: <p>It seems you are running into <a href="https://github.com/pytorch/pytorch/issues/60175">this already fixed issue</a> so could you update to the latest stable release (<code>1.10.0</code>) or the nightly?<br>
EDIT: based on your setup you might also run into <a href="https://github.com/pytorch/pytorch/issues/67955">this issue</a> as it seems you are installing the <code>conda-forge</code> binaries, which are not an official build if I understand the linked GitHub issue correctly.</p>

username: kashik00007
cooked: <p><a class="mention" href="/u/ptrblck">@ptrblck</a></p>
<p>I updated to:</p>
<pre><code class="lang-auto">pytorch                   1.10.0          cuda112py39h4e14dd4_0    conda-forge
pytorch-gpu               1.10.0          cuda112py39h0bbbad9_0    conda-forge
</code></pre>
<p>But I got this error…</p>
<pre><code class="lang-auto">Traceback (most recent call last):
  File "/home/luis/Desktop/cog/cogscan/scripts/test_both_libs.py", line 81, in &lt;module&gt;
    metadata_comment = generate.video_frames(num_video_frames=num_video_frames,
  File "/home/luis/Desktop/cog/vqgan-clip-generator/src/vqgan_clip/generate.py", line 345, in video_frames
    eng.initialize_VQGAN_CLIP()
  File "/home/luis/Desktop/cog/vqgan-clip-generator/src/vqgan_clip/engine.py", line 243, in initialize_VQGAN_CLIP
    self._perceptor = clip.load(self.conf.clip_model, jit=jit)[0].eval().requires_grad_(False).to(self._device)
  File "/home/luis/anaconda3/envs/pytorch/lib/python3.9/site-packages/torch/jit/_script.py", line 914, in fail
    raise RuntimeError(name + " is not supported on ScriptModules")
RuntimeError: requires_grad_ is not supported on ScriptModules
</code></pre>
<p>Ok, how do you recommend the installation on a conda environment? I literally did as the website says.</p>

username: kashik00007
cooked: <p><a class="mention" href="/u/ptrblck">@ptrblck</a>  How can I hide this error?</p>

username: ptrblck
cooked: <p>It seems you are still using the <code>conda-forge</code> binaries, so would need to forward the issue to the authors of this build.<br>
In case you are using the official <code>1.10.0</code> release and are still hitting the error, please let me know here.</p>

username: krishpop
cooked: <p>Thanks that worked! I had the same issue on torch 1.9.1 installed with pip, and it went away after upgrading with pip to 1.10.0</p>

username: RAJA_PARIKSHAT
cooked: <p>Hey <a class="mention" href="/u/ptrblck">@ptrblck</a> I am still getting the original error, Error in magma_getdevice_arch: MAGMA not initialized (call magma_init() first) or bad device<br>
Although I installed using conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch</p>

username: ptrblck
cooked: <p>Could you describe when this error is raised and the output of <code>python -m torch.utils.collect_env</code>, please?</p>

username: RAJA_PARIKSHAT
cooked: <p>Thanks, <a class="mention" href="/u/ptrblck">@ptrblck</a>  for your reply, but I managed to resolve the error.</p>