Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

X Error of failed request: GLXBadContext #50

Open
huan opened this issue Apr 26, 2020 · 8 comments
Open

X Error of failed request: GLXBadContext #50

huan opened this issue Apr 26, 2020 · 8 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@huan
Copy link
Owner

huan commented Apr 26, 2020

  • Ubuntu 19.10
  • Nvidia 430.50
  • zixia/wechat:2.9.0.114
$ wine home/user/.wine/drive_c/Program\ Files/Tencent/WeChat/WeChat.exe 

[0426/191233:INFO:exception_record.cc(518)] [QB]Process ID: 8 Type: 1
[0426/191233:ERROR:network_change_notifier_win.cc(156)] WSALookupServiceBegin failed with: 8
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:  152 (GLX)
  Minor opcode of failed request:  6 (X_GLXIsDirect)
  Serial number of failed request:  628
  Current serial number in output stream:  627

$ glxinfo
name of display: :1
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:  152 (GLX)
  Minor opcode of failed request:  6 (X_GLXIsDirect)
  Serial number of failed request:  63
  Current serial number in output stream:  62

Maybe it's related to #29

Links

  1. Support for hardware acceleration scottyhardy/docker-wine#57
@huan huan added the bug Something isn't working label Apr 26, 2020
@gluckzhang
Copy link

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

@huan
Copy link
Owner Author

huan commented Mar 13, 2021

Thank you very much for proposing a solution!

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

@Earsuit
Copy link

Earsuit commented Sep 10, 2021

This works for me, thanks!

@huan huan added the help wanted Extra attention is needed label Sep 10, 2021
@huan huan pinned this issue Sep 10, 2021
@jicki
Copy link

jicki commented Nov 2, 2021

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

This was referenced Apr 17, 2022
@HRHLALALA
Copy link

HRHLALALA commented May 4, 2022

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

@gluckzhang
Copy link

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?

@ST-Saint
Copy link

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

@hykilpikonna
Copy link

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]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

7 participants