Skip to content

install AMD opencl drivers from ubuntu repo#387

Open
Ahiknsr wants to merge 2 commits into
openworm:developmentfrom
Ahiknsr:amd_driver
Open

install AMD opencl drivers from ubuntu repo#387
Ahiknsr wants to merge 2 commits into
openworm:developmentfrom
Ahiknsr:amd_driver

Conversation

@Ahiknsr

@Ahiknsr Ahiknsr commented Apr 21, 2026

Copy link
Copy Markdown

use amd opencl drivers(mesa based) from ubuntu repo instead of installing from sourceforge

Closes: #385

tested by running sibernetic and simulation is rendering correctly.

ow@2b6d2f0ccfe5:~/sibernetic$ ./Release/Sibernetic -f demo2

@Ahiknsr Ahiknsr marked this pull request as draft April 21, 2026 21:16
Comment thread Dockerfile Outdated
@pgleeson

Copy link
Copy Markdown
Member

Thanks @blamechris. This is currently still a draft, and just pointing to that fork for testing. See #385 (comment)

running sibernetic before this code change (doesn't detect gpu)
```
Configuration has been loaded
 CL_PLATFORM_VERSION [0]:       OpenCL 3.0 PoCL 5.0+debian  Linux, None+Asserts, RELOC, SPIR, LLVM 16.0.6, SLEEF, DISTRO, POCL_DEBUG
 CL_PLATFORM_VERSION [1]:       OpenCL 3.0
CL_CONTEXT_PLATFORM [0]: CL_DEVICE_NAME [0]:    cpu-haswell-Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz
```

running sibernetic after this code change(detects the gpu)
```
pci id for fd 4: 10de:1f99, driver (null)
pci id for fd 4: 10de:1f99, driver (null)
 CL_PLATFORM_VERSION [0]:       OpenCL 3.0 CUDA 13.0.98
 CL_PLATFORM_VERSION [1]:       OpenCL 3.0 PoCL 5.0+debian  Linux, None+Asserts, RELOC, SPIR, LLVM 16.0.6, SLEEF, DISTRO, POCL_DEBUG
 CL_PLATFORM_VERSION [2]:       OpenCL 3.0
CL_CONTEXT_PLATFORM [0]: CL_DEVICE_NAME [0]:    NVIDIA GeForce GTX 1650
```
@Ahiknsr Ahiknsr marked this pull request as ready for review June 30, 2026 09:37
@Ahiknsr

Ahiknsr commented Jun 30, 2026

Copy link
Copy Markdown
Author

@pgleeson While this patch successfully equips the container to utilize both NVIDIA and AMD GPUs, it introduces a challenge regarding how we pass GPU device arguments to Docker.

To grant the container GPU access, we need to pass hardware-specific flags, which behave very differently on mismatched hardware:

  • NVIDIA: Requires --gpus all. This degrades gracefully—if a host only has an AMD GPU or no GPU at all, this argument simply acts as a harmless no-op.

  • AMD: Requires --device /dev/kfd. Unlike the NVIDIA flag, if we pass this argument on a host without an AMD GPU, the container will fatally fail to start.

Because of this strict failure condition for AMD, we cannot hardcode a "one-size-fits-all" Docker command. The arguments must be dynamically generated based on the host's hardware at runtime.

Considering the number of scripts we currently maintain that directly invoke docker run, injecting hardware-detection logic into every single one of them would be messy and non-ideal. Would love to get your thoughts on the best way to handle this. We may need to look into consolidating the docker run logic into a single wrapper script to avoid duplicating device setup logic across the repository

$ rg 'docker run'
run.cmd
18:docker run -d ^

run-shell-only.sh
10:docker run -ti \

run-shell-only.cmd
5:docker run -it ^

run-quick.sh
26:docker run -d \

run-jl.sh
5:docker run -it --rm -p 8888:8888 "openworm/openworm:$version" jupyter lab --NotebookApp.default_url=/lab/ --ip=0.0.0.0 --port=8888 --allow-root

run2.sh
33:docker run -d \

run2-shell-only.sh
14:docker run -ti \

run.sh
56:docker run -d \

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants