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

Acominer fails to compile #8

Closed
happysmash27 opened this issue Dec 28, 2021 · 5 comments
Closed

Acominer fails to compile #8

happysmash27 opened this issue Dec 28, 2021 · 5 comments

Comments

@happysmash27
Copy link

I am looking into acominer as ethminer either does not work, or works intermittently and causes kernel panics, depending on which OpenCL implementation I use. Since I can't seem to find an OpenCL implementation that works consistently on my RX 480, I am seeing if Vulkan would work better instead.

When compiling acominer with cargo build --release, this results in the following error output:

error: proc macro panicked
  --> src/main.rs:69:5
   |
69 | /     vulkano_shaders::shader! {
70 | |         ty: "compute",
71 | |         path: "src/shader/dag.comp",
72 | |         include: ["src/shader"],
...  |
76 | |         }
77 | |     }
   | |_____^
   |
   = help: message: 34 compilation errors:
           src/shader/dag.comp:37: error: 'limitations' : Non-constant-index-expression
           src/shader/dag.comp:37: error: 'limitations' : Non-constant-index-expression
           src/shader/dag.comp:42: error: 'limitations' : Non-constant-index-expression
           src/shader/dag.comp:44: error: 'limitations' : Non-constant-index-expression
           src/shader/dag.comp:47: error: 'limitations' : Non-constant-index-expression
           src/shader/dag.comp:47: error: 'limitations' : Non-constant-index-expression
           src/shader/dag.comp:59: error: 'limitations' : Non-constant-index-expression
           src/shader/dag.comp:60: error: 'limitations' : Non-constant-index-expression
           src/shader/dag.comp:65: error: 'limitations' : Non-constant-index-expression
           src/shader/dag.comp:65: error: 'limitations' : Non-constant-index-expression
           src/shader/dag.comp:65: error: 'limitations' : Non-constant-index-expression
           src/shader/dag.comp:66: error: 'limitations' : Non-constant-index-expression
           src/shader/dag.comp:66: error: 'limitations' : Non-constant-index-expression
           src/shader/dag.comp:66: error: 'limitations' : Non-constant-index-expression
           src/shader/dag.comp:69: error: 'limitations' : Non-constant-index-expression
           src/shader/dag.comp:69: error: 'limitations' : Non-constant-index-expression
           src/shader/dag.comp:71: error: 'limitations' : Non-constant-index-expression
           src/shader/dag.comp:71: error: 'limitations' : Non-constant-index-expression
           src/shader/dag.comp:71: error: 'limitations' : Non-constant-index-expression
           src/shader/dag.comp:71: error: 'limitations' : Non-constant-index-expression
           src/shader/dag.comp:75: error: 'limitations' : Non-constant-index-expression
           src/shader/dag.comp:75: error: 'limitations' : Non-constant-index-expression
           src/shader/dag.comp:75: error: 'limitations' : Non-constant-index-expression
           src/shader/dag.comp:76: error: 'limitations' : Non-constant-index-expression
           src/shader/dag.comp:76: error: 'limitations' : Non-constant-index-expression
           src/shader/dag.comp:76: error: 'limitations' : Non-constant-index-expression
           src/shader/dag.comp:80: error: 'limitations' : Non-constant-index-expression
           src/shader/dag.comp:80: error: 'limitations' : Non-constant-index-expression
           src/shader/dag.comp:80: error: 'limitations' : Non-constant-index-expression
           src/shader/dag.comp:81: error: 'limitations' : Non-constant-index-expression
           src/shader/dag.comp:81: error: 'limitations' : Non-constant-index-expression
           src/shader/dag.comp:81: error: 'limitations' : Non-constant-index-expression
           src/shader/dag.comp:85: error: 'limitations' : Non-constant-index-expression
           src/shader/dag.comp:85: error: 'limitations' : Non-constant-index-expression


error: proc macro panicked
  --> src/main.rs:81:5
   |
81 | /     vulkano_shaders::shader! {
82 | |         ty: "compute",
83 | |         path: "src/shader/search.comp",
84 | |         include: ["src/shader"],
...  |
88 | |         }
89 | |     }
   | |_____^
   |
   = help: message: 63 compilation errors:
           src/shader/search.comp:109: error: 'subgroup op' : requires SPIR-V 1.3
           src/shader/search.comp:113: error: 'subgroup op' : requires SPIR-V 1.3
           src/shader/search.comp:68: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:69: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:73: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:73: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:73: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:74: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:74: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:74: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:78: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:78: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:78: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:78: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:79: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:79: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:79: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:79: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:108: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:108: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:125: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:125: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:125: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:126: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:126: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:126: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:127: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:127: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:127: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:128: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:128: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:128: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:129: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:129: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:129: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:130: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:130: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:130: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:131: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:131: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:131: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:132: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:132: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:132: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:137: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:137: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:137: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:137: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:146: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:146: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:152: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:152: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:152: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:153: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:153: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:153: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:161: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:162: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:166: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:168: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:168: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:168: error: 'limitations' : Non-constant-index-expression
           src/shader/search.comp:168: error: 'limitations' : Non-constant-index-expression


error: proc macro panicked
   --> src/main.rs:93:5
    |
93  | /     vulkano_shaders::shader! {
94  | |         ty: "compute",
95  | |         path: "src/shader/search.comp",
96  | |         include: ["src/shader"],
...   |
101 | |         }
102 | |     }
    | |_____^
    |
    = help: message: 63 compilation errors:
            src/shader/search.comp:109: error: 'subgroup op' : requires SPIR-V 1.3
            src/shader/search.comp:113: error: 'subgroup op' : requires SPIR-V 1.3
            src/shader/search.comp:68: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:69: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:73: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:73: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:73: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:74: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:74: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:74: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:78: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:78: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:78: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:78: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:79: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:79: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:79: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:79: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:108: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:108: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:125: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:125: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:125: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:126: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:126: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:126: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:127: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:127: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:127: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:128: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:128: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:128: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:129: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:129: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:129: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:130: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:130: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:130: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:131: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:131: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:131: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:132: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:132: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:132: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:137: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:137: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:137: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:137: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:146: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:146: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:152: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:152: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:152: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:153: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:153: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:153: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:161: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:162: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:166: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:168: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:168: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:168: error: 'limitations' : Non-constant-index-expression
            src/shader/search.comp:168: error: 'limitations' : Non-constant-index-expression


error[E0433]: failed to resolve: could not find `ty` in `dag_cs`
   --> src/main.rs:107:21
    |
107 |     config: dag_cs::ty::Config,
    |                     ^^ could not find `ty` in `dag_cs`

error[E0433]: failed to resolve: could not find `ty` in `search_cs`
   --> src/main.rs:115:52
    |
115 |     output_buf: Arc<CpuAccessibleBuffer<search_cs::ty::Output>>,
    |                                                    ^^ could not find `ty` in `search_cs`

error[E0433]: failed to resolve: could not find `ty` in `dag_cs`
   --> src/main.rs:147:30
    |
147 |     let mut config = dag_cs::ty::Config {
    |                              ^^ could not find `ty` in `dag_cs`

error[E0433]: failed to resolve: could not find `ty` in `dag_cs`
   --> src/main.rs:214:71
    |
214 |             .push_constants(dag_pipeline.layout().clone(), 0, dag_cs::ty::PushConstants { conf: config });
    |                                                                       ^^ could not find `ty` in `dag_cs`

error[E0433]: failed to resolve: could not find `ty` in `dag_cs`
   --> src/main.rs:472:105
    |
472 | ...   .push_constants(pipeline.search[current_pipeline].pipeline.layout().clone(), 0, dag_cs::ty::PushConstants { conf: pipeline.config });
    |                                                                                               ^^ could not find `ty` in `dag_cs`

error[E0425]: cannot find function `load` in module `dag_cs`
   --> src/main.rs:133:30
    |
133 |         let shader = dag_cs::load(device.clone())?;
    |                              ^^^^ not found in `dag_cs`

error[E0422]: cannot find struct, variant or union type `SpecializationConstants` in module `dag_cs`
   --> src/main.rs:134:92
    |
134 | ...   ComputePipeline::new(device.clone(), shader.entry_point("main").unwrap(), &dag_cs::SpecializationConstants { light_size }, None, So...
    |                                                                                          ^^^^^^^^^^^^^^^^^^^^^^^ not found in `dag_cs`

error[E0425]: cannot find function `load` in module `search_cs_64`
   --> src/main.rs:139:36
    |
139 |         let shader = search_cs_64::load(device.clone())?;
    |                                    ^^^^ not found in `search_cs_64`

error[E0422]: cannot find struct, variant or union type `SpecializationConstants` in module `search_cs_64`
   --> src/main.rs:140:98
    |
140 | ...y_point("main").unwrap(), &search_cs_64::SpecializationConstants { dag_size_mix }, None, Some(subgroup_size), |_| {})?
    |                                             ^^^^^^^^^^^^^^^^^^^^^^^ not found in `search_cs_64`

error[E0425]: cannot find function `load` in module `search_cs`
   --> src/main.rs:142:33
    |
142 |         let shader = search_cs::load(device.clone())?;
    |                                 ^^^^ not found in `search_cs`

error[E0422]: cannot find struct, variant or union type `SpecializationConstants` in module `search_cs`
   --> src/main.rs:143:95
    |
143 | ....entry_point("main").unwrap(), &search_cs::SpecializationConstants { dag_size_mix }, None, Some(subgroup_size), |_| {})?
    |                                               ^^^^^^^^^^^^^^^^^^^^^^^ not found in `search_cs`

error[E0433]: failed to resolve: could not find `ty` in `search_cs`
   --> src/main.rs:176:109
    |
176 |             CpuAccessibleBuffer::from_data(device.clone(), BUFFER_USAGE_WITH_TRANSFER, true, search_cs::ty::Output::default())?
    |                                                                                                             ^^^^^^ not found in `search_cs::ty`
    |
help: consider importing this struct
    |
9   | use std::process::Output;
    |

Some errors have detailed explanations: E0422, E0425, E0433.
For more information about an error, try `rustc --explain E0422`.
error: could not compile `acominer` due to 15 previous errors

I have not used the custom Mesa as I am unsure what its purpose is and I would have to find a way to get it to work with my package manager. This does not appear to be related to it, but if it is, I can also figure out a way to install that. Is there any patch of its changes available? Gentoo's portage should be able to work with patches easier than changing the entire source location of the repository.

@ishitatsuyuki
Copy link
Owner

It's likely that you're using an extremely old shaderc binary. Either update it, or download a fresh copy of Vulkan SDK and set the environment variables according to https://github.com/google/shaderc-rs.

If you're compiling acominer from source, you need to build the mesa fork as well. acominer only works on this modified version of driver. You don't need to install it system-wide; just follow the instructions to build it, install to a prefix inside the build directory, and override the driver when you run acominer.

@happysmash27
Copy link
Author

The good news, is that after updating many files on my system, acominer finally builds successfully! So I can close this issue.

That bad news, is that the fork seems to fail to install:

build % ninja install
[1/2] Installing files.
Installing src/amd/vulkan/libvulkan_radeon.so to /home/happysmash27/Gits/EthereumMine/acominer/deps/mesa/build/install/lib64
Installing src/amd/vulkan/radeon_icd.x86_64.json to /home/happysmash27/Gits/EthereumMine/acominer/deps/mesa/build/install/share/vulkan/icd.d
Installing /home/happysmash27/Gits/EthereumMine/acominer/deps/mesa/src/util/00-mesa-defaults.conf to /home/happysmash27/Gits/EthereumMine/acominer/deps/mesa/build/install/share/drirc.d
Failed to restore SELinux context of installed files...
Standard output:

Standard error:
No such file or directory

So I might need to create a new issue for that.

@happysmash27
Copy link
Author

On second thought, I think what needed to be installed was installed correctly, I just accidentally used the wrong VK_ICD_FILENAMES path at first. So, I think it will work!

@ishitatsuyuki
Copy link
Owner

You probably have something weird with your SELinux setup. If it runs fine, then there is no need to worry about the SELinux error.

Note that there are previous reports that the hashrate is low on Polaris cards (#5). I have since given up on resolving that as I don't have such a card to debug on.

@happysmash27
Copy link
Author

It is true, that the hashrate is low, about half of what it is supposed to be and under 3/4th what it was on ethminer, at about 16.6 MH/s. It does, however, actually consistently work, submitting actually usable shares without freezing, crashing, or causing kernel panics, which is considerably better than what I was using before. Thank you so much for this wonderful program! I may work on debugging it myself in the future, since I do have this card and am currently learning Vulkan. For now, though I will increase the workgroup count, and let it be while I continue learning Vulkan. I may also try this "nsfminer" the other issue mentions, as I was not aware of it until now.

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

No branches or pull requests

2 participants