【已解决】UserWarning: You are using GPU version Paddle, but your CUDA device is not set properly.


软件环境
操作系统Ubuntu22.04.1LTS
显卡Geforce MX150
驱动525.60.11
CUDA版本11.7
CUDNN版本8.7
Anaconda3版本4.5.11
paddlepaddle版本2.4.1


问题如下

>>> import paddle
W0117 20:25:17.101466 288816 init.cc:185] Compiled with WITH_GPU, but no GPU found in runtime.
/home/zhangzrjerry/anaconda3/lib/python3.7/site-packages/paddle/fluid/framework.py:622: **UserWarning: You are using GPU version Paddle, but your CUDA device is not set properly. CPU device will be used by default.**
  "You are using GPU version Paddle, but your CUDA device is not set properly. CPU device will be used by default."
>>> paddle.utils.run_check()
Running verify PaddlePaddle program ... 
WARNING:root:You are using GPU version PaddlePaddle, but there is no GPU detected on your machine. Maybe CUDA devices is not set properly.
 Original Error is (External) CUDA error(999), unknown error. 
  [Hint: Please search for the error code(999) on website (https://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART__TYPES.html#group__CUDART__TYPES_1g3f51e3575c2178246db0a94a430e0038) to get Nvidia's official solution and advice about CUDA Error.] (at /paddle/paddle/phi/backends/gpu/cuda/cuda_info.cc:65)

I0117 20:25:43.814098 288816 interpretercore.cc:258] New Executor is Running.
Traceback (most recent call last):
  File "", line 1, in <module>
  File "/home/zhangzrjerry/anaconda3/lib/python3.7/site-packages/paddle/utils/install_check.py", line 278, in run_check
    _run_static_single(use_cuda, use_xpu, use_npu)
  File "/home/zhangzrjerry/anaconda3/lib/python3.7/site-packages/paddle/utils/install_check.py", line 178, in _run_static_single
    exe.run(startup_prog)
  File "/home/zhangzrjerry/anaconda3/lib/python3.7/site-packages/paddle/fluid/executor.py", line 1573, in run
    return_merged=return_merged,
  File "/home/zhangzrjerry/anaconda3/lib/python3.7/site-packages/paddle/fluid/executor.py", line 1821, in _run_impl
    scope, list(feed.keys()), fetch_list, return_numpy
  File "/home/zhangzrjerry/anaconda3/lib/python3.7/site-packages/paddle/fluid/executor.py", line 672, in run
    scope, feed_names, fetch_list
OSError: In user code:

    File "", line 1, in <module>
      
    File "/home/zhangzrjerry/anaconda3/lib/python3.7/site-packages/paddle/utils/install_check.py", line 278, in run_check
      _run_static_single(use_cuda, use_xpu, use_npu)
    File "/home/zhangzrjerry/anaconda3/lib/python3.7/site-packages/paddle/utils/install_check.py", line 163, in _run_static_single
      input, out, weight = _simple_network()
    File "/home/zhangzrjerry/anaconda3/lib/python3.7/site-packages/paddle/utils/install_check.py", line 34, in _simple_network
      attr=paddle.ParamAttr(initializer=paddle.nn.initializer.Constant(0.1)),
    File "/home/zhangzrjerry/anaconda3/lib/python3.7/site-packages/paddle/tensor/creation.py", line 225, in create_parameter
      attr, shape, convert_dtype(dtype), is_bias, default_initializer
    File "/home/zhangzrjerry/anaconda3/lib/python3.7/site-packages/paddle/fluid/layer_helper_base.py", line 443, in create_parameter
      **attr._to_kwargs(with_initializer=True)
    File "/home/zhangzrjerry/anaconda3/lib/python3.7/site-packages/paddle/fluid/framework.py", line 3984, in create_parameter
      initializer(param, self)
    File "/home/zhangzrjerry/anaconda3/lib/python3.7/site-packages/paddle/fluid/initializer.py", line 70, in __call__
      return self.forward(param, block)
    File "/home/zhangzrjerry/anaconda3/lib/python3.7/site-packages/paddle/fluid/initializer.py", line 203, in forward
      stop_gradient=True,
    File "/home/zhangzrjerry/anaconda3/lib/python3.7/site-packages/paddle/fluid/framework.py", line 4042, in append_op
      attrs=kwargs.get("attrs", None),
    File "/home/zhangzrjerry/anaconda3/lib/python3.7/site-packages/paddle/fluid/framework.py", line 2892, in __init__
      for frame in traceback.extract_stack():

    ExternalError: CUDA error(999), unknown error. 
      [Hint: Please search for the error code(999) on website (https://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART__TYPES.html#group__CUDART__TYPES_1g3f51e3575c2178246db0a94a430e0038) to get Nvidia's official solution and advice about CUDA Error.] (at /paddle/paddle/phi/backends/gpu/cuda/cuda_info.cc:65)
      [operator < fill_constant > error]
>>> quit()
terminate called after throwing an instance of 'phi::enforce::EnforceNotMet'
  what():  In user code:

    File "", line 1, in <module>
      
    File "/home/zhangzrjerry/anaconda3/lib/python3.7/site-packages/paddle/utils/install_check.py", line 278, in run_check
      _run_static_single(use_cuda, use_xpu, use_npu)
    File "/home/zhangzrjerry/anaconda3/lib/python3.7/site-packages/paddle/utils/install_check.py", line 163, in _run_static_single
      input, out, weight = _simple_network()
    File "/home/zhangzrjerry/anaconda3/lib/python3.7/site-packages/paddle/utils/install_check.py", line 34, in _simple_network
      attr=paddle.ParamAttr(initializer=paddle.nn.initializer.Constant(0.1)),
    File "/home/zhangzrjerry/anaconda3/lib/python3.7/site-packages/paddle/tensor/creation.py", line 225, in create_parameter
      attr, shape, convert_dtype(dtype), is_bias, default_initializer
    File "/home/zhangzrjerry/anaconda3/lib/python3.7/site-packages/paddle/fluid/layer_helper_base.py", line 443, in create_parameter
      **attr._to_kwargs(with_initializer=True)
    File "/home/zhangzrjerry/anaconda3/lib/python3.7/site-packages/paddle/fluid/framework.py", line 3984, in create_parameter
      initializer(param, self)
    File "/home/zhangzrjerry/anaconda3/lib/python3.7/site-packages/paddle/fluid/initializer.py", line 70, in __call__
      return self.forward(param, block)
    File "/home/zhangzrjerry/anaconda3/lib/python3.7/site-packages/paddle/fluid/initializer.py", line 203, in forward
      stop_gradient=True,
    File "/home/zhangzrjerry/anaconda3/lib/python3.7/site-packages/paddle/fluid/framework.py", line 4042, in append_op
      attrs=kwargs.get("attrs", None),
    File "/home/zhangzrjerry/anaconda3/lib/python3.7/site-packages/paddle/fluid/framework.py", line 2892, in __init__
      for frame in traceback.extract_stack():

    ExternalError: CUDA error(999), unknown error. 
      [Hint: Please search for the error code(999) on website (https://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART__TYPES.html#group__CUDART__TYPES_1g3f51e3575c2178246db0a94a430e0038) to get Nvidia's official solution and advice about CUDA Error.] (at /paddle/paddle/phi/backends/gpu/cuda/cuda_info.cc:65)
      [operator < fill_constant > error]


--------------------------------------
C++ Traceback (most recent call last):
--------------------------------------
0   std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release()
1   paddle::framework::InterpreterCore::~InterpreterCore()

----------------------
Error Message Summary:
----------------------
FatalError: `Process abort signal` is detected by the operating system.
  [TimeInfo: *** Aborted at 1673958447 (unix time) try "date -d @1673958447" if you are using GNU date ***]
  [SignalInfo: *** SIGABRT (@0x3e800046830) received by PID 288816 (TID 0x7f5bc1057740) from PID 288816 ***]

已放弃 (核心已转储)

发现nvidia内核模块未启动

sudo rmmod nvidia_uvm
rmmod: ERROR: Module nvidia_uvm is not currently loaded

启动nvidia内核模块

sudo modprobe nvidia_uvm

问题解决

>>> import paddle
>>> paddle.utils.run_check()
Running verify PaddlePaddle program ... 
I0117 20:27:46.728152 290129 interpretercore.cc:258] New Executor is Running.
W0117 20:27:46.728384 290129 gpu_resources.cc:85] Please NOTE: device: 0, GPU Compute Capability: 6.1, Driver API Version: 12.0, Runtime API Version: 11.7
W0117 20:27:46.745337 290129 gpu_resources.cc:115] device: 0, cuDNN Version: 8.7.
I0117 20:27:49.270186 290129 interpreter_util.cc:619] Standalone Executor is Used.
PaddlePaddle works well on 1 GPU.
PaddlePaddle works well on 1 GPUs.
PaddlePaddle is installed successfully! Let's start deep learning with PaddlePaddle now.

你可能感兴趣的:(paddle,python,深度学习)