Comments (8)
Hi @huan , great to meet you here! Long time no see :)
I had the same issue as you mentioned. My solution is:
- Install The NVIDIA Container Toolkit
# Setup the stable repository and the GPG key
distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \
&& curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add - \
&& curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
# Install the nvidia-docker2
sudo apt-get update
sudo apt-get install -y nvidia-docker2
# Restart the docker service
sudo systemctl restart docker
This can save us some time in tuning the extra arguments when executing docker run
. To test whether the installation works, one can run: sudo docker run --rm --gpus all nvidia/cuda:11.0-base nvidia-smi
, which should output some information about the Nvidia card.
- Add
--gpus=all --env="NVIDIA_DRIVER_CAPABILITIES=all"
into thedocker run
command. This should make the GPU work in a container.
Hopefully it helps. Cheers!
Ref:
[1] https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#setting-up-nvidia-container-toolkit
[2] https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/user-guide.html#driver-capabilities
from docker-wechat.
sudo docker run --rm --gpus all nvidia/cuda:11.0-base nvidia-smi
output the correct GPU
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 515.48.07 Driver Version: 515.48.07 CUDA Version: 11.7 |
|-------------------------------+----------------------+----------------------+
| 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:2B:00.0 On | N/A |
| 0% 39C P8 13W / 170W | 409MiB / 12288MiB | 5% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
+-----------------------------------------------------------------------------+
but still run into error
+ main
++ id -u
+ '[' 1000 -ne 0 ']'
+ startWechat
+ hello
++ cat /VERSION
+ VERSION=0.15.0
+ echo '[DoChat] 盒装微信 v0.15.0'
[DoChat] 盒装微信 v0.15.0
+ setupFontDpi
+ DELETE_KEYS=('HKEY_CURRENT_USER\Control Panel\Desktop' 'HKEY_CURRENT_USER\Software\Wine\Fonts')
+ for key in "${DELETE_KEYS[@]}"
+ wine reg DELETE 'HKEY_CURRENT_USER\Control Panel\Desktop' /v LogPixels /f
+ true
+ for key in "${DELETE_KEYS[@]}"
+ wine reg DELETE 'HKEY_CURRENT_USER\Software\Wine\Fonts' /v LogPixels /f
+ wine reg ADD 'HKEY_LOCAL_MACHINE\System\CurrentControlSet\Hardware Profiles\Current\Software\Fonts' /v LogPixels /t REG_DWORD /d 120 /f
+ /dochat/patch-hosts.sh
+ /dochat/disable-upgrade.sh
Disabling patch for /home/user/.wine/drive_c/users/user/AppData/Roaming/Tencent/WeChat ...
Disabling patch for /home/user/.wine/drive_c/users/user/Application Data/Tencent/WeChat ...
+ '[' -n true ']'
+ unset WINEDEBUG
+ wine reg query 'HKEY_CURRENT_USER\Software\Tencent\WeChat'
HKEY_CURRENT_USER\Software\Tencent\WeChat
NeedUpdateType REG_DWORD 0x0
[DoChat] DISPLAY=:0
+ echo '[DoChat] DISPLAY=:0'
++ head -1 /home/VERSION.WeChat
+ VERSION=3.3.0.115
+ echo '[DoChat] WeChat 3.3.0.115'
+ true
[DoChat] WeChat 3.3.0.115
[DoChat] Starting...
+ echo '[DoChat] Starting...'
+ '[' -n true ']'
+ wine 'C:\Program Files\Tencent\WeChat\WeChat.exe'
00e4:fixme:ver:GetCurrentPackageId (04BCFEF0 00000000): stub
00e4:fixme:sync:SetWaitableTimerEx (000000C4, 04BCFDA0, 0, 00000000, 00000000, 00000000, 1500) semi-stub
0114:fixme:iphlpapi:NotifyAddrChange (Handle 0x62efefc, overlapped 0x62efee4): stub
00e0:fixme:win:RegisterTouchWindow (00010056 00000000): stub
011c:fixme:ole:NdrCorrelationInitialize (0694F154, 0694EC30, 1024, 0x0): semi-stub
011c:fixme:ole:NdrCorrelationFree (0694F154): stub
011c:fixme:reg:RegOpenUserClassesRoot (0000019C, 0x0, 0x2000000, 0694FBC8) semi-stub
0118:fixme:wlanapi:WlanEnumInterfaces (00000001, 00000000, 063FE380) semi-stub
011c:fixme:wbemprox:client_security_SetBlanket 62EA17A8, 04A0B060, 10, 0, (null), 3, 3, 00000000, 0x00000000
011c:fixme:wbemprox:client_security_Release 62EA17A8
011c:fixme:wbemprox:client_security_SetBlanket 62EA17A8, 064465E8, 10, 0, (null), 3, 3, 00000000, 0x00000000
011c:fixme:wbemprox:client_security_Release 62EA17A8
011c:fixme:wbemprox:client_security_SetBlanket 62EA17A8, 04A0B060, 10, 0, (null), 3, 3, 00000000, 0x00000000
011c:fixme:wbemprox:client_security_Release 62EA17A8
011c:fixme:wbemprox:client_security_SetBlanket 62EA17A8, 04A0B060, 10, 0, (null), 3, 3, 00000000, 0x00000000
011c:fixme:wbemprox:client_security_Release 62EA17A8
011c:fixme:wbemprox:client_security_SetBlanket 62EA17A8, 06420D30, 10, 0, (null), 3, 3, 00000000, 0x00000000
011c:fixme:wbemprox:client_security_Release 62EA17A8
011c:fixme:wbemprox:client_security_SetBlanket 62EA17A8, 04AC4A00, 10, 0, (null), 3, 3, 00000000, 0x00000000
011c:fixme:wbemprox:client_security_Release 62EA17A8
011c:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION
011c:fixme:wbemprox:client_security_SetBlanket 62EA17A8, 04A0B060, 10, 0, (null), 3, 3, 00000000, 0x00000000
011c:fixme:wbemprox:client_security_Release 62EA17A8
0124:fixme:file:NtLockFile I/O completion on lock not implemented yet
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
X Error of failed request: GLXBadContext
Major opcode of failed request: 151 (GLX)
Minor opcode of failed request: 6 (X_GLXIsDirect)
Serial number of failed request: 285
Current serial number in output stream: 284
from docker-wechat.
Thank you very much for proposing a solution!
I'll try it out when I got time, appreciate it.
from docker-wechat.
This works for me, thanks!
from docker-wechat.
Hi @huan , great to meet you here! Long time no see :)
I had the same issue as you mentioned. My solution is:
- Install The NVIDIA Container Toolkit
# Setup the stable repository and the GPG key distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \ && curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add - \ && curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list # Install the nvidia-docker2 sudo apt-get update sudo apt-get install -y nvidia-docker2 # Restart the docker service sudo systemctl restart dockerThis can save us some time in tuning the extra arguments when executing
docker run
. To test whether the installation works, one can run:sudo docker run --rm --gpus all nvidia/cuda:11.0-base nvidia-smi
, which should output some information about the Nvidia card.
- Add
--gpus=all --env="NVIDIA_DRIVER_CAPABILITIES=all"
into thedocker run
command. This should make the GPU work in a container.Hopefully it helps. Cheers!
Ref: [1] https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#setting-up-nvidia-container-toolkit [2] https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/user-guide.html#driver-capabilities
Good Job ..
from docker-wechat.
@gluckzhang Hi, thanks for your answer but I got the error as following:
docker: Error response from daemon: failed to create shim: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error running hook #1: error running hook: exit status 1, stdout: , stderr: nvidia-container-cli: mount error: file creation failed: /var/lib/docker/overlay2/fb8685393211dac3ac80c458ef659f22c16012bd3d7803aa143e6209f40d09b1/merged/run/nvidia-persistenced/socket: no such device or address: unknown.
Do you know how to solve it?
from docker-wechat.
Hi @HRHLALALA , I just read your message. It seems that the toolkit failed to mount the NVIDIA-related files/devices.
Have you tried sudo docker run --rm --gpus all nvidia/cuda:11.0-base nvidia-smi
after installing the NVIDIA Container Toolkit? Any error there?
from docker-wechat.
Docker compose version:
wechat:
container_name: wechat
image: zixia/wechat
privileged: true
stdin_open: true
ipc: host
environment:
- XMODIFIERS=@im=fcitx
- GTK_IM_MODULE=fcitx
- QT_IM_MODULE=fcitx
- GID=1000
- UID=1000
- DISPLAY
- NVIDIA_DRIVER_CAPABILITIES=all
volumes:
- "./wechat/appdata:/home/user/.wine/drive_c/users/user/Application Data/"
- "./wechat/files:/home/user/WeChat Files/"
- "/tmp/.X11-unix:/tmp/.X11-unix"
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
from docker-wechat.
Related Issues (20)
- dochat.sh always prints "Exited with code [0]" HOT 2
- Fail to start wechat on ubuntu 22.04.2 LTS HOT 1
- unbuntu 22 install wechaty by docker get error. no such file or directory, open '/bot/package.json'
- 启动盒装微信后会影响系统进入睡眠(退出盒装微信也一样)
- 用普通用户运行,却以根用户权限创建$HOME/DoChat目录,是如何做到的呢? HOT 1
- 【需求】微信什么时候可以更新到3.9呢?
- 【问题】文件映射老是不正确 HOT 3
- 在部分Wayland的DM上有黑色遮罩窗口无法使用 HOT 2
- nvidia-container-cli: initialization error: load library failed: libnvidia-ml.so.1: cannot open shared object file: no such file or directory: unknown.
- 有没有appimage的版本?
- 如何才算成功 HOT 2
- [RP Discuss] I've confirmed zixia/wechat:3.3.0.115 can run on Linux Mint 21.2 HOT 1
- [BUG] ubuntu 20.04 运行Dochat 后每次打开wechat 都会出现一次图标, 导致有很多微信图标, 但是无法关闭,不知道如何解决
- Exited with code 0 immediately after starting HOT 1
- Outline and resizing issue
- 我使用一键部署提示“Disabling patch for /home/user/.wine/drive_c/users/user/AppData/Roaming/Tencent/WeChat ...” HOT 1
- 隐藏程序运行错误窗口 HOT 2
- 第一次执行curl拉去镜像并运行微信后,下次运行微信可以不再执行curl了吗?
- DoChat can not use "Chat History Migration & Backup" feature HOT 3
- 【bug】微信登录之后提示,版本过低,不能使用,麻烦帮忙看看 HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-wechat.