Error E0310 - I'm a complete beginner

Can you give the complete output, including your cargo run line, and ending with that error message?

There are two possibilities here, given the code:

  1. Something about the OpenCL code that's included is upsetting your OpenCL driver; that's out-of-scope for this forum, and would need OpenCL expertise to fix.
  2. The Rust code is panicking, and the panic message (which you've elided) will tell us what's failing.

Here is the error code, google drive previewable link;

thread 'main' panicked at src/main.rs:139:93:
called `Result::unwrap()` on an `Err` value: ProgramBuild(BuildLog(

followed by a bunch of C compiler warnings and a few errors. I have done some decoding for everyone:

<kernel>:308:33: error: passing '__generic uchar *' (aka '__generic unsigned char *') to parameter of type 'const uchar *' (aka 'const unsigned char *') changes address space of pointer
        ripemd160_process( ctx, ctx->buffer );
                                ^~~~~~~~~~~
<kernel>:116:59: note: passing argument to parameter 'data' here
void ripemd160_process( RIPEMD160_CTX *ctx, const uint8_t data[64] )
                                                          ^
<kernel>:316:33: error: passing 'const __generic uchar *' (aka 'const __generic unsigned char *') to parameter of type 'const uchar *' (aka 'const unsigned char *') changes address space of pointer
        ripemd160_process( ctx, input );
                                ^~~~~
<kernel>:116:59: note: passing argument to parameter 'data' here
void ripemd160_process( RIPEMD160_CTX *ctx, const uint8_t data[64] )
                                                          ^
<kernel>:3143:10: error: passing '__generic uchar *' (aka '__generic unsigned char *') to parameter of type 'const unsigned int *' changes address space of pointer
  sha256(input, input_len, output);
         ^~~~~
<kernel>:649:50: note: passing argument to parameter 'pass' here
static void sha256(__private const unsigned int *pass, int pass_len, __private unsigned int* hash) {
                                                 ^
<kernel>:3143:28: error: passing '__generic char *' to parameter of type 'unsigned int *' changes address space of pointer
  sha256(input, input_len, output);
                           ^~~~~~
<kernel>:649:94: note: passing argument to parameter 'hash' here
static void sha256(__private const unsigned int *pass, int pass_len, __private unsigned int* hash) {
                                                                                             ^
<kernel>:3144:10: error: passing '__generic char *' to parameter of type 'const unsigned int *' changes address space of pointer
  sha256(output, 32, output);
         ^~~~~~
<kernel>:649:50: note: passing argument to parameter 'pass' here
static void sha256(__private const unsigned int *pass, int pass_len, __private unsigned int* hash) {
                                                 ^
<kernel>:3144:22: error: passing '__generic char *' to parameter of type 'unsigned int *' changes address space of pointer
  sha256(output, 32, output);
                     ^~~~~~
<kernel>:649:94: note: passing argument to parameter 'hash' here
static void sha256(__private const unsigned int *pass, int pass_len, __private unsigned int* hash) {
                                                                                             ^
<kernel>:3149:10: error: passing '__generic uchar *' (aka '__generic unsigned char *') to parameter of type 'const unsigned int *' changes address space of pointer
  sha256(input, input_len, &sha256_result);
         ^~~~~
<kernel>:649:50: note: passing argument to parameter 'pass' here
static void sha256(__private const unsigned int *pass, int pass_len, __private unsigned int* hash) {
                                                 ^
<kernel>:3149:28: warning: incompatible pointer types passing 'uchar (*)[32]' to parameter of type 'unsigned int *'
  sha256(input, input_len, &sha256_result);
                           ^~~~~~~~~~~~~~
<kernel>:649:94: note: passing argument to parameter 'hash' here
static void sha256(__private const unsigned int *pass, int pass_len, __private unsigned int* hash) {
                                                                                             ^
<kernel>:3150:13: warning: incompatible pointer types passing 'uchar (*)[32]' to parameter of type 'const __generic uchar *' (aka 'const __generic unsigned char *')
  ripemd160(&sha256_result, 32, output);
            ^~~~~~~~~~~~~~
<kernel>:362:31: note: passing argument to parameter 'msg' here
void ripemd160(const uint8_t *msg, uint32_t msg_len, uint8_t hash[20])
                              ^
<kernel>:3150:33: error: passing '__generic char *' to parameter of type 'uchar *' (aka 'unsigned char *') changes address space of pointer
  ripemd160(&sha256_result, 32, output);
                                ^~~~~~
<kernel>:362:62: note: passing argument to parameter 'hash' here
void ripemd160(const uint8_t *msg, uint32_t msg_len, uint8_t hash[20])
                                                             ^

Looks like CUDA address space violations.

3 Likes

I wish i had the knowledge to actually put the error here like this to make it easier for you guys. I'm feeling hesitant to request help...

That log is useful, and tells us what's going on - next time, if you put it inside ``` marks (put ``` on a line by itself, then add the full log, then put ``` on a line by itself), it'll be inlined.

The good news is that the Rust code is working fine; the bad news is that the OpenCL code is not compiling with your GPU's OpenCL driver. You can take the decoded look from @riking to an OpenCL forum, and with any luck, they'll be able to help you debug what it is about the OpenCL code that your GPU driver is choking on.

2 Likes

Thank you all so much. I guess i will continue in OpenCL forums then. Much thanks. So glad kind souls still exist.

2 Likes

As a piece of general advice when asking for help on forums, err on the side of giving us too much information, not too little. You need to arrange things so that the things you think are important come first (so I can read quickly and see "yes, this looks like something I can help with"), but one of the skills a beginner hasn't yet developed is the art of filtering out the irrelevant bits.

Ideally, you'd post everything I need to try the thing myself, and also full instructions for reproducing what you've done (along with a log of your attempt to do it). That way, I can look at your instructions and see if you've missed something important; I can attempt to repeat the work myself, and see if I get a different failure. And I can look at your attempt, and see if it matches a known pattern I've seen before (e.g. I once posted details of a GLSL problem I was having, to be told that it worked on some GPU vendors and not others because I'd missed a f where it made no semantic difference, but was required by the language).

3 Likes

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.