After CUDA is installed, the following error is reported using pytorch
UserWarning: CUDA initialization: CUDA unknown error – this may be due to an incorrectly set up environment, e.g. changing env variable CUDA_ VISIBLE_ DEVICES after program start.
Solution: after CUDA and pytorch are installed, add the following in. Bashrc
export PATH=/usr/local/cuda-11.4/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-11.4/lib64$LD_LIBRARY_PATH
export CUDA_HOME=/usr/local/cuda-11.4/bin
export CUDA_VISIBLE_DEVICES=0,1
If there is still a problem, use sudo apt-get install NVIDIA modprobe to install it. After the installation, you can use it
Methods of checking CUDA
import torch
flag = torch.cuda.is_available()
print(flag)
Output is: True cuda normal
Read More:
- [Solved] Pycharm paddle Error: Error: (External) CUDA error(35), CUDA driver version is insufficient for CUDA
- [Solved] RuntimeError: cuda runtime error (100) : no CUDA-capable device is detected at
- [Solved] RuntimeError: CUDA error: device-side assert triggered CUDA kernel errors
- [Solved] CUDA unknown error – this may be due to an incorrectly set up environment
- [Solved] with ERRTYPE = cudaError CUDA failure 999 unknown error
- pytorch: RuntimeError CUDA error device-side assert triggered
- Pytorch torch.cuda.FloatTensor Error: RuntimeError: one of the variables needed for gradient computation has…
- [Solved] pytorch Error: KeyError: tensor(2, device=‘cuda:0‘)
- [Solved] CUDA failure 999: unknown error ; GPU=-351697408 ; hostname=4f5e6dff58e6 ; expr=cudaSetDevice(info_.device_id);
- RTX 3090 Run pytorch Error: CUDA error: no kernel image is available for execution on the device
- [Solved] RuntimeError: CUDA error: CUBLAS_STATUS_EXECUTION_FAILED when calling `cublasSgemm
- RuntimeError: CUDA error: an illegal memory access was encountered
- How to Solve Error: RuntimeError CUDA out of memory
- [How to Solve] RuntimeError: CUDA out of memory.
- [Solved] RuntimeError: CUDA error: CUBLAS_STATUS_EXECUTION_FAILED when calling `cubla…
- [Solved] RuntimeError: cuda runtime error (801) : operation not supported at
- [DL Common Issue] RuntimeError: CUDA error 59: Device-side assert triggered
- [ncclUnhandledCudaError] unhandled cuda error, NCCL version xx.x.x
- [Solved] mmdetection Error: ImportError: /home/user/repos/mmdetection/mmdet/ops/dcn/deform_conv_cuda.cpython-37m-x
- [Solved] Using summary to View network parameters Error: RuntimeError: Input type (torch.cuda.FloatTensor)