{"id":15967355,"url":"https://github.com/bryanlimy/amdgpu-opencl-caffe","last_synced_at":"2025-04-04T13:28:49.731Z","repository":{"id":113990720,"uuid":"80536711","full_name":"bryanlimy/amdgpu-opencl-caffe","owner":"bryanlimy","description":"Enablement for Caffe (OpenCL) on AMD GPUs","archived":false,"fork":false,"pushed_at":"2017-06-08T16:53:43.000Z","size":13,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-09T23:18:36.711Z","etag":null,"topics":["amd","caffe","machine-learning","ml","opencl"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bryanlimy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-31T16:09:19.000Z","updated_at":"2018-09-19T19:13:48.000Z","dependencies_parsed_at":"2023-04-30T09:15:48.046Z","dependency_job_id":null,"html_url":"https://github.com/bryanlimy/amdgpu-opencl-caffe","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bryanlimy%2Famdgpu-opencl-caffe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bryanlimy%2Famdgpu-opencl-caffe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bryanlimy%2Famdgpu-opencl-caffe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bryanlimy%2Famdgpu-opencl-caffe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bryanlimy","download_url":"https://codeload.github.com/bryanlimy/amdgpu-opencl-caffe/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247184410,"owners_count":20897768,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amd","caffe","machine-learning","ml","opencl"],"created_at":"2024-10-07T18:22:51.557Z","updated_at":"2025-04-04T13:28:49.709Z","avatar_url":"https://github.com/bryanlimy.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AMDGPU OpenCL Caffe\n### Enablement for [Caffe (OpenCL)](https://github.com/BVLC/caffe/tree/opencl) on AMD GPUs\n\n#### System Requirement\n- Ubuntu 16.04 or equivalent\n\t- Note that a supported (valid) opencl enabled driver stack is needed from AMD\n- AMD Radeon GPU (tested on):\n\t- Polaris (RX460)\n\t- Fiji (R9 Fury, Fury X)\n\t- Tonga (FirePro W7100)\n\n#### 1. Update to latest Canonical release\n- Update the apt metadata: ```sudo apt-get update```\n- Upgrade the packages: ```sudo apt-get upgrade```\n\n#### 2. Install general dependencies\n- ```sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler libatlas-base-dev libblas-dev libgflags-dev libgoogle-glog-dev liblmdb-dev libboost-all-dev cmake git python-numpy python-pip cmake```\n\n#### 3. Install AMDGPU-PRO Driver for Linux\n- **Optional - You can install driver by executing the helper script \"driver_install.sh\" script that is supplied in this repository.\n- [Download AMDGPU-PRO Driver](http://support.amd.com/en-us/kb-articles/Pages/AMDGPU-PRO-Driver-for-Linux-Release-Notes.aspx)\n- [Follow instruction to install AMDGPU-PRO Driver for Ubuntu](http://support.amd.com/en-us/kb-articles/Pages/AMDGPU-PRO-Install.aspx)\n- Reboot to the kernel that loads the installed drivers\n\n#### 4. Download [Caffe](https://github.com/BVLC/caffe)\n- Download Caffe (on this example, download repository to home folder)\n\t- `\u003e cd ~ ; git clone https://github.com/BVLC/caffe`\n\t- `\u003e cd caffe ; git checkout opencl`\n\t- `\u003e export OCLCAFFE=$PWD`\n- NOTE - tested commit [c61d48746b2df1d237c64abc7416342ce98f3251](https://github.com/BVLC/caffe/tree/c61d48746b2df1d237c64abc7416342ce98f3251)\n\n#### 5. Copy [ViennaCL](http://viennacl.sourceforge.net/) library\n- [Download ViennaCL for Linux](http://viennacl.sourceforge.net/viennacl-download.html)\n- Extract downloaded folder\n\t```\u003e tar -xvf ViennalCL-\u003cversion\u003e.tar.gz```\n- Copy extracted folder to Caffe\n\t```\u003e cp -r ViennalCL-\u003cversion\u003e ~/caffe```\n\n##### 6. Install [Caffe](https://github.com/BVLC/caffe)\n- Create directory for cmake: ```\u003e mkdir build```\n- Navigate to `build`: ```\u003e cd build```\n- Configure and cmake Caffe\n\t- ```\u003e cmake -DViennaCL_INCLUDE_DIR=../ViennaCL-\u003cversion\u003e -DOPENCL_INCLUDE_DIRS=../ViennaCL-\u003cversion\u003e/CL/ -DOPENCL_LIBRARIES=/opt/amdgpu-pro/lib/x86_64-linux-gnu/libOpenCL.so.1 ..```\n\t- Note: By default OpenCL libraries for AMDGPU is at `/opt/amdgpu-pro/x86_64-linux-gnu/libOpenCL.so.1`\n- Compile Caffe: ```\u003e make```\n\t- Note: You can enable multithreaded compilation with`-j\u003c# threads_available\u003e` to speed up the process. (i.e. for an 8 core machine we can use : `make -j8`)\n- Install Caffe: ```\u003e make install```\n- Test Caffe: ```\u003e make runtest```\n\t- Note: For multithreaded build, add `-j\u003c# cores_available\u003e` to speed up process. (i.e. for an 8 core machine we can use : `make -j8`)\n\n##### 7. Try CIFAR (CANADIAN INSTIT. FOR ADVANCED RESEARCH DATA TRAINING)\n- Go to your caffe path : ```cd $OCLCAFFE```\n- Invoke the commands from the caffe top module folder (i.e `~/caffe`):\n\t- `./data/cifar10/get_cifar10.sh`\n\t- `./examples/cifar10/create_cifar10.sh`\n\t- `./examples/cifar10/train_quick.sh`\n\n- Note: You can substitute train_quick with train_full as needed. This will increase the time needed to fully train the model, however. \n\n- Enabling Caffe's pythonic interface (PyCaffe):\n\t- Navigate to `python` in `/caffe`\n\t\t```\u003e cd python```\n\t- Install all required packages with `pip`\n\t\t```\u003e for req in $(cat requirements.txt); do sudo -H pip install $req; done```\n- Optional: Add PyCaffe module to `$PYTHONPATH`\n\t\t```\u003e export PYTHONPATH=$OCLCAFFE/python:$PYTHONPATH```\n\t\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbryanlimy%2Famdgpu-opencl-caffe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbryanlimy%2Famdgpu-opencl-caffe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbryanlimy%2Famdgpu-opencl-caffe/lists"}