Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RiboDetector is not working on GPU mode #34

Closed
Nirmal2310 opened this issue May 26, 2023 · 4 comments
Closed

RiboDetector is not working on GPU mode #34

Nirmal2310 opened this issue May 26, 2023 · 4 comments

Comments

@Nirmal2310
Copy link

Dear @dawnmy @alicemchardy @foobarx @fernandomeyer @TRKlingen , Thank you so much for making this amazing tool for sorting the rRNA sequence from whole genome sequence data. I am currently using this tool to sort rRNA reads from human whole genome sequencing data. I was earlier using the CPU version of RiboDetector but it was taking a very long time so I switched to the GPU version of tool. However I am not able to run the tool in the GPU mode and I am getting the following error:

RuntimeError: The following operation failed in the TorchScript interpreter.
Traceback of TorchScript (most recent call last):
  File "/home/user/miniconda3/envs/ribodetector/lib/python3.8/site-packages/ribodetector/model/model.py", line 118, in last_items
    indices = sorted_last_indices(pack=pack)
    if unsort and pack.unsorted_indices is not None:
        indices = indices[pack.unsorted_indices]
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <--- HERE
    return pack.data[indices]
RuntimeError: indices should be either on cpu or on the same device as the indexed tensor (cpu)

This is the command I am using

ribodetector -l 150 -i Sample1.R1.fastq.gz Sample1.R2.fastq.gz -e rrna --chunk_size 256 -o temp_R1.fastq.gz temp_R2.fastq.gz -r temp_rRNA_R1.fastq.gz temp_rRNA_R2.fastq.gz

I am using CUDA version 11.6 and NVIDIA RTX A5000 with 24 GB memory on Ubuntu 18.04.

Thank you in advance for your help.

@dawnmy
Copy link
Member

dawnmy commented May 27, 2023

Thank you for your interest in RiboDetector. Could you check the available CUDA devices by: echo $CUDA_VISIBLE_DEVICES? Then you can specify the device ID in the command line with -d <ID>. The CPU mode should also be faster compared to other rRNA reads removal tools, and comparable to short reads aligners by enabling parallelization (parameter -t) . Did use multiple processors with -t <num_cpus>? This parameter setting can be used in both CPU and GPU mode.

@Nirmal2310
Copy link
Author

Dear @dawnmy, thank you for the response. I have tried the method you suggested however I am still getting the same error. Initially the echo $CUDA_VISIBLE_DEVICES didn't gave any input so I changed the bashrc accordingly. However it is still giving the same error. Please let me know what else I can do to overcome this issue.
For your reference I am adding the output of nvidia-smi and echo $CUDA_VISIBLE_DEVICES.

image

Please let me know if you need anything else from my side.

@dawnmy
Copy link
Member

dawnmy commented May 28, 2023

What did you change/add in bashrc? If echo $CUDA_VISIBLE_DEVICES does not output anything initially, there might be something wrong with your CUDA setting. Are you able to run other software which relies on CUDA?

The CUDA version in the output of nvidia-smi is not the actual CUDA version you installed but the highest compatible version with your GPU card driver. You can check the version of CUDA with nvcc --version.

@Nirmal2310
Copy link
Author

Dear @dawnmy,
Thank you for the response and yeah it was the issue with the cuda version. The tool is working for me as of now.
Thank you for the help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants