pynvml.nvml.NVMLError_FunctionNotFound: Function Not Found

在Docker中运行报错:

Traceback (most recent call last):
  File "/opt/conda/envs/rapids/lib/python3.8/site-packages/pynvml/nvml.py", line 782, in _nvmlGetFunctionPointer
    _nvmlGetFunctionPointer_cache[name] = getattr(nvmlLib, name)
  File "/opt/conda/envs/rapids/lib/python3.8/ctypes/__init__.py", line 386, in __getattr__
    func = self.__getitem__(name)
  File "/opt/conda/envs/rapids/lib/python3.8/ctypes/__init__.py", line 391, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: /usr/lib/x86_64-linux-gnu/libnvidia-ml.so.1: undefined symbol: nvmlDeviceGetComputeRunningProcesses_v2

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/envs/rapids/lib/python3.8/site-packages/dask_cuda/initialize.py", line 32, in _create_cuda_context
    distributed.comm.ucx.init_once()
  File "/opt/conda/envs/rapids/lib/python3.8/site-packages/distributed/comm/ucx.py", line 86, in init_once
    pre_existing_cuda_context = has_cuda_context()
  File "/opt/conda/envs/rapids/lib/python3.8/site-packages/distributed/diagnostics/nvml.py", line 91, in has_cuda_context
    running_processes = pynvml.nvmlDeviceGetComputeRunningProcesses_v2(handle)
  File "/opt/conda/envs/rapids/lib/python3.8/site-packages/pynvml/nvml.py", line 2191, in nvmlDeviceGetComputeRunningProcesses_v2
    fn = _nvmlGetFunctionPointer("nvmlDeviceGetComputeRunningProcesses_v2")
  File "/opt/conda/envs/rapids/lib/python3.8/site-packages/pynvml/nvml.py", line 785, in _nvmlGetFunctionPointer
    raise NVMLError(NVML_ERROR_FUNCTION_NOT_FOUND)
pynvml.nvml.NVMLError_FunctionNotFound: Function Not Found
2022-05-16 15:19:14,517 - distributed.preloading - INFO - Run preload setup click command: dask_cuda.initialize
2022-05-16 15:19:14,517 - distributed.worker - INFO -       Start worker at:    ws://10.233.68.22:39537/
2022-05-16 15:19:14,517 - distributed.worker - INFO -          Listening to:    ws://10.233.68.22:39537/
2022-05-16 15:19:14,517 - distributed.worker - INFO -          dashboard at:         10.233.68.22:35313
2022-05-16 15:19:14,517 - distributed.worker - INFO - Waiting to connect to: ws://launcher-svc-1245231:8786/
2022-05-16 15:19:14,517 - distributed.worker - INFO - -------------------------------------------------
2022-05-16 15:19:14,517 - distributed.worker - INFO -               Threads:                          1
2022-05-16 15:19:14,517 - distributed.worker - INFO -                Memory:                 400.00 GiB
2022-05-16 15:19:14,517 - distributed.worker - INFO -       Local Directory: /rapids/notebooks/dask-worker-space/worker-ave_m7tw
2022-05-16 15:19:14,517 - distributed.worker - INFO - Starting Worker plugin PreImport-0b003d61-7c5f-4530-bf6f-c95b93c83338
2022-05-16 15:19:14,517 - distributed.worker - INFO - Starting Worker plugin CPUAffinity-a1d437c7-bb5d-408e-a3e0-3120dd6c6a5f
2022-05-16 15:19:14,518 - distributed.worker - INFO - Starting Worker plugin RMMSetup-03e12d8b-4b23-4e0e-9b3c-a79b6b12e7ab
2022-05-16 15:19:14,974 - distributed.worker - INFO - -------------------------------------------------
2022-05-16 15:19:15,025 - distributed.worker - INFO -         Registered to: ws://launcher-svc-1245231:8786/
2022-05-16 15:19:15,025 - distributed.worker - INFO - -------------------------------------------------
2022-05-16 15:19:15,026 - distributed.core - INFO - Starting established connection

用nvidia-smi查看当前Cuda版本:

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 470.199.02   Driver Version: 470.199.02   CUDA Version: 11.4     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  Off  | 00000000:01:00.0  On |                  N/A |
| 35%   33C    P8    18W / 220W |    552MiB /  7959MiB |     13%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

参照提示:解决方案
因为Cuda和pynvml库间存在对应关系,要么升级Cuda,要么降级pynvml。
进入python3,查看pynvml版本:

>>> import pynvml
>>> print(pynvml.__version__)
11.5.1

猜想可能是pynvml版本过高与Cuda不匹配导致的,直接通过pip降级pynvml。

pip install pynvml==11.4.1

问题解决。

function Currency:setLastAddSkillPoint(val) m_currency.m_iLastAutoAddSkillPointTime = val end function Currency:getLastAddSkillPoint() return m_currency.m_iLastAutoAddSkillPointTime end function Currency:addLastAddSkillPoint(val) m_currency.m_iLastAutoAddSkillPointTime = m_currency.m_iLastAutoAddSkillPointTime + val end function Currency:getYuxi() return m_currency.m_iYuxi end function Currency:addYuxi(val) m_currency.m_iYuxi = m_currency.m_iYuxi + val end function Currency:getUniversal() return m_currency.m_iUniversal end function Currency:addUniversal(val) m_currency.m_iUniversal = m_currency.m_iUniversal + val end function Currency:setGuildCoin(val) m_currency.m_iGuildCoin = val end function Currency:getGuildCoin() return m_currency.m_iGuildCoin end function Currency:addGuildCoin(val) m_currency.m_iGuildCoin = m_currency.m_iGuildCoin + val end --TacticsCoin-- function Currency:setTacticsCoin(val) m_currency.m_iTacticsCoin = val end function Currency:getTacticsCoin() return m_currency.m_iTacticsCoin end function Currency:addTacticsCoin(val) m_currency.m_iTacticsCoin = m_currency.m_iTacticsCoin + val end --全民战役-- function Currency:setWarContribution(val) m_currency.m_iWarContribution = val end function Currency:getWarContribution() return m_currency.m_iWarContribution end function Currency:addWarContribution(val) m_currency.m_iWarContribution = m_currency.m_iWarContribution + val end function Currency:setMilitaryRank(val) m_currency.m_iMilitaryRank = val end function Currency:getMilitaryRank() return m_currency.m_iMilitaryRank end 翻译成TS
05-27
抱歉,由于您提供的是Lua代码,我无法为您直接翻译成TS。但是,您可以根据Lua代码手动将其转换为TS代码,例如: ``` interface Currency { m_iLastAutoAddSkillPointTime: number; m_iYuxi: number; m_iUniversal: number; m_iGuildCoin: number; m_iTacticsCoin: number; m_iWarContribution: number; m_iMilitaryRank: number; } function setLastAddSkillPoint(this: Currency, val: number): void { this.m_iLastAutoAddSkillPointTime = val; } function getLastAddSkillPoint(this: Currency): number { return this.m_iLastAutoAddSkillPointTime; } function addLastAddSkillPoint(this: Currency, val: number): void { this.m_iLastAutoAddSkillPointTime += val; } function getYuxi(this: Currency): number { return this.m_iYuxi; } function addYuxi(this: Currency, val: number): void { this.m_iYuxi += val; } function getUniversal(this: Currency): number { return this.m_iUniversal; } function addUniversal(this: Currency, val: number): void { this.m_iUniversal += val; } function setGuildCoin(this: Currency, val: number): void { this.m_iGuildCoin = val; } function getGuildCoin(this: Currency): number { return this.m_iGuildCoin; } function addGuildCoin(this: Currency, val: number): void { this.m_iGuildCoin += val; } function setTacticsCoin(this: Currency, val: number): void { this.m_iTacticsCoin = val; } function getTacticsCoin(this: Currency): number { return this.m_iTacticsCoin; } function addTacticsCoin(this: Currency, val: number): void { this.m_iTacticsCoin += val; } function setWarContribution(this: Currency, val: number): void { this.m_iWarContribution = val; } function getWarContribution(this: Currency): number { return this.m_iWarContribution; } function addWarContribution(this: Currency, val: number): void { this.m_iWarContribution += val; } function setMilitaryRank(this: Currency, val: number): void { this.m_iMilitaryRank = val; } function getMilitaryRank(this: Currency): number { return this.m_iMilitaryRank; } ``` 请注意,以上代码仅是一个示例,您可能需要根据您的具体情况进行适当的调整和修改。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值