cabooster/DeepCAD-RT

CUDA driver initialization failed, you might not have a CUDA gpu.

Closed this issue · 3 comments

I have followed the installation and setup instructions. I am running now the demo training pipeline that you provide with your zebrafish dataset. And I get this error: RuntimeError: CUDA driver initialization failed, you might not have a CUDA gpu. It appears after:
Total stack number -----> 1
Noise image name -----> fish_localbrain.tif
Noise image shape -----> (6955, 492, 492)

If I run the check that you specify in the colab notebook:
if torch.cuda.is_available():
print('\033[1;31mGPU accessiable. Use GPU for computation.\033[0m')
gpu_id = torch.cuda.current_device()
total_memory = torch.cuda.get_device_properties(gpu_id).total_memory/1024/1024
alloc_memory = torch.cuda.memory_allocated(0)/1024/1024
print('GPU ID: ', gpu_id, '|', torch.cuda.get_device_name(),
'| Memory: {:.0f} MB'.format(total_memory))
! nvcc --version
print('PyTorch version: ', torch.version)
else:
print('\033[1;31mNo GPU support. Please enable GPUs for the notebook:\033[0m')
print(' 1. Navigate to Edit → Notebook Settings')
print(' 2. Select GPU from the Hardware Accelerator drop-down')

I get that torch.cuda is not available and hence it tells me to do the 1 and 2 commands. But I do not have notebook settings in Edit or nothing related to GPU settings in the drop down menus.
I am running an Ubuntu 18.04 Spyder Anaconda Python 3.6 .
So how can I solve this issue?

To solve this issue, the following methods may be helpful:

  1. If you have a GPU device, you can directly go to step 2. If not, you can run DeepCAD-RT directly in your browser using a cloud GPU without configuring the environment by directly clicking this link, where you can see Edit in the upper left corner.
    Snipaste_2022-03-29_15-10-16

  2. Please check whether you install CUDA. Run the following command in a terminal window:

    nvcc -V
    

    If this results in something like the following, it means that you have installed CUDA. Please remember the CUDA version (e.g. 11.1).

    nvcc: NVIDIA (R) Cuda compiler driver
    Copyright (c) 2005-2020 NVIDIA Corporation
    Built on Mon_Oct_12_20:09:46_PDT_2020
    Cuda compilation tools, release 11.1, V11.1.105
    Build cuda_11.1.TC455_06.29190527_0
    

​ If it reports an error, you can install CUDA with this tutoiral.

  1. Make sure that your Pytorch version matches your CUDA version. You can select the correct Pytorch version from https://pytorch.org/get-started/previous-versions/.

This issue is similar to the solved problem in Stackoverflow. You can also refer to the answers in this link.

I found also this video really useful to solve the issue dependencies for cuda installation in ubuntu. https://www.youtube.com/watch?v=GljujCLixzE