Giter Club home page Giter Club logo

Comments (8)

gluckzhang avatar gluckzhang commented on July 21, 2024 22

Hi @huan , great to meet you here! Long time no see :)

I had the same issue as you mentioned. My solution is:

  1. 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.

  1. Add --gpus=all --env="NVIDIA_DRIVER_CAPABILITIES=all" into the docker 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.

ST-Saint avatar ST-Saint commented on July 21, 2024 1

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.

huan avatar huan commented on July 21, 2024

Thank you very much for proposing a solution!

I'll try it out when I got time, appreciate it.

from docker-wechat.

Earsuit avatar Earsuit commented on July 21, 2024

This works for me, thanks!

from docker-wechat.

jicki avatar jicki commented on July 21, 2024

Hi @huan , great to meet you here! Long time no see :)

I had the same issue as you mentioned. My solution is:

  1. 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.

  1. Add --gpus=all --env="NVIDIA_DRIVER_CAPABILITIES=all" into the docker 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.

HRHLALALA avatar HRHLALALA commented on July 21, 2024

@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.

gluckzhang avatar gluckzhang commented on July 21, 2024

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.

hykilpikonna avatar hykilpikonna commented on July 21, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.