question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RuntimeError: radix_sort: failed on 1st step: cudaErrorInvalidDevice: invalid device ordinal

See original GitHub issue

Hello! Nice work!

I’m trying to get this running on an RTX 3090, I’m getting warnings when installing where its recommending that i launch with -std=c++14

Other than that I’m not seeing anything out of the ordinary. Has anyone else managed to get this running for newer rtx cards?

  File "/opt/conda/envs/pytorch_venv/lib/python3.7/site-packages/torch/_tensor.py", line 255, in backward
    torch.autograd.backward(self, gradient, retain_graph, create_graph, inputs=inputs)
  File "/opt/conda/envs/pytorch_venv/lib/python3.7/site-packages/torch/autograd/__init__.py", line 149, in backward
    allow_unreachable=True, accumulate_grad=True)  # allow_unreachable flag
  File "/opt/conda/envs/pytorch_venv/lib/python3.7/site-packages/torch/autograd/function.py", line 87, in apply
    return self._forward_cls.backward(self, *args)  # type: ignore[attr-defined]
  File "/opt/conda/envs/pytorch_venv/lib/python3.7/site-packages/diffvg-0.0.1-py3.7-linux-x86_64.egg/pydiffvg/render_pytorch.py", line 709, in backward
    eval_positions.shape[0])
RuntimeError: radix_sort: failed on 1st step: cudaErrorInvalidDevice: invalid device ordinal

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:2
  • Comments:6

github_iconTop GitHub Comments

4reactions
IzhanVarskycommented, Jan 12, 2022

Hi! I also ran into this problem. As I understand it, this is a compatibility issue. Changing this line https://github.com/BachiLi/diffvg/blob/e5955dbdcb4715ff3fc6cd7d74848a3aad87ec99/CMakeLists.txt#L23 to this: set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -std=c++14 -gencode=arch=compute_37,code=sm_37") for Tesla K80 on Google Colab helped me. -gencode=arch=compute_86,code=sm_86 for RTX 3090. -gencode=arch=compute_75,code=sm_75 for Tesla T4. Found info about matching CUDA arch here: https://arnon.dk/matching-sm-architectures-arch-and-gencode-for-various-nvidia-cards/

3reactions
pschaldenbrandcommented, Feb 4, 2022

@IzhanVarsky Thank you so much!! I updated the install section of my notebooks that use diffvg with the following code, and now they work when Colab assigns me K80 machines.

%cd /content/
!git clone https://github.com/BachiLi/diffvg 
%cd diffvg
import subprocess
if 'K80' in str(subprocess.check_output(['nvidia-smi', '-L'])):
    !sed -i 's/set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -std=c++11")/set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -std=c++14 -gencode=arch=compute_37,code=sm_37")/' /content/diffvg/CMakeLists.txt
!git submodule update --init --recursive 
!python setup.py install          
Read more comments on GitHub >

github_iconTop Results From Across the Web

radix_sort: failed on 1st step: cudaErrorInvalidDevice: invalid ...
But I get RuntimeError: radix_sort: Instructions To Reproduce the ... on 1st step: cudaErrorInvalidDevice: invalid device ordinal #2743.
Read more >
Pytorch 1.8.0 fasterrcnn_resnet50_fpn error - autograd
... RuntimeError Traceback (most recent call last) ... radix_sort: failed on 1st step: cudaErrorInvalidDevice: invalid device ordinal.
Read more >
How to solve "RuntimeError: CUDA error: invalid device ...
So I downloaded the tar.z file from pypi.org and take the model.pkl file from there and paste that in my libraries. It's working...
Read more >
成功解决RuntimeError: radix_sort: failed on 1st step ...
成功解决RuntimeError: radix_sort: failed on 1st step: cudaErrorInvalidDevice: invalid device ordinal项目场景:linux下detectron2异常解决问题 ...
Read more >
Error Message "cuda runtime error (10) : invalid device ordinal ...
The CUDA_VISIBLE_DEVICES setting does not comply with job specifications. For example, you select a job with four GPUs, and the IDs of available...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found